KatInterview

Screenshot-to-Component: Building a Token-Driven Card with Chips

System DesignModel answer
MediumModel answerSystem Designfrontendaccessibilitydesign-tokens

Last updated

Turn a static card-and-chip screenshot into a tokenized, accessible, responsive component and explain how you'd verify pixel fidelity.

You are given a single static screenshot of a card: rounded container, a heading, a short body line, and a row of small pill-shaped chips, one of which appears highlighted. Your job is not to trace the image — it is to reverse-engineer the design behind it and rebuild it as a real component.

Deliver a short working implementation (any mainstream framework or plain HTML/CSS/JS is fine) plus a verbal walkthrough covering:

  1. Token extraction — how you read spacing, radius, color, type scale, and shadow off the screenshot and turn them into named variables rather than magic numbers.
  2. Structure — semantic markup and a data-driven render for the chips (the chip set is a prop/array, not copy-pasted markup).
  3. Behavior and states — hover, focus-visible, active/selected, disabled; whether chips are static labels or interactive controls.
  4. Responsive and overflow rules — what happens at narrow widths, with long labels, and with many chips.
  5. Verification — how you convince yourself and a reviewer that the result matches the reference, and which edge cases you'd test.

Assume the screenshot is authoritative for appearance but silent about interaction. State your assumptions explicitly, and ask about anything that changes the implementation.

Hints

Hint 1

Start by measuring, not coding: overlay a grid on the screenshot and pull out the 4/8px spacing rhythm, the corner radius, and the font sizes before you write a single rule.

Hint 2

Decide early whether chips are presentational or actionable — that single answer flips your markup between a plain list and a group of toggle buttons or filter controls.

Hint 3

Fidelity is a test, not a vibe: pin the reference viewport and device pixel ratio, then diff screenshots in CI at a fixed tolerance.