# Design a service discovery system: system design interview question

> An endpoint registry must track instance health, deliver client updates, and limit stale data during failures.

Source: https://sysround.com/questions/design-service-discovery-system
Updated: 2026-11-05


Difficulty: hard. Levels: Mid-level, Senior, Staff+.

## How the interviewer opens it

"Design a system that registers service instances and lets clients discover healthy endpoints. Instances start, fail, and move while clients continue to send requests."

## What to clarify first

- Deployment and record count
- Clients
- Read and write traffic
- Registration lifetime and health
- Latency and failure bounds
- Consistency and availability
- Durability
- Endpoints and moves
- Access control
- Scope limits

## Scope of a strong answer

Core requirements:

- Register and remove service instances
- Track application readiness and registration lifetime
- Return endpoint sets and deliver client updates
- Handle process replacement and registry faults

Usually out of scope:

- Discover services across regions
- Provide a DNS interface
- Build a proxy for application traffic
- Move all instances in one atomic operation

## What interviewers probe

### Endpoint health and registration lifetime

A missing heartbeat can mean a failed instance or a network fault. Registry reachability does not prove that an instance can serve application requests.

### Client update delivery

A client needs a complete endpoint view while instances change. Slow clients and popular services can cost more than the registry state.

### Instance identity and moves

An address can identify different processes over time. Requests from an old process must not change its replacement.

### Registry behavior during partitions

Clients need endpoints during registry faults. A reachable server can still hold an old view or lack authority to confirm it.

## Common mistakes

- Place a registry query on every application request.
- Treat a heartbeat as proof that every client can reach the application.
- Ignore the gap between an initial endpoint list and later updates.
- Use an address as the complete identity of an instance.
- Return cached data without a limit on its age.
- Partition the registry before estimating its small record set and large subscriber load.

## The bar by level

- **Mid-level:** Defines the API and instance records. Handles readiness, heartbeat expiry, and process removal. Keeps registry calls outside application requests.
- **Senior:** Connects snapshots to later updates without gaps. Rejects stale process requests. Handles bounded client queues, quorum loss, and the 60-second freshness limit.
- **Staff+:** Quantifies fanout and reconnect pressure. Defines renewal acknowledgment and expiry behavior across leader changes. Plans capacity limits and safe client upgrades. If the interviewer adds the second-region requirement, defines each region's authority.

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


---
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.
