Skip to solution
hardMachine Coding

Build a Variable-Size Virtualized Feed (Dynamic Heights)

313 views
01

Understand the problem

Extend virtualization to items with unknown/variable heights (e.g. social feed with images & text) — measure and cache heights.

ReactVirtualizationVariable SizeAutoSizer
02

Attempt it yourself

Sketch your approach before reading the solution — that's what interviews test.

Nudge consolestandby

Stuck? Beam a request up — the console returns a conceptual nudge that guides your logic without spoiling the implementation.

03

Study the solution

Requirements

  • Same 100k list but each row has variable height (text + optional image). Container height 600px.
  • Measure each rendered row with ResizeObserver and cache heights in Map<index, height>.
  • Estimate unmeasured rows (e.g. 80px avg) and correct scrollbar as measurements arrive.
  • Support `VariableSiz

Solution ready — 2 min read

Classified // press E to declassify

04

Join the discussion

Discussion (0)

Sign in to join the discussion.

No responses yet. Be the first to share what you think.

Transmission complete // awaiting log

KEEP THE
STREAK ALIVE.

Dossier 83 of 87 decoded in the Frontend Machine Coding track. One more won't hurt.

Back to track