How do you make a synchronous wrapper around an async method?
Essence
Technically — with a DispatchSemaphore: create a semaphore with value 0, call the asynchronous method, store the result and signal() in the callback, and block on wait() outside. But in an interview it matters more to explain why this is an anti-pattern and what the correct direction of wrapping is.
The rest of this answer, with code and interview follow-ups, is in the DevPrep app.
Read the full answer in DevPrep