# Design a knowledge graph for search: system design interview question

> Entity identity, source conflicts, reversible merges, and fast graph reads as facts change.

Source: https://sysround.com/questions/design-knowledge-graph-for-search
Updated: 2026-11-05


Difficulty: hard. Levels: Senior, Staff+.

## How the interviewer opens it

"Design a knowledge graph that enriches search results with entities and relationships. The system must resolve duplicate entities and maintain provenance as facts change."

## What to clarify first

- Entities and sources
- Graph size
- Traffic and read:write mix
- Search interface
- Latency and availability
- Freshness and consistency
- Duplicate entities
- Provenance and conflicts
- Durability and retention
- Exclusions

## Scope of a strong answer

Core requirements:

- Accept entity facts and relationships from structured sources.
- Resolve duplicate entities and correct identity errors.
- Preserve source evidence as facts change or disappear.
- Serve entity facts and related entities for search results.

Usually out of scope:

- Build the search engine or its ranking model.
- Extract facts from text or crawl web pages.
- Infer new facts through general reasoning.
- Support arbitrary graph queries.

## What interviewers probe

### Entity identity

Similar records can describe different entities. An incorrect merge can move many facts and relationships to the wrong entity.

### Fact changes and sources

Several sources can support one fact or make conflicting claims. A correction must preserve evidence without reviving obsolete claims.

### Graph reads for search

Two hops can reach millions of entities. A small response limit does not automatically bound database work.

### Updates that reach search

One identity correction can affect many views. Failures can leave search with stale identities or facts that a source withdrew.

## Common mistakes

- The design treats equal names as proof of identity.
- The design destroys source records when it merges entities.
- The design stores one value without its supporting assertions.
- The read path scans all edges before it applies the response limit.
- The update path cannot repair views after a merge reversal.
- The design assumes that a graph database also solves identity and provenance.

## The bar by level

- **Senior:** Defines reversible identity decisions and independent source assertions. Handles conflicts, retractions, event order, and high-degree entities. Connects durable writes to versioned read views with a repair path.
- **Staff+:** Defines identity invariants across concurrent merges and splits. Bounds repair work and protects search during large corrections. Sets measurable accuracy, freshness, and partition policies.

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


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