Design a Fail-Safe Railroad Crossing Control System
Design local and fleet-level control that lowers railroad-crossing gates before a train arrives and raises them only after the crossing is safely clear.
Problem statement
For this exercise, assume a fleet of railroad crossings. Each crossing has redundant approach and clearance sensors, two road gates, and several local computers. When a train approaches, both gates must lower before it reaches the road; they may rise only after the train has cleared.
Design the safety-critical local control path plus central monitoring and configuration. Any uncertainty about train presence or gate state must fail safe by keeping the crossing closed and alerting an operator. Local safety must continue during a wide-area network outage.
Train dispatch, track signaling outside the crossing, and mechanical gate design are outside scope.
What to build
- Combine approach, occupancy, and clearance observations into a conservative local view of whether a train may enter or occupy the crossing.
- Command both gates, verify their physical positions, and keep them down while a train may be present.
- Continue safe local operation through a sensor, controller, or network failure and require explicit recovery before reopening after ambiguous state.
- Give operators a fresh fleet view, durable event history, health alerts, and a guarded path for versioned configuration changes.
At scale
- Assume 10,000 crossings, each with four sensors producing up to 10 observations per second during an active train movement.
- A healthy local controller must react to a safety-relevant observation within 100 ms and normally establish both gates down at least 20 seconds before the train reaches the road.
- The crossing must remain safe after one sensor failure and one local-computer failure, and it must operate without the central service for up to 24 hours.
- The central view should reflect healthy crossing state within 5 seconds and retain an auditable 30-day event and command history.