← All topics

Angular Senior interview questions and answers

75 questions for a Angular (Senior) interview - with correct answers, explanations and links to the docs.

Take this quiz
  1. 1.How does Zone.js let Angular know when to run change detection?
  2. 2.Why would you call NgZone.runOutsideAngular() in a zone-based app?
  3. 3.How do you enable zoneless change detection?
  4. 4.In a zoneless app, which of these does NOT schedule change detection?
  5. 5.Which component style is already compatible with zoneless change detection?
  6. 6.How does the default change detection traverse the component tree?
  7. 7.What does "glitch-free" mean for Angular signals?
  8. 8.What is wrong with this effect?
  9. 9.When would you pass a custom equal function to a signal?
  10. 10.What does httpResource (the resource API) provide?
  11. 11.How do you clean up inside an effect before it re-runs or is destroyed?
  12. 12.When is RxJS still a better fit than signals?
  13. 13.When might you use ChangeDetectorRef.detach()?
  14. 14.An OnPush parent has an OnPush child that reads a signal in its template. The signal changes. What is refreshed?
  15. 15.Why are getters or methods in templates a common performance problem?
  16. 16.In which order does Angular resolve inject(Token) in a component?
  17. 17.What is runInInjectionContext for?
  18. 18.A recursive tree node component needs its parent node. Which injection option fits?
  19. 19.How do you load configuration before the app renders?
  20. 20.What is the difference between providers and viewProviders in a component?
  21. 21.Why use an abstract class as a DI token?
  22. 22.What does hydration do in an Angular SSR app?
  23. 23.What commonly breaks hydration with a mismatch error?
  24. 24.What problem does withEventReplay() solve?
  25. 25.What does incremental hydration add?
  26. 26.Why doesn't the client repeat the API calls made during SSR?
  27. 27.How do you safely use browser-only APIs (window, localStorage) in an SSR app?
  28. 28.What does the priority attribute do with NgOptimizedImage?
  29. 29.How do you preload lazy routes after the initial page has loaded?
  30. 30.What are budgets in angular.json?
  31. 31.Why might a component inside @defer still end up in the main bundle?
  32. 32.Which tool shows which components are checked and how long change detection takes?
  33. 33.What does Angular do with a value bound to [innerHTML]?
  34. 34.When is DomSanitizer.bypassSecurityTrustHtml() dangerous?
  35. 35.How does HttpClient help protect against CSRF?
  36. 36.What is the data flow in NgRx Store?
  37. 37.Why are NgRx selectors created with createSelector memoized?
  38. 38.What is an NgRx effect?
  39. 39.What is NgRx SignalStore?
  40. 40.When is a plain service with signals enough instead of a state library?
  41. 41.How are micro-frontends commonly built with Angular?
  42. 42.What does ng update @angular/core @angular/cli do besides bumping versions?
  43. 43.How do you centrally report uncaught errors in an Angular app?
  44. 44.What are Angular Elements?
  45. 45.What is the main trade-off of Angular's built-in i18n (@angular/localize)?
  46. 46.What are component harnesses for?
  47. 47.Why doesn't this test replace the service used by the component?
  48. 48.How do you test guards and routed components together?
  49. 49.Why are nested subscribe calls considered an anti-pattern?
  50. 50.What is the difference between a cold and a hot Observable?
  51. 51.Why does takeUntilDestroyed() throw when called inside a click handler?
  52. 52.What is the risk of shareReplay(1) without refCount: true on a long-lived source?
  53. 53.In what order do functional interceptors process a request and its response?
  54. 54.How do you configure per-route rendering (SSR, prerender, client-only) in Angular SSR?
  55. 55.How can SSR code read the incoming HTTP request (e.g. a cookie)?
  56. 56.How do you make SSR wait for async work that isn't an HTTP request (e.g. a timer-based init)?
  57. 57.When is ngSkipHydration on a component a reasonable workaround?
  58. 58.How do you use a CSP nonce with Angular's inline styles?
  59. 59.What does Angular's Trusted Types support help with?
  60. 60.What does createEntityAdapter from @ngrx/entity give you?
  61. 61.What does createFeature add in NgRx?
  62. 62.What are Signal Forms in recent Angular versions?
  63. 63.Why might RouteReuseStrategy be customized?
  64. 64.How do you show a global progress bar while a lazy route is loading?
  65. 65.What is the main benefit of using inject() over constructor parameters in base classes?
  66. 66.What does providedIn: 'platform' mean?
  67. 67.In Angular SSR, where does user data typically leak between requests?
  68. 68.When does effect beat computed, and when is it a smell?
  69. 69.Why does changing an object's property inside a signal not update the view?
  70. 70.How do you analyse which dependencies make the main bundle large?
  71. 71.How do you keep a large Angular codebase from creating circular or wrong-direction imports between features?
  72. 72.Why are template-driven forms harder to scale than reactive forms in complex screens?
  73. 73.What does @defer (hydrate on interaction) do with incremental hydration?
  74. 74.Why can a frequent mousemove listener hurt a zone-based app but less so a zoneless one?
  75. 75.What is the typical architecture for NgRx effects that handle many concurrent requests to the same endpoint?