Skip to content

FlashcardNot attempted

Follow-ups interviewers ask after you build it

Recall it before you reveal

You finished the widget. What follow-ups should you be ready for on: a progress bar, overlapping circles, an OTP input, a reducer todo, a word-frequency counter, a carousel and a mention box?

Space to reveal
Show answer & explanation
  • Progress bar: a circular version: SVG circle with stroke-dasharray = circumference and stroke-dashoffset = circumference × (1 − progress).
  • Overlapping circles: thousands of circles make pairwise checks O(n²); use spatial partitioning (a grid or a quadtree) to compare only nearby circles.
  • OTP input: autoComplete="one-time-code", numeric input mode, paste support, rate limiting, and masking on shared screens.
  • Reducer todo: Context + useReducer is a lightweight Redux; use a store with selectors once re-renders hurt.
  • Word frequency: count in a Map (or Object.create(null)), not {}, so words like "constructor" don't collide with prototype keys.
  • Carousel: preload the next slide, support swipe with pointer events, and pause autoplay on hover and focus.
  • Mention box: position the list with a floating-UI library, and use the combobox pattern (role="listbox", aria-activedescendant) for keyboard users.