Physics Phenomenon Visualization
Nagwa interview question (Egypt) · stage: Take-home Task · domain: Frontend · role: Frontend Engineer · difficulty: Medium · asked once, last in March 2021
What they ask
JavaScript developer candidates are given a take-home task that matches the product: build an interactive visualisation of a physics phenomenon in the browser. Interviews for the role took place in Cairo, and the task is sent before the technical discussion.
Reported shape of the brief: pick or be assigned a phenomenon (projectile motion, a simple pendulum, wave interference, or a ball bouncing with damping), and build a page where a student can change one or two parameters (angle and initial speed, string length, frequency) and watch the result update. Plain JavaScript with Canvas or SVG is welcome; a framework is fine if it does not hide the physics.
Minimum expectations that come up in the review:
- The physics is right: units, time step, and the equations used are stated in a comment or the README.
- Animation uses
requestAnimationFrameand does not depend on frame rate for the simulation step. - Controls are keyboard and mouse accessible and the page works on a tablet.
- The code is organised: simulation state separated from rendering, no globals sprawl.
What they look for
Correctness of the model first, then how clearly you can explain it to someone who teaches physics. A polished but wrong pendulum loses to a plain but correct one. They also look at how you handle edge inputs (zero speed, negative angle) and whether the code would let a content team add a second phenomenon without a rewrite.