Traffic Light

Yangshun TayEx-Meta Staff Engineer
语言

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.

在这些公司提问

Unlock company signalsPremium shows which companies ask this question so you can prioritize practice by target company.
Unlock

加载编辑器

    Traffic Light 在 React | UI 面试问题