Headway·Software Engineer·Technical Phone Screen
- Given a log of road events parsed into typed objects (ENTRY, MAINROAD, EXIT), implement a function that counts the total number of complete journeys across all vehicles, where events from different vehicles may be interleaved.
“My first instinct was to just count ENTRY events and call it a day, which is wrong the moment you think about interleaving.”