PracHub
QuestionsCoachesLearningGuidesInterview Prep

Quick Overview

This question evaluates proficiency in concurrent programming, focusing on coordination, synchronization, early termination, and best-effort cancellation when racing multiple asynchronous boolean-returning calls.

  • medium
  • Temporal
  • Coding & Algorithms
  • Software Engineer

Implement Concurrent Any-True Shot

Company: Temporal

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: medium

Interview Round: Technical Screen

You are given a function `shot(index) -> bool`. Each call may take between 1 and 10 seconds to return. Implement `volleyShot(indices) -> bool` for a list of indices. Requirements: - Start multiple `shot` calls concurrently. - Return `True` as soon as any call returns `True`. - Return `False` only after all calls have completed and every call returned `False`. - If the answer is already known, do not keep waiting for slower calls when the runtime allows best-effort cancellation. - If `indices` is empty, return `False`. The focus is on concurrency and early termination.

Quick Answer: This question evaluates proficiency in concurrent programming, focusing on coordination, synchronization, early termination, and best-effort cancellation when racing multiple asynchronous boolean-returning calls.

Given shot records [index, duration, result], return whether volleyShot would return True. Empty input returns False.

Constraints

  • Inputs are Python literals matching the function signature.
  • Return a deterministic exact-match value.

Examples

Input: ([(1,5,False),(2,2,True),(3,9,False)],)

Expected Output: True

Explanation: A true shot exists.

Input: ([],)

Expected Output: False

Explanation: No shots.

Input: ([(1,1,False),(2,3,False)],)

Expected Output: False

Explanation: All false.

Hints

  1. Choose a representation that makes the requested operation direct.
  2. Handle empty inputs and boundary cases first.
Last updated: Jun 27, 2026

Loading coding console...

PracHub

Master your tech interviews with 8,000+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities
  • Student Access

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • AI Coding Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.