Design a traffic light controller for an intersection. Include state transitions between red, yellow, and green, timing controls, and coordination across multiple lights.
Suggested time: 45 minutes
Loading the workspace...
A traffic light seems like three colored bulbs on a timer. But a real traffic light system must coordinate multiple lights at an intersection to prevent conflicting greens (a safety-critical invariant), handle emergency vehicle overrides that preempt normal cycling, synchronize pedestrian crossing signals, and ensure that state transitions across all lights happen atomically. The design challenge is modeling concurrent state machines that must agree on a safe global state at all times.
State Cycling
Intersection Coordination
Emergency Vehicle Override
Pedestrian Crossing Signals
Design a Stack and Queue (easy)
Design a Deck of Cards (easy)
Design a Shape Calculator (easy)
Design a Vending Machine (easy)
Design a Logger System (easy)
Design a Tic-Tac-Toe Game (easy)