70 curated SQL interview questions spanning aggregations, self-joins, recursive CTEs, ranking window functions, partitioning, and complex analytical queries.
Preview Mode Active · 5 Free Sample Questions
Review verified answers and code patterns below. The remaining 60 questions in this codex are unlocked with the Interview Pass or Full Access.
useRef creates a mutable object ({ current: ... }) that persists across renders without causing a re-render when it changes - the opposite of useState, which always triggers a re-render on update. Use useRef when you need to: (1) hold a reference to a DOM node to imperatively read/manipulate it (focus an input, measure size, scroll into view); (2) store a mutable value that shouldn't trigger re-renders, like a timer/interval ID, a previous value for comparison, or a flag tracking whether a component is still mounted; or (3) keep a value alive across renders that the render output itself doesn't depend on. If a value's change should be reflected in what's rendered, use state, not a ref - mutating ref.current won't update the screen.
You have reached the end of the 5 free preview questions. Get unrestricted lifetime access to all 65 questions, model solutions, architectural blueprints, and complete DSA codex.
One-time settlement · Lifetime access · Zero recurring bills