Skip to main content
React Interview Questions Concept Queue P1 Medium

A saved selection points to an outdated object

A table stores selectedRow as an object in state. The data refreshes and the same row ID still exists, but its name changed. The detail pane shows the old name. What would you store instead, and what should happen if the row disappears entirely?

Official Reference

Model Answer & Explanation

Store selectedId and look up the selected row in the current rows during render. That keeps the identity while displaying the latest data. Choose an explicit missing-row behavior, such as no detail pane or an unavailable message. If product wants permanent deselection when a row disappears, clear the ID with that data transition rather than silently resurrecting it later.

What a Strong Answer Covers

  • Avoid duplicating a mutable snapshot of the current data.
  • Make the missing-row behavior intentional.
Follow-up Interview Question · When would keeping the old snapshot be a legitimate product requirement?

Module Context & References

React · Applied concepts Explain the state, identity and effect bugs behind real UI behavior.
Personal Notes · Markdown

Technologies & Interview Topics Covered

Switch between short-term interview tracks and long-term 80/20 engineering depth to practice JavaScript internals, React rendering and hooks, timed frontend machine coding UI challenges, MeetaPro FG300, Blind 75 & NeetCode 150 DSA patterns, Python & FastAPI APIs, PostgreSQL query optimization & MVCC, Redis caching, Applied AI RAG pipelines & evaluations, and distributed system design.