Preparing your design workspace

Loading the problem and your latest saved attempt…

Design an AI Model Playground with Shareable Sessions

Practice designing a web playground where developers run prompts against AI models, watch replies stream in, have every session saved automatically, and share a frozen copy of a session through a link.

Problem statement

Design a playground where developers try AI models, keep their work and share it with others.

For this exercise, assume a web app where a signed-in user opens a session, picks a model, writes an optional system message and a user message, sets a few settings (temperature and a maximum reply length), and presses Run. The reply streams onto the screen token by token, and the user can press Stop at any time.

The user can then add another message and run again, so a session holds a conversation. The model is an existing service: given the messages and settings, it streams back tokens, and it may fail partway through a reply.

Also assume everything in a session saves automatically: the settings, the messages, the replies and the message the user is still typing. Reopening a session later, on any device, shows the latest saved state, including a reply that kept streaming and finished after the tab was closed.

Reloading the page while a reply is streaming shows the reply so far and keeps streaming the rest. Only the owner edits a session, but the owner may have it open in two tabs or on two devices.

Also assume the owner can share a session by creating a link. Anyone with the link can view a read-only copy of the session as it was when the link was made, without signing in, and a signed-in viewer can copy it into their own playground and continue from there.

Later edits by the owner do not change what the link shows, and the owner can revoke the link.

For this exercise, these are out of scope: how the model produces tokens, billing and usage limits, teams and shared editing, prompt version history and batch testing, and running in more than one region.

What to build

  1. A signed-in user picks a model and settings, writes messages and runs them; the reply streams onto the screen as it is produced, and the user can stop it.
  2. Everything in a session saves automatically; reopening or reloading it on any device shows the latest saved state, including a reply that is still streaming or that finished after the tab was closed.
  3. The owner can create a link that shows a read-only copy of the session as it was when shared; signed-in viewers can copy it into their own playground, and the owner can revoke the link.

At scale

  • For this exercise, assume about 1,000 runs start each second at peak. A typical reply is about 500 tokens and the longest is 4,000, and the model produces about 50 tokens a second, so a typical reply streams for about 10 seconds and the longest for about 80.
  • For this exercise, assume each token should appear on screen within half a second of the model producing it, and an edit should be saved within 2 seconds after the user stops typing. A session holds at most 100 messages and 200 KB of text.
  • For this exercise, assume one popular shared link may get 5,000 views a second, and a revoked link must stop working within 60 seconds.
  • For this exercise, assume nothing the app has shown as saved may be lost, an edit from an out-of-date tab must never silently overwrite a newer one, and pressing Run again after a network timeout must not start a second reply.