# Design a distributed counter service: system design interview question

> Counter accuracy, client retries, and popular counters create tradeoffs between exact results, availability, and throughput.

Source: https://sysround.com/questions/design-distributed-counter-service
Updated: 2026-11-05


Difficulty: hard. Levels: Senior, Staff+.

## How the interviewer opens it

"Design a service that lets many clients increment counters and read their values. The service must support high traffic and some very popular counters."

## What to clarify first

- Counter operations
- Read modes
- Scale
- Traffic mix
- Popular counters
- Latency and freshness
- Availability and consistency
- Request retries
- Durability and geography
- Scope limits

## Scope of a strong answer

Core requirements:

- Create a counter with an exact or relaxed read mode
- Add a positive integer to a counter
- Read a counter under its chosen consistency contract
- Prevent duplicate increments during the supported retry period

Usually out of scope:

- Decrements, resets, and counter deletion
- Quota enforcement
- Transactions across counters
- Service operation across multiple regions

## What interviewers probe

### What a counter read means

An exact read needs one valid point in time. Separate reads can produce a total that never existed.

### One very popular counter

A popular counter concentrates work on one value. Its write rate and read rate can exceed one server's capacity.

### Request retries

A lost response can cause a duplicate increment. Separate updates to retry records and totals can cause permanent count errors.

### Zone failures and recovery

Exact reads, durable acknowledgements, and service access from every network partition cannot all remain available.

## Common mistakes

- Treating atomic increments as a complete answer to exact distributed reads
- Confusing total service throughput with throughput for one counter
- Claiming an exact total from independent stripe reads
- Ignoring duplicate increments after client retries
- Promising bounded read delay during an unlimited partition
- Keeping one retry record per request without estimating its storage cost

## The bar by level

- **Senior:** Separates exact and relaxed paths. Quantifies stripe capacity, read cost, and retry storage. Explains atomic deduplication, durable acknowledgements, and recovery.
- **Staff+:** Defines precise consistency contracts and capacity limits. Handles ownership changes and proves freshness claims from source progress. Explains how client protocols affect deduplication cost and regional availability.

Practice this question with an AI interviewer: https://sysround.com/practice/new?problem=distributed-counter


---
SysRound (https://sysround.com) is an AI practice tool for system design interviews. It has a voice or typed AI interviewer and a shared whiteboard. At the end, you get feedback on each skill and a model answer. The AI feedback can be wrong.
