mirror of
https://github.com/blindlobstar/go-interview-problems
synced 2025-04-25 03:05:14 +00:00
First Successful Key Lookup
You are given an interface Getter
, which retrieves a value for a given key from a remote address. However, you don't know which address has the value, and network calls can fail.
Your task is to implement the Get function that:
- Calls
Getter.Get()
for each address in parallel. - Returns the first successful response.
- If all requests fail, returns an error.
Tags
Concurrency
Source
- Mock-собеседование по Go от Team Lead из Яндекса by it-interview