Event ID Check Completion Times
Reported by candidates from TikTok's online assessment. Pattern, common pitfall, and the honest play if you blank under the timer.
The detail that decides this TikTok OA, reported August 2026, is a 300-second ID check and a queue cap of 10 waiting people. It's a queue simulation, and the tie-break rule is where most people slip. Someone arriving at the exact second another person finishes has to wait behind the existing queue. You're returning a completion time per person, and anyone who walks away gets their own arrival time back. If you're nervous, StealthCoder runs invisibly during the live assessment as a safety net if you blank on the edge cases. The logic is short once you see it.
The problem
Imagine an exclusive event that many people wish to attend. The event starts at time 0. For every person attending, you are given a time in seconds (since the start time of the event) representing when they arrived at the event. However, entry into this event requires an identification check which takes time, so people may wait in the queue to enter. Specifically, it takes 5 minutes to do an ID check for every attendee. Additionally, if the person arrives at the event and sees that there are more than 10 people in the queue, they leave immediately. Your task is to return an array of integers representing the time when each person will be processed and their ID check completed. The time should be in seconds since the start time of the event. If a person leaves immediately upon arrival, this time should be the same as their arrival time. Notes: The queue size is calculated by the number of people waiting to start their ID check, not including the person who is already in the process of ID check. If a new person arrives at the same moment as when another person completes their ID check, the first person waiting in the queue should have their ID checked first, and the new person should wait in the queue. Note: You are not expected to provide the most optimal solution, but a solution with time complexity not worse than O(times.length^2) will fit within the execution time limit. Function solution(times: int[]) → int[] Examples Example 1 times = [4, 400, 450, 500] return = [304, 700, 1000, 1300] Let consider this scenario: The first person arrives at time 4, and there is no one in the queue, so they immediately start their ID check. Queue = []. The first person finishes their ID check at time 304. Queue = []. The second person arrives at time 400, and there is no one in the queue, so they immediately start their ID check.
Reported by candidates. Source: FastPrep
Pattern and pitfall
Treat it as a simulation with a running clock. Keep a list of completion times for everyone who joined. For each arrival at time t, count how many accepted people haven't started their check yet. A person has started if their start time (completion minus 300) is strictly less than or equal to t. Careful with the tie: if someone finishes at exactly t, that slot goes to the first waiter, so the new arrival still counts as waiting. If the waiting count exceeds 10, the answer is t. Otherwise start = max(t, last completion) and the answer is start + 300. The pitfall is counting the person currently being checked as part of the queue. The O(n^2) bound means a plain scan per arrival is fine. If the live OA freezes you, StealthCoder is the hedge, but the rule set above is the whole problem.
The honest play: practice the pattern, and have StealthCoder ready for the one you didn't see coming.
You can drill Event ID Check Completion Times cold, or you can hedge it. StealthCoder runs invisibly during screen share and surfaces a working solution in under 2 seconds. The proctor sees the IDE. They don't see what's behind it. Built for the candidate who saw this exact problem leak two days before his OA and wondered if anyone had a play.
Get StealthCoderRelated leaked OAs
You've seen the question.
Make sure you actually pass TikTok's OA.
TikTok reuses patterns across OAs. Built for the candidate who saw this exact problem leak two days before his OA and wondered if anyone had a play. Works on HackerRank, CodeSignal, CoderPad, and Karat.
Event ID Check Completion Times FAQ
What's the trick in the TikTok Event ID Check problem?+
Track the completion time of the last accepted person. For each arrival, count accepted people who haven't started their check yet. If that count is above 10, they leave and get their arrival time. Otherwise start at the later of arrival and last completion, then add 300 seconds.
How hard is this one really?+
Easy to medium. There's no fancy data structure, just careful simulation. The difficulty is in the edge rules: queue excludes the person being checked, and ties at the same second favor the person already waiting. Get those right and it's about 15 lines.
How do I handle someone arriving the moment a check finishes?+
The first person in the queue gets the next slot, and the new arrival waits. So when counting the queue for the new arrival, anyone who finishes at exactly that second is done, but the next waiter starts at that second and no longer counts as waiting only if their start is at or before t.
Do people who leave count toward the queue?+
No. They leave immediately, so they never join, never delay anyone, and never update the last completion time. Their output is just their arrival time. Only add accepted people to your list of completion times.
Can I get away with O(n^2)?+
Yes. The problem says anything not worse than O(n^2) fits the limit. Scanning previous accepted people for each arrival is fine. You could use a deque to pop finished people and get O(n), but it's not required.