Mock Interviewer

Ask Coach

Ask Coach
Clarify requirements before you design — kept separate from your stage notes.

Tap a question to start, or type your own below.

Logging System Design

Visual Problem Diagram

Logging System Design architecture diagram

Scenario

Picture an online shop on a busy night. Every time a customer pays, the shop's software writes a short note about what just happened, and engineers call each of those notes a log line. At 2am something breaks, and the engineer on call searches those notes to find out why. Now imagine the place those notes are sent has slowed down, and the checkout page is waiting for each note to be saved before it answers the customer. Payments stall, not because payments are broken, but because of the notes about payments. A logging system is the part that collects the notes from every service, keeps them searchable, and has to do all of that without ever slowing down the services it is watching.

Stuck on where to start? Ask Coach

Clarify this problem here, or open Pathway Coach if you want a prep plan first.

Free Coach trial
How should I start prep?

This problem asks you to design a logging system, which is the part of a company's software that collects the short notes every service writes about what it is doing, keeps them in one place, and lets engineers search them later. Each of those notes is called a log line. A payment service might write one line for every charge, and a login service might write one for every sign-in. When something goes wrong, the engineers on call search those lines to work out what happened. Recent lines must be quick to search, older lines stay available through a slower and cheaper lookup, passwords and similar secrets never show up in search, and when the system is overloaded some lines may be dropped while others must be kept.

In the interview you need to explain five things. First, how a service writes a line without waiting forever when the far end is slow. Second, which lines may be thrown away under pressure and which must be kept or at least reported. Third, how a flood from one noisy service stays off everyone else's search. Fourth, how a search over recent days stays fast without keeping every old line on expensive disks. Fifth, how one search is kept from scanning the whole archive. The brand of the search product matters much less, so mention it briefly and move on.

Constraints

Functional

Services hand over their short notes, the system pulls named fields out of each note and strips secrets, and people can search recent notes with filters. Dashboards and alerts can count selected notes, older notes follow a keep-or-delete rule, debug notes may be sampled or dropped under pressure, and audit and security notes get a stronger keep promise.

Non-functional

A recent search that names a time range should answer in a few seconds so someone on call can use it during an incident. The write path should keep accepting notes while a noisy service is held back, one team should not be able to read or drown another team's notes, and secrets must not appear in search results.

Scale

Thousands of services may write millions of notes a second, so the write rate is the heavy flow. Volume can reach hundreds of terabytes a day. Recent days stay on fast search storage, and older notes stay for months or years on cheaper storage.

Stages ahead

1Requirement Analysis
2API Design
3High-Level Design
4HLD Extensions
5Trade-offs

Not ready to design yet?

Try the free Coach trial — ask how to prep, what to practice first, or how InterviewCrafted works. Sign in when you want to start this problem.

Try Coach free

Log in to start practicing

Preview the problem below. Sign in to start your timed session, save progress, and use the AI coach.

Want full access now? View Pro pricing