Return the First Successful Result from Parallel API Calls Under a Global Timeout
Company: Apple
Role: Software Engineer
Category: Software Engineering Fundamentals
Difficulty: medium
Interview Round: Technical Screen
Overview: Implement a function that runs several slow, failure-prone backend API calls concurrently and returns the first successful result within a single overall timeout. It tests concurrency primitives, deadline handling, reporting when every call fails, and cleaning up calls that are still in flight, using threads, futures, or async code.