Traffic Lights
Design a system for controlling traffic lights at a single intersection. The system should manage the alternating release of traffic flow for North-South lanes and East-West lanes. Assume cars are only going straight through the intersection, and turning movements do not need to be considered.
AI interview prep
Core dilemma
Balancing the need for a clear, deterministic state machine for traffic light control against the potential for race conditions or deadlocks if not implemented carefully, especially when considering object-oriented design principles for managing distinct traffic flows.
3 tradeoffs and 2 stress tests locked
Interview prep
Unlock the interviewer X-Ray rubric, tradeoff matrix, stress tests, clarifying questions, and key concepts.
Traffic Lights
Design a system for controlling traffic lights at a single intersection. The system should manage the alternating release of traffic flow for North-South lanes and East-West lanes. Assume cars are only going straight through the intersection, and turning movements do not need to be considered.