ESC

Type to search the knowledge base.

Whiteboarding UI Components

How to whiteboard frontend components — API design, state diagrams, layout boxes, and a11y — when code editors are limited.

intermediate3 min read
  • interview
  • whiteboarding-ui

Not every FE interview lets you type in a full IDE. Whiteboarding (or Excalidraw / Google Doc) tests API design, state thinking, and communication without hiding behind autocomplete.

What interviewers score

  1. Component API — props that age well
  2. State model — events and transitions
  3. Composition — slots vs prop explosion
  4. Edge cases — empty, overflow, async
  5. A11y & responsive called out explicitly

30-minute skeleton

Minutes Output on board
0–4 Requirements + MVP checklist
4–10 Component tree + prop sketches
10–16 State machine / data flow
16–24 Key interaction algorithms
24–28 A11y, layout, failure modes
28–30 Stretch & tradeoffs

Pair with Machine coding framework when you do get an editor.

Start with the public API

Write props before internals:

<DateRangePicker
  value={{ start, end }}        // controlled
  onChange(next)
  minDate?
  maxDate?
  isDateDisabled?(date)
  timeZone?
/>

Discuss controlled vs uncontrolled — Controlled vs uncontrolled.

Avoid boolean soup: size="sm" over isSmall.

Draw the tree

DateRangePicker
├── InputGroup (start / end fields)
├── Popover
│   └── Calendar
│       ├── MonthHeader
│       └── DayGrid
└── HelperText / Error

Composition patterns: Composition vs inheritance · Children patterns.

State diagram (high leverage)

closed --open--> open
open --select start--> selectingEnd
selectingEnd --select end--> closed (commit)
open --escape--> closed (cancel)

Async example (typeahead):

idle --type--> debounceWait --fetch--> loading
loading --200--> openResults
loading --err--> error

Algorithms to sketch (not perfect code)

Component Sketch
Autocomplete debounce → fetch → merge race (ignore stale)
Virtual list scrollTop → startIndex → slice window
Infinite scroll IntersectionObserver → page++
Drag reorder indices, placeholder, onDrop commit
Nested comments tree flatten / depth indent

Practice builds: Autocomplete · Infinite scroll · DnD list · Nested comments.

Layout boxes

Draw:

  • Flex toolbar vs Grid page
  • Overflow scroll region
  • Sticky header
  • Mobile stacked variant

CSS interviews: CSS interview questions.

Accessibility on a whiteboard

Always list:

  1. Roles (combobox/listbox/dialog)
  2. Keyboard map (Tab, Arrows, Enter, Esc)
  3. Focus move on open/close
  4. Labels / error association
  5. Reduced motion if animating

References: Accessible combobox · Accessible modal · Focus management.

Verbal patterns while drawing

  • “I’ll lock MVP: single month, no time zones.”
  • “Prop value is controlled so forms own state.”
  • “Race: sequence number drops stale responses.”
  • “Stretch: range presets, localization.”

Common whiteboard fails

Fail Fix
Jump into CSS details API + state first
No empty/error Add to checklist
God component Split list/item/chrome
Ignore keyboard Explicit key map
Perfect code handwriting Pseudocode OK

Example mini-walkthrough: tabs

  1. API: tabs[{id,label,panel}], value, onChange
  2. State: selectedId; optional controlled
  3. A11y: tablist/tab/tabpanel, arrows, aria-selected
  4. Lazy panels: mount on first activate
  5. Stretch: overflow scroll buttons

Learn: Accessible tabs.

Further reading

Whiteboard rounds are design conversations. Draw boxes, name states, and keep inviting the interviewer into choices.