Code Room
CodingHardcod-g1134
Subject ConcurrencyLevel Mid–Senior~30 minCommon in Concurrency interviewsIndustries Software development, Technology

Question

Resolve a graph of futures. nodes is a list of [id, kind, deps, latency]. kind is 'value' (an immediately-available leaf, deps empty) or 'combine' (resolves only after ALL of its deps resolve). A 'value' node resolves at time = latency. A 'combine' node resolves at time = (max of its deps' resolution times) + latency. There are no cycles. Return the list of [id, resolution_time] sorted by resolution_time ascending, breaking ties by ascending id.

Implement
resolve_futures(nodes: list[list]) → list[list]
Examples
in[[[1,"value",[],5],[2,"value",[],3],[3,"combine",[1,2],2]]]out[[2,3],[1,5],[3,7]]
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.