There are price providers, and each one has a price method that takes a SKU and asynchronously returns a CompletableFuture with a price. Write a method bestPrice that takes a SKU and a list of providers, queries all of them in parallel, and returns a CompletableFuture with the lowest price: providers that fail or don't respond within two seconds are skipped, and if nobody returned a price, the result completes with an error.
~15 min by voice
How to approach it
They're checking whether you can build a non-blocking composition of CompletableFutures: a parallel fan-out, a timeout and error isolation for each call, aggregation via allOf, and correct handling of an empty result with an exception rather than null.
The interviewer will ask this question and listen. Think out loud and ask for a hint if you need one. When you're done, pause or tap “That's my answer”. In about a minute, your score and the points you covered show up here.