Google L4 Phone screening

Posted
1 Sept 2025
386 reads

Summary

I had a phone screening interview with Google for an L4 position, where I was challenged with a problem involving stream processing and triplet formation.

How it went

During my Google L4 phone screen, I was presented with an interesting data structure problem. The task involved continuously processing a stream of integers. For each new number, I needed to determine if a triplet could be formed from the current set of numbers in memory such that the difference between the maximum and minimum of the three numbers was at most a given value d. If such a triplet was found, it had to be immediately removed and returned. This required careful consideration of how to efficiently manage the numbers in memory and quickly identify valid triplets as they arrived.

Questions asked (1)

  1. 01

    Stream Triplet with Difference Constraint

    Data Structures & Algorithms · Hard

    You are given a stream of integers arriving one by one, and an integer d. At any time, you may form a triplet of numbers from the stream if the difference between the maximum and minimum of the three numbers is at most d. Once a triplet is formed, those three numbers must be immediately removed from memory and cannot be reused in any other triplet.

    Design a data structure that processes the stream online:

    • When a new number arrives, insert it into memory.
    • If any valid triplet can be formed, remove it immediately and return it.

    Continue this process for the entire stream.

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!