Code Room
CodingHardcod-g229
Subject Concurrency simulationLevel Senior–Staff~35 minCommon in Concurrency interviewsIndustries Software development

Question

Simulate a single-server queue deterministically. You are given a list of (arrival, service) tuples sorted by arrival time ascending (integers). The server processes one job at a time in arrival order (FIFO). A job's start time is the max of its arrival time and the previous job's finish time; its finish time is start + service. Return a list of finish times in input order. The list may be empty. All times are non-negative integers.

Implement
simulate_queue(jobs: list[tuple]) → list[int]
Examples
in[[[0,3],[1,2],[5,1]]]out[3,5,6]
What a strong answer looks like

State your approach and its time/space complexity out loud before you optimize. Handle the edge cases (empty input, duplicates, overflow), and say why you chose this over the brute force. Green tests are the floor, not the grade.

Vibe coding: describe the solution in plain language (or narrate it) and the coach grades your approach. Generating runnable code from your description is coming next.

Run or narrate your approach, then ask the coach.