FastPrepLogger Rate Limiter
Problems/Logger Rate Limiter

Logger Rate Limiter

Google logoGoogle● EasyFULLTIMEPHONE SCREEN

Updated Dec 2026

QuestionExamples

Problem statement

Source note: Reported in a Google L4 software engineer phone screen. Logs arrive in a stream, and each one is passed on unless a log with the same text went out within the previous 10 seconds. The interviewer then asked how to keep memory small on an endless stream, and how the answer changes if held-back logs also count.

The report gives the rule and one example but no limits. Here, instead of writing a class or calling receive and send functions, you get the logs as two lists in arrival order and return whether each one is sent. Timestamps never go down, and a message sent exactly 10 seconds later goes out again. Both follow-ups are covered in the editorial, not in the tests.

Our version is about 90% the same as the reported question.

Given a stream of logs in arrival order as timestamps and messages, return a boolean array whose i-th value is true when the i-th log is sent on and false when it is held back.

Log i arrived at second timestamps[i] with the text messages[i]. A log is sent unless the same message was already sent in the last 10 seconds: the log at time t is held back when an earlier log with the same message was sent at a time greater than t - 10. Only logs that were sent count. A held-back log does not restart the 10 seconds, and a message sent again exactly 10 seconds after its last send goes out.

The problem statement continues
Pro

Examples

Example 1

timestamps = [10,11,13,14,21,35]messages = ["ABCD","XYZ","ABCD","XYZ","ABCD","XYZ"]return = [true,true,false,false,true,true]

ABCD is sent at 10 and XYZ at 11. At 13 and 14 the same messages were sent less than 10 seconds ago, so both are held back. At 21, ABCD was last sent at 10, 11 seconds earlier, so it is sent. At 35, XYZ was last sent at 11, 24 seconds earlier, so it is sent.

02 · Example 2
FastPrep Pro
Reported in 1 Google interview this week

Unlock this recently reported problem

FastPrep Pro gives you full access to interview problems reported within the last week.

  • Full problem statement and constraints
  • 2 more worked examples, explained
  • Guided hints and editorial
  • Run your code on real test cases
$8.25/month

$99 billed yearly — or $19 month-to-month. Cancel anytime.

Free plan — 2 of 2 free unlocks used this week

More Google Phone Screen questions

  • Count Winning Dice Face PairsPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Logger Rate Limiter with Every-Arrival HistoryPHONE SCREEN · Seen Nov 2026
  • Minimum Cars for Rental RequestsOA · PHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Route Pattern MatcherPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Periodic-Color Binary Forest RootsPHONE SCREEN · Seen Nov 2026
  • Evaluate a Nested Math ExpressionPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Best Stock Trade with Buy and Sell DaysPHONE SCREEN · Seen Nov 2026
  • Word Chain Jumps in a GridPHONE SCREEN · Seen Nov 2026
  • Dice-Walk Winning ProbabilityPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Lowest Common Ancestor in an N-ary TreePHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026

Similar questions at other companies

  • Design an Ordered StreamBloomberg LP · OA · PHONE SCREEN · ONSITE INTERVIEWBloomberg LP interview questions
  • Insert Delete GetRandom O(1)Charta Health · PHONE SCREENCharta Health interview questions
  • Portfolio Tickers with Constant-Time Random PickCitadel · PHONE SCREENCitadel interview questions
  • Randomized String MultisetLinkedIn · PHONE SCREENLinkedIn interview questions
  • Build a Pivot Table with TotalsSigma Computing · PHONE SCREEN
  • Process On-Call Routing OperationsOpenAI · PHONE SCREENOpenAI interview questions
  • Stateful Paginated Fetch NLyft · PHONE SCREENLyft interview questions
  • Linear-Probing Key-Value StoreEase · PHONE SCREEN
  • Escape Room LeaderboardPinterest · PHONE SCREEN · ONSITE INTERVIEWPinterest interview questions
  • Role-Based Network Access ControlOkta · PHONE SCREENOkta interview questions

Google interview experiences

  • Google interviews · November 2026
  • Google Software Engineer Onsite Questions: 10 Experiences
  • Google OA: What It Tests (2026)
  • Google L4 SWE Phone Screen: 1 Experience
  • Google ML Engineering Manager Onsite: 1 Experience
  • Google Experienced SWE First Round and Onsite: 1 Experience
All Google interview questionsSee Google hiring insights
CodePython 3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import heapq
from collections import defaultdict
 
class Solution:
def solve(self, values, queries):
# Build the adjacency structure
n = len(values)
graph = defaultdict(list)
for u, v in queries:
graph[u].append(v)
 
best = [float("inf")] * n
heap = [(0, 0)]
while heap:
cost, node = heapq.heappop(heap)
if cost > best[node]:
continue
Run and Submit unlock with Pro
FastPrep Pro
Reported in 1 Google interview this week

Unlock this recently reported problem

FastPrep Pro gives you full access to interview problems reported within the last week.

  • Full problem statement and constraints
  • 2 more worked examples, explained
  • Guided hints and editorial
  • Run your code on real test cases
$8.25/month

$99 billed yearly — or $19 month-to-month. Cancel anytime.

Free plan — 2 of 2 free unlocks used this week