PracHub
QuestionsLearningGuidesInterview Prep
|Home/System Design/Google

Design log management with auto-deletion

Last updated: Mar 29, 2026

Quick Overview

This interview question evaluates requirements, scale assumptions, API/data design, architecture, trade-offs, failure modes, and rollout in a realistic interview setting. A strong answer for Design log management with auto-deletion states assumptions, handles edge cases, explains trade-offs, and shows how to validate the result clearly.

  • medium
  • Google
  • System Design
  • Software Engineer

Design log management with auto-deletion

Company: Google

Role: Software Engineer

Category: System Design

Difficulty: medium

Interview Round: Technical Screen

##### Question Design a log management system that ( 1) keeps the total number of logs ≤ total_max, ( 2) automatically deletes the least important or oldest logs when adding new ones to stay within limits, and ( 3) locates logs to delete in O( 1) time using appropriate data structures (e.g., time-ordered deque plus priority heap).

Quick Answer: This interview question evaluates requirements, scale assumptions, API/data design, architecture, trade-offs, failure modes, and rollout in a realistic interview setting. A strong answer for Design log management with auto-deletion states assumptions, handles edge cases, explains trade-offs, and shows how to validate the result clearly.

Related Interview Questions

  • Match Tagged Problems to Skilled Programmers at Scale - Google (medium)
  • Design a Task Scheduler for Opaque Long-Running GPU Jobs ("Design Sora") - Google (hard)
  • Design A Drive-Style Usage Quota Limiter - Google (medium)
  • Design a Security Monitoring Framework - Google (medium)
  • Design an Online Coding Judge Platform - Google (medium)
|Home/System Design/Google

Design log management with auto-deletion

Google logo
Google
Aug 4, 2025, 10:55 AM
mediumSoftware EngineerTechnical ScreenSystem Design
5
0

Design log management with auto-deletion

Design a Bounded Log Management System with O(1) Victim Selection

Context

You are designing an in-memory log buffer that ingests log entries and must never exceed a configured capacity (total_max). Each log has:

  • id (unique)
  • timestamp (arrival time; assume non-decreasing or we treat arrival time separately from event time)
  • importance (integer; lower means less important)
  • payload (opaque)

When the buffer is full and a new log arrives, the system should automatically evict logs to stay within capacity, preferring to remove the least important logs; ties are broken by oldest timestamp.

Requirements

  1. Maintain total number of logs ≤ total_max at all times.
  2. On insert, automatically delete logs to make room, preferring:
    • Lowest importance first, and if there’s a tie,
    • Oldest by arrival timestamp.
  3. Locate the next log to delete in O(1) time (e.g., via a time-ordered deque and a min-priority heap). Overall update/eviction cost can exceed O(1) due to necessary re-indexing.

Deliverables

  • Describe the core data structures and how they interact.
  • Specify insertion and eviction algorithms and their time/memory complexity.
  • Include assumptions, tie-breaking rules, and handling of out-of-order timestamps.
  • Provide concise pseudocode for key operations.

Constraints & Assumptions

  • Preserve the scope, facts, inputs, and requested outputs from the prompt above.
  • If the prompt leaves a detail unspecified, state a reasonable assumption before relying on it.
  • Keep the answer interview-ready: concise enough to present, but concrete enough to implement or evaluate.

Clarifying Questions to Ask Guidance

  • Clarify users, core use cases, read/write patterns, scale, latency, availability, and data retention.
  • State explicit assumptions before making sizing or architecture decisions.
  • Prioritize the functional path first, then address reliability, security, observability, and rollout.

What a Strong Answer Covers Guidance

  • A scoped requirements summary with concrete non-goals and success metrics.
  • API, data model, architecture, consistency, capacity, and operations.
  • Reasoned trade-offs among simple and scalable designs, including bottlenecks and failure modes.
  • A validation, monitoring, migration, and launch plan appropriate for the risk level.

Follow-up Questions Guidance

  • What breaks first at 10x traffic or data volume?
  • How would you degrade gracefully during dependency failures?
  • What metrics and alerts would prove the design is healthy after launch?

Submit Your Answer to Earn 20XP

Sign in to leave a comment

Loading comments...

Browse More Questions

More System Design•More Google•More Software Engineer•Google Software Engineer•Google System Design•Software Engineer System Design

Your design canvas — auto-saved

PracHub

Master your tech interviews with 9,000+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • AI Coding Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.