Code RoomInfinite scroll on slow networks
MediumPrep Room Coding #4694

Infinite scroll on slow networks

Vibe & agenticNetworking & APIsMid–Senior~18 min

You prompted an AI agent to 'build an infinite-scroll image gallery in React,' and it shipped a clean, working component that loads beautifully on your office laptop and fiber connection. Before this ships to a global consumer app, what did the happy-path build almost certainly skip, and how would you direct the agent to fix it?

Implement
mounted_row_indices(total_items: int, item_height: int, viewport_height: int, scroll_top: int, overscan: int) → list[int]
Examples
in[100,200,800,0,1]out[0,1,2,3,4]
in[100,200,800,450,0]out[2,3,4,5,6]
in[0,200,800,0,2]out[]
What a strong answer looks like

Treat the AI’s output as a draft to verify, not an answer to trust. Name the specific flaw and the input that triggers it, say how you’d catch it (tests, edge cases, reading critically), and how you’d re-prompt or decompose to get it right.

0:00 of about 18 min

Vibe & agentic: describe the solution in plain language (or narrate it) and the coach grades your approach.

Which questions mattered is sealed until you submit. Telling you now would just be handing over the edge cases.