Spotify: Traffic light simulation in plain HTML, CSS and JavaScript
Task. Build a working traffic-light simulation in the browser using only plain HTML, CSS and JavaScript, with no frameworks. The light should cycle through its states on a timer.
What to plan for (the post gives no further requirements):
- How you model the states and their durations.
- How you drive the timing, for example chained timeouts versus an interval.
- How you keep the rendering separate from the state logic so the sequence is easy to change.
Context. This was the front-end round of a New York software engineer virtual onsite. The onsite also included a system design round, a medium-difficulty coding problem and a values interview, after an easy tech screen. The candidate rated the experience positively but did not get an offer. The post does not mention follow-ups or what the interviewer focused on.
Comments 0
No comments yet. Ask the author something, or add what happened in your own round.