google logo
Google· SDE II

Google | L4 | Phone Screening | April 2025

Posted
22 Apr 2025
369 reads

Summary

I had a phone screening at Google for an L4 role in April 2025 where I was asked to design an algorithm for managing birthday reminders in a family tree.

How it went

Question:

Design an algorithm to manage birthday reminders for your family tree. You are given a genealogical tree representing your direct ancestors, rooted at you. Each person in the tree has a name and birthday. Your task is to implement a function alarmNextBirthday() that sets an alarm for the next upcoming birthday in the family tree. After that birthday passes, alarmNextBirthday() should be called again to set an alarm for the subsequent upcoming birthday, and so on.

Approach:

  1. Maintain a Min Heap where the priority is the number of days left until their next birthday, based on today's date
  2. Build a deque from it to preserve the birthday order.
  3. alarmNextBirthday() a. Pop the front of the deque → that's the next birthday b. Append them to the back (so it recycles to next year) c. Return the person

Questions asked (1)

  1. 01

    Design Birthday Reminders for Family Tree

    Data Structures & Algorithms

    Design an algorithm to manage birthday reminders for your family tree. You are given a genealogical tree representing your direct ancestors, rooted at you. Each person in the tree has a name and birthday. Your task is to implement a function alarmNextBirthday() that sets an alarm for the next upcoming birthday in the family tree. After that birthday passes, alarmNextBirthday() should be called again to set an alarm for the subsequent upcoming birthday, and so on.

Know someone preparing? Send it to them:WhatsAppLinkedInX

Interviewed at Google recently?

Write up your rounds while you still remember the questions. It helps the next person more than you would think.

Share your experience
Discussion 0

Questions for the author, or how your own interview compared.

Join the discussion

Sign in with Google to comment or ask the author a question.

No comments yet

Be the first to share your thoughts and start the discussion!