educative.io

Query on Thread Safe Deferred Callback

Hello,
Can someone please explain the actual question here?
Design and implement a thread-safe class that allows registeration of callback methods that are executed after a user specified time interval in seconds has elapsed.

Do we need to design a class which will call certain methods after some interval?

Hi @Debashis_Das, Thanks for reaching out to us.
Class and methods are already provided. The task is that the class exposes an API called registerCallback() that’ll take a parameter of type Callback. Anyone calling this API should be able to specify after how many seconds should the executor invoke the passed-in callback.
Hope it will help :slight_smile: