Concurrent Volley Shot
Reported by candidates from Temporal's online assessment. Pattern, common pitfall, and the honest play if you blank under the timer.
Temporal reportedly sent this one out in April 2026, and it looks scarier than it is. It's dressed up as a concurrency problem, with shots firing in parallel and a volley that resolves early. Strip the story and it's a single pass over an array. With up to 100000 shots, you don't need to simulate anything heavy. If you've got an OA invite and the word "concurrent" is making you nervous, relax. The judge already gave you deterministic latencies and results. StealthCoder is there as a safety net if you blank during the live OA, but this one is mostly about not overthinking it.
The problem
A production shot(index) call may take between one and ten seconds and returns a boolean. All shots must start concurrently, and volleyShot completes with true as soon as any shot returns true; it returns false only after every shot has returned false. For this deterministic judge adapter, latencies[i] is the completion time of shot i and results[i] is its returned value. Process completions in increasing latency order, breaking ties by smaller index, and return the volley result. Function volleyShot(latencies: int[], results: boolean[]) → boolean Examples Example 1 latencies = [9000,1000,5000] results = [true,false,true] return = true The 1-second false completes first; the 5-second true completes the volley. Example 2 latencies = [1000,2000,3000] results = [false,false,false] return = false All shots finish false. Example 3 latencies = [7000] results = [true] return = true The only shot succeeds. Constraints 1 <= latencies.length == results.length <= 100000. 1 <= latencies[i] <= 10000 milliseconds.
Reported by candidates. Source: FastPrep
Pattern and pitfall
The trick: the volley returns true if any result is true, and false only if all are false. Sorting by latency and breaking ties by index doesn't change that answer. The winning completion is the earliest true, but the return value is just whether a true exists. So the whole problem collapses to checking if any element in results is true. That's O(n) time and O(1) space. The pitfall is building a full event simulation with sorting, a heap, or timers because the prompt says to process completions in order. That works at 100000 elements in O(n log n), but it's wasted effort and a place to introduce tie-break bugs. Write the sorted version only if you want to mirror the spec literally. If the live OA freezes you on the framing, StealthCoder can surface the one-line answer while you stay calm. Check the single-element case and the all-false case before submitting.
StealthCoder is the hedge for the one pattern you didn't drill. It runs invisibly during the screen share.
You can drill Concurrent Volley Shot 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. If you're reading this with an OA window open, you're who this was built for.
Get StealthCoderRelated leaked OAs
You've seen the question.
Make sure you actually pass Temporal's OA.
Temporal reuses patterns across OAs. If you're reading this with an OA window open, you're who this was built for. Works on HackerRank, CodeSignal, CoderPad, and Karat.
Concurrent Volley Shot FAQ
What's the trick in Concurrent Volley Shot?+
The answer is true if any entry in results is true, otherwise false. The latency ordering and index tie-break describe how the volley resolves, but they never change the final boolean. Scan the array once and return as soon as you see a true.
Do I need to sort by latency?+
No. Sorting by latency with index tie-breaks gives the same boolean as a plain any-true check. You can sort to mirror the prompt, and it passes at 100000 elements, but it's unnecessary. The linear scan is simpler and has fewer ways to break.
How hard is this problem really?+
Easy once you see through the framing. The concurrency language is the obstacle, not the algorithm. Temporal reported it in April 2026, and the real work is a single loop. Most of your time should go to edge cases, not design.
What edge cases should I test?+
Test a single-element array with true, a single-element array with false, all false, and a true at the very last index. Also test tied latencies with mixed results. All of them should match the any-true rule, which confirms your tie handling doesn't matter.
How do I prepare for this in 48 hours?+
Practice recognizing when a wordy prompt reduces to a simple reduction over an array. Write the any-true loop, then the sorted version, and confirm they agree. Spend the rest of your time on other array and sorting basics, since this one needs almost no prep.