Asynchronous to Synchronous Problem

A real-life interview question asking to convert asynchronous execution to synchronous execution.

Asynchronous to Synchronous Problem

This is an actual interview question asked at Netflix.

Imagine we have an Executor class that performs some useful task asynchronously via the method asynchronousExecution(). Additionally, the method accepts a callback object which implements the Callback interface. The passed-in callback object’s done() method gets invoked when the asynchronous execution is complete. The definition for the involved classes is below:

Level up your interview prep. Join Educative to access 80+ hands-on prep courses.