The interview problem

Practice prompt

An assistant accumulates notes across projects. Design a memory consolidation service that retains useful preferences while handling contradictions, expired facts and deletion requests.

Original practice, not a reported company interview. All worked numbers are illustrative. Interview date: not applicable. Written October 3, 2026.

1. Scope and assumptions

This is curated long-term memory, not conversation storage. Assume explicit tenant isolation and user-visible correction. Distinguish user statements, observed outcomes and model inferences. Do not store secrets merely because they appeared in a conversation.

2. Architecture and decisions

Candidate fact → provenance and consent filter → conflict lookup → versioned memory → scoped retrieval

Represent each fact with subject, predicate, value, scope, source event, observation time and expiry. Keep confidence separate from authority: repeated model guesses do not outweigh one explicit correction. A consolidation worker proposes merges, preserving supporting evidence and superseded versions rather than flattening contradictions into an unsupported sentence.

Retrieve only facts applicable to the current project and time. An old preference for short answers may remain useful; a project deadline needs an expiry. Make deletion propagate to derived summaries and retrieval indexes through a dependency map. Use a tombstone to prevent a delayed worker from recreating a deleted fact from stale input. Minimize retained raw evidence according to the configured retention policy.

3. Work through the example

At 2,000 candidate facts per day and a 15% acceptance rate, the service accepts 300 facts daily. A 30-day live window holds roughly 9,000 facts before merges and deletions. If each indexed record occupies an assumed 2 KB, that is 18 MB in decimal units, excluding replicas and source evidence.

4. Failure cases and trade-offs

Merging two people with similar names contaminates memory. Summaries can erase qualifying conditions. Time-to-live alone cannot implement immediate deletion. Strong provenance adds storage and retrieval overhead but makes correction explainable. When a conflict cannot be resolved, retrieve the alternatives or ask rather than pick the most recently generated text.

5. Validation and acceptance

Use timelines containing a preference, an explicit reversal and a deletion followed by a delayed update. Check applicability, provenance and deletion of derived records. Compare task success with and without memory; more retrieved facts may hurt relevance.

6. Follow-ups and self-review

How would project-specific and global preferences interact? Reward scoped identity, evidence-preserving merges, conflict semantics and deletion propagation rather than an unbounded vector store.

Sources and related practice

W3C PROV defines provenance concepts useful for representing derivation; this memory policy is an original application design.

Read the primary technical reference

Reference retrieved October 3, 2026. Retrieval date is not an interview or source publication date. The reference supports the named concept; scenario, architecture, examples and rubric are original.

Continue with Design conversation history storage at scale; Design retrieval over rapidly changing documents.

Continue your preparation

Choose a connected learning path or browse more ML system design questions. Read our editorial method and attribution policy.