InterviewDB
Question
Trip Counter - Tracking Active Journeys with Start/End Events
phone
Question Details
Round 1 - Coding Problem You are given a list of events. Each event is either "START" or "END". A trip begins on a START event and ends on the next END event. Implement a TripCounter class that processes events one at a time and returns the number of completed trips at any point. Example Follow-ups What if events include a trip ID and you need to match START/END by ID? How does your data structure change? How would you handle an END event with no matching START? Should it throw, return -1, or be…
Full Details
🔒
Unlock all Axon questions
Full insider details, leaked discussions, and candidate experiences.
Get full access — $100 a year, unlimited accessAbout This Question
This is a reported interview question from a axon interview during the phone round.
It covers the following topics: System Design, Coding, Phone .