Peak Concurrent Guests per Attraction Queue From Scan Logs
Last updated: November 29, 2026
Quick Overview
Given queue scan records (attraction, enter_time, exit_time) with exit times exclusive, return for each attraction the peak number of guests in line at once and the earliest time that peak was reached.
Disney
November 29, 20260
0
0 solved
Given queue scan records (attraction, enter_time, exit_time) with exit times exclusive, return for each attraction the peak number of guests in line at once and the earliest time that peak was reached.
A technical-screen question in the style of Disney Parks operations engineering, where queue entry and ride-boarding scans drive wait-time estimates in the My Disney Experience app. The interviewer checks a sweep line with correct handling of simultaneous events.
What the Interviewer Expects
- Turn intervals into +1 and -1 events and sort
- Process exits before entries at the same timestamp
- Group by attraction so each sweep is independent
- Track the time the peak first occurs
- Discard or flag malformed intervals
Key Topics to Cover
How to Approach This
- Clarify input constraints and edge cases before writing code.
- Walk through your approach verbally and confirm with the interviewer before coding.
- Start with a brute force solution, then optimize. Mention time and space complexity.
- Test your solution with examples, including edge cases like empty input or duplicates.
- Consider common patterns: sliding window, two pointers, hash map, BFS/DFS, dynamic programming.
Possible Follow-up Questions
- How would you report every maximal window where the peak holds, not just its start?
- Scans stream in all day; how would you maintain the live count?
- How would you estimate posted wait time from this count and ride throughput?
- What if some guests never get an exit scan?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice DSA ProblemsSample Answer
Requirements
Each record means a guest is in the queue for enter <= t < exit. Output: {attraction: (peak, first_time)}. A guest who leaves at 10 and another who enters at 10 do not overlap, which matches the e...
High-Level Design
For each attraction, emit (enter, +1) and (exit, -1). Sort events by time; because -1 < +1, tuple sorting naturally puts exits before entries at the same moment, which is exactly the exclusive-e...