FastPrepConcurrent Volley Shot
Problems/Concurrent Volley Shot

Concurrent Volley Shot

Temporal logoTemporal● MediumFULLTIMEPHONE SCREEN

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: A firsthand Temporal phone-screen report dated April 14, 2026 gives a shot(index) API that takes one to ten seconds. It asks for a concurrent volleyShot(indices) that returns true when any call returns true. Here, arrays of delays and results stand in for the real calls, so the answer is always the same. Our version is about 96% the same as the reported question.

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.

In this practice version, 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.

More Temporal interview questions

  • Normalize and Aggregate Error LogsPHONE SCREEN · Seen Feb 2026
  • Concurrent Web Crawler ReachabilityPHONE SCREEN · Seen Oct 2025
  • Delayed Task Executor OrderingPHONE SCREEN · Seen May 2025
  • Game of Life Next GenerationONSITE INTERVIEW · Seen Oct 2025

Similar questions at other companies

  • Top K With a Deterministically Noisy Comparator (MLE)Mercor · ONSITE INTERVIEWMercor interview questions
  • Mutual-Friend RecommendationsMeta · PHONE SCREEN · ONSITE INTERVIEWMeta interview questions
  • Filter, Sort, and Deduplicate Scheduled TasksRippling · PHONE SCREEN · ONSITE INTERVIEWRippling interview questions
  • Merge Sorted Squares of Two ArraysWhatNot · PHONE SCREEN · ONSITE INTERVIEWWhatNot interview questions
  • Top K Frequent ElementsAmazon · OA · PHONE SCREEN
  • Merge Overlapping IntervalsAtlassian · PHONE SCREEN · ONSITE INTERVIEWAtlassian interview questions
  • Merge Weekday and Time IntervalsNextdoor · PHONE SCREENNextdoor interview questions
  • Peak Chat Load Across AgentsCresta · PHONE SCREENCresta interview questions
  • Longest Consecutive SequenceJP Morgan Chase · PHONE SCREENJP Morgan Chase interview questions
  • Determine the Winner of Three-Card HandsOpenAI · PHONE SCREENOpenAI interview questions
All Temporal interview questionsSee Temporal hiring insights
Saved
class Solution {
    public boolean volleyShot(int[] latencies, boolean[] results) {
        // Write your code here.
    }
}
Checking account…