Angular in production · Scenario
Angular: a 5,000-row table freezes the page
Practise this out loud
Say your answer out loud to an AI interviewer that follows up, and get a score for it.
Practise by voiceThe 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
- What do you measure first?
- What's the cheapest change that helps right away?
- After adding virtual scrolling, the sticky header and uneven row heights break. What now?
- The business wants all 5,000 rows searchable with Ctrl+F. How does that change things?
- Should filtering happen on the server? When?
- 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;
trackby 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 (acomputedlist, pure pipes); debounce the filter; OnPush and signals; then paging or CDK virtual scrolling (cdk-virtual-scroll-viewportwithitemSize,*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 voicePractise 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.