Skip to the page

Angular in production · Scenario

Angular: a 5,000-row table freezes the page

The interviewer asks

The transactions page shows up to 5,000 rows. Scrolling stutters, and typing in the filter freezes the page for two seconds. How do you approach it?

Then

Follow-ups the interviewer asks next

  1. What do you measure first?
  2. What's the cheapest change that helps right away?
  3. After adding virtual scrolling, the sticky header and uneven row heights break. What now?
  4. The business wants all 5,000 rows searchable with Ctrl+F. How does that change things?
  5. Should filtering happen on the server? When?
  6. How do you prevent this on the next big table?

The answer

What a strong answer covers

  • Measure: the Angular DevTools profiler, the Performance panel (long tasks, layout time), the number of DOM nodes.
  • Causes: every row rendered at once; track by object while the list is re-fetched, so every row is destroyed and rebuilt; method calls in each row's template; filtering on every keystroke without debounce.
  • Fixes: track t.id; values computed once (a computed list, pure pipes); debounce the filter; OnPush and signals; then paging or CDK virtual scrolling (cdk-virtual-scroll-viewport with itemSize, *cdkVirtualFor); server-side filtering and paging for big data.
  • Virtual scrolling needs fixed row heights (variable heights need extra work), and sticky headers sit outside the viewport.
  • Ctrl+F only finds rendered rows; give an in-app search instead.
  • Prevent: a performance test with 5,000 rows; design guidance for big tables.

The red pen

Common traps

Avoid:"use OnPush" as the only answer; chunked rendering with setTimeout without measuring; "the backend should send fewer rows" without thinking about the user.

Practise this out loud

Say your answer out loud to an AI interviewer that follows up, and get a score for it.

Practise by voice

Practise questions like this out loud

Sign up and start with a 15-minute interview with the full report, and an English conversation. No card needed.

Start your free interview