Prompt 1
Build a table of real-time data that sorts by any column
Practice version modelled on a reported round: Public report: Datadog senior frontend developer loop, October 2024 (Taro, approximate date)
What this measures
Clarify first
Confirm the update rate and whether updates replace rows, append rows or both. Confirm whether sorting must be stable across equal values and whether a sort should pause when the user is interacting.
Strong answer should cover
Keep raw rows in one store and derive the sorted view with a memoised comparator per column instead of sorting in place. Give every row a stable identity so updates replace a row without resetting selection or focus. Batch incoming updates per animation frame and avoid re-rendering rows that did not change. Expose sort controls as buttons with the current direction announced, and keep keyboard access to every column.
Common miss: