Google Phone Screen | June 2025
Company: Google
Role: L4
Interview Stage: Phone Screen
Location: unknown
Year: 2025
Original Post Content:
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 timeline, 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 registered : 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 its respective list
3. Find the top of the Map, as it now contains the next recent future execution time, and then find the delay = now - execTime
4. update the executionCallbackList with the list of Callbacks that are to be executed.
5. invoke scheduleHardwareTimer(delay)
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
2. 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 of course there were syntax errors. I mostly wrote a structured modular code with OOPs concepts I repeatedly explained the whole code flow and how things are panning out.
---
tl-dr
I would like to thank the leetcode community cause I have learned so much from it, also please comment down your best approach for the problem statement.
----
Verdict
Round cleared, moving to onsites.