Design a Prompt Playground: Saved Prompts, Two-Tab Save Conflicts, Revocable Share Links
Company: Anthropic
Role: Software Engineer
Category: System Design
Difficulty: hard
Interview Round: Onsite
Design a Playground in which users write prompts, run them against a language model, and save them to come back to later. The interviewer's follow-ups were specific. If the same saved prompt is open in two browser tabs and one tab saves first, what happens when the other tab then clicks save? And after a share link is revoked, can other people still see the prompt's content from a cache?
The reported prompt gives no scale, sharing rules or versioning requirements; settle them with the interviewer before designing.
### Clarifying Questions
- What does a saved prompt contain: a system prompt, messages, variables, the model and parameters such as temperature, and the outputs of runs? Is version history required?
- Is a prompt owned by one user, or by a team workspace where several people can edit it?
- What does a share link grant: a read-only view, the ability to copy the prompt into one's own workspace, or the ability to run it? Can links expire?
- How many users, saves and runs are expected, and how large can a prompt be?
- Is real-time collaborative editing, like a shared document, in scope, or only save-based editing?
### Part 1: Core design (write, run, save and share prompts)
Design the system: the data model, the APIs, how runs reach the model and stream back, how saving works, and how share links are created.
```hint Separate what changes at different speeds
Think about what changes on every keystroke, what changes on a save, and what a run produces, and whether they belong in the same place.
```
#### What This Part Should Cover
- Requirements and rough scale agreed first
- A data model for prompts, versions, runs and share links
- APIs, the run path with streaming output, and storage choices
- How saving and sharing fit the model
### Part 2: Two tabs save the same prompt
The same prompt is open in two tabs. Tab A saves first. Then tab B, which was loaded before A's save, clicks save. What should happen, and how does the system implement it?
```hint What was B looking at?
The server cannot tell a stale save from a fresh one unless the request says something about the version it was based on.
```
#### What This Part Should Cover
- The candidate behaviors and their consequences for the user's work
- The server-side mechanism that detects a stale save atomically
- What tab B's user sees and can do next
- Same-browser and cross-device cases, retries and unsaved local edits
### Part 3: Revoking a share link
A user revokes a share link. Can someone who had the link still see the content from a cache? Design the system so revocation takes effect.
```hint List every copy
Write down every place the shared content could be stored between your database and the viewer's screen, and who controls each one.
```
#### What This Part Should Cover
- Every cache layer on the path: server, CDN, browser, open pages, link previews
- Where authorization is checked, and caching rules that keep revoked content from being served
- How quickly revocation takes effect, and what cannot be taken back
### What a Strong Answer Covers
- A clear data model with immutable versions and separate share records
- Optimistic concurrency with a user-facing conflict flow that never silently loses work
- A share-link design where revocation is enforced on every request, with caching to match
- Honest limits: content already delivered or copied cannot be recalled
- Scaling, failure handling and monitoring, including model capacity for runs
### Follow-up Questions
- Users want to see and restore earlier versions of a prompt. How does your data model support it?
- A shared prompt contains an API key pasted by mistake. Beyond revoking the link, what can the system do?
- Two teammates edit the same prompt all day. When would you move from optimistic saves to real-time collaborative editing, and what would it cost?
- How do you stop one user's runs from exhausting model capacity for everyone else?
Overview: A system design question for a prompt playground where users write, run, save and share prompts. It probes what happens when two browser tabs save the same prompt and whether a revoked share link can still be read from CDN, server or browser caches.
Read the full Anthropic Software Engineer interview experience this question came from