Google Interview Follow-up | Logger Rate Limiter Variant (Stream with Delayed Buffering)

1133
Sep 04, 2026

Hi everyone,

I encountered an interesting variant of LC 359. Logger Rate Limiter during a recent technical discussion and wanted to share it with the community to see alternative clean designs or optimization ideas.
Unlike the standard problem where a message prints immediately and starts a cooldown window, this variation looks at the absolute arrival gaps of a message across an incoming data stream.


Problem Statement

  • You are designing a message logging system that processes a stream of messages arriving sequentially by timestamp.
  • Given a time window of 10 seconds, a message should be shown to the user if and only if it does not appear twice within any 10-second window. If a message appears within 10 seconds of another instance of the exact same message, both instances must be suppressed (hidden).
  • You are given a data structure representing the message status:
struct Status {
    var timestamp: Int
    var message: String
}

func getNextStatus() -> Status
  • Implement a class/function showMessage(_ status: Status) that processes these streaming inputs dynamically.

Key Constraints & Nuances

  • The Stream is Dynamic: You do not have the complete array of inputs upfront. It is a live sequential stream of Status objects.
  • Retrospective Invalidation: Because a future duplicate can invalidate a message that just arrived, you cannot print a message immediately at its arrival timestamp. You must buffer/delay processing until you are sure no duplicate appears in its 10-second window.

Example Walkthrough

Consider the following sequential stream of inputs for the message "foo":

Screenshot 2026-09-04 at 11.42.49 AM.png


Expected Console Output:

[23s] foo

🧠 Over to You: Share Your Thoughts!

I would love to see how the community tackles this constraint. Please share your answers, intuition, or unique approaches below!
Specifically:

  • What is your structural intuition? How would you handle this streaming lookahead problem without a 10-second hard delay?
  • Memory Optimizations: How would you optimize the memory footprint for an infinite data stream to prevent the historical tracking map from growing forever?
  • Alternative Data Structures: Can this be done cleanly using an array-backed sliding window deque or a doubly-linked list instead of a full tracking map?

Looking forward to discussing your solutions and reading your alternative approaches!

Comments (3)