Google Phone Screen | June 2025

Anonymous User
621
Jun 23, 2025
Jun 24, 2025

So I recently appeared for Google L4 Phonescreen.

I have 4+ years of experience and have worked at FAANG + Unicorn Startup.

The recruiter had reached out in May 1st week and asked for a phone-screen time-line, i asked for odd 1 month. I prepped mostly DSA Medium-Hard (Neetcode 250), I have previously prepped for LLD/Machine-Coding/Concurrency rounds as well.


Problem Summary

You have to build a delayed task scheduler:

scheduleCallback(Callback callback, long timeOutInMillis)
means the callback should be run after timeout ms.

These callbacks must execute at currentTime + timeout.

You get one low-level timer interface:
scheduleHardwareTimer(timeout)

which wakes you up once after timeout ms and calls handleHardwareTimer().

handleHardwareTimer() is class method which has access to your class methods and objects. From inside handleHardwareTimer(), you can now run pending callbacks.


Code Skeleton

// Class method exposed to clients
void scheduleCallback(Callback callback, long timeOutInMillis) {

// receive 1 callBack invocation
mycallback = callback;
scheduleHardwareTimer(timeoutInMillis)
}

// Library method has registerd : handleHardwareTimer()
void scheduleHardwareTimer(long timeoutInMillis);

// Class method
void handleHardwareTimer() {

mycallback.run();
}


Requirement Gathering

Multiple callbacks can be scheduled at the same future time.

Parallel execution of callbacks is allowed (e.g., thread pool).

Constraints: Only one scheduleHardwareTimer can be active at a time.

When it fires, we need to figure out what callbacks are ready to run, run them, and then reset the hardware timer for the next soonest callback.

You’re building a kind of delayed task scheduler on top of hardware timer.


Approach

Data Structure :

Ordered Map of (executionTime, Callback*)
List<Callback*> executionCallbackList list of Callback* that are to be executed when the handleHardwareTimer() is executed.

Scheduling a Callback

  1. Compute execTime = now + timeoutInMillis.

  2. Push (execTime, cb) into the Ordered Map or if the execTime exists then append the cb to it's respective list

  3. Find the top of the Map, as it now contains the next recent future exection time, and then find the dealy = now - execTime

  4. update the executionCallbackList with the list of Callbacks that are the to be executed.

  5. invoke scheduleHardwareTimer(dealy)

Hardware‐Timer Handler

  1. When handleHardwareTimer() is invoked, iterate through the executionCallbackList and execute the cb in parallel.

  2. Prune the expired execTime keys from the orderedMap

  3. After executing due tasks, if the ordered map is nonempty, schedule the next hardware timer.


Conclusion

I would say that i had odd 20 minutes to discuss the approach + code + dry-run and i wrote optimal operational code but ofcourse there were syntax errors. I mostly wrote a structured modular code with OOPs concepts I repeated explained the whole code flow and how things are panning out.


tl-dr

I would like to thank the leetcode community cause i have learnt so much from it, also please comment down your best approach for the problem statement.


Verdict

Round cleared, moving to onsites.

Comments (3)