Summer sale! Get 10% off annual plan with the code SUMMERSALE23, grab your discount today! Check out other promotions

Traffic Light

Author
Yangshun Tay
Yangshun TayEx-Meta Staff Engineer
Languages
HTMLCSSJS
Difficulty
Medium
Recommended duration to spend during interviews
20 mins
Users completed

Build a traffic light where the lights switch from green to yellow to red after predetermined intervals and loop indefinitely. Each light should be lit for the following durations:

  • Red light: 4000ms
  • Yellow light: 500ms
  • Green light: 3000ms

You are free to exercise your creativity to style the appearance of the traffic light.

Similar Questions

Loading editor