← All topics

Angular Junior interview questions and answers

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

Take this quiz
  1. 1.What is Angular?
  2. 2.Which command creates a new Angular project?
  3. 3.What does the @Component decorator describe?
  4. 4.What does standalone mean for an Angular component?
  5. 5.How is a standalone Angular application started?
  6. 6.What does the default ViewEncapsulation.Emulated do with component styles?
  7. 7.What does :host mean in a component's styles?
  8. 8.Which language are Angular applications written in?
  9. 9.What does {{ user.name }} do in a template?
  10. 10.What is the difference between src="{{ url }}" and [src]="url"?
  11. 11.How do you handle a button click?
  12. 12.What does (keyup.enter)="submit()" do?
  13. 13.What is the "banana in a box" syntax [(ngModel)]="name"?
  14. 14.How do you toggle a CSS class depending on a condition?
  15. 15.What is a template reference variable #nameInput?
  16. 16.Why should template expressions be simple and free of side effects?
  17. 17.Which Angular feature makes {{ user?.address?.city }} safe when user is null?
  18. 18.How do you conditionally render a block in modern Angular templates?
  19. 19.What is required in an @for block?
  20. 20.What does the @empty block do?
  21. 21.Which block selects one of several templates by value?
  22. 22.What are pipes in Angular templates?
  23. 23.What does the async pipe do?
  24. 24.How do you create a custom pipe?
  25. 25.How does a child component receive data from its parent?
  26. 26.How does a child component notify its parent about an event?
  27. 27.Why can't a child change the value of a signal created by input()?
  28. 28.What is <ng-content /> used for?
  29. 29.What is a service in Angular?
  30. 30.How do you get a service instance inside a component?
  31. 31.Where can inject() be called?
  32. 32.What does providedIn: 'root' mean?
  33. 33.Why is dependency injection useful for testing?
  34. 34.What is ngOnInit typically used for?
  35. 35.When is ngOnDestroy called?
  36. 36.When does ngOnChanges run?
  37. 37.What is a signal in Angular?
  38. 38.What is computed() used for?
  39. 39.Why is it wrong to mutate an array inside a signal like this?
  40. 40.What does effect() do?
  41. 41.How are routes configured in an Angular app?
  42. 42.Where does the router render the matched component?
  43. 43.How do you create a navigation link without a full page reload?
  44. 44.How do you navigate from code, for example after saving a form?
  45. 45.What are the two classic approaches to forms in Angular?
  46. 46.How do you connect a reactive form to the template?
  47. 47.How do you show a validation error only after the user has touched the field?
  48. 48.How do you make an HTTP GET request in Angular?
  49. 49.What is an Observable (RxJS)?
  50. 50.What does pipe(map(...), filter(...)) do on an Observable?
  51. 51.Which command starts the local development server?
  52. 52.What does ng generate component user-card do?
  53. 53.How do you declare an input that the parent must always provide?
  54. 54.What does <ng-container> render in the DOM?
  55. 55.Which variables are available inside an @for block?
  56. 56.How do you set an inline style with a unit, e.g. width in pixels?
  57. 57.How do you highlight the menu link for the current route?
  58. 58.How do you show a "Page not found" component for unknown URLs?
  59. 59.How do you read the :id parameter of the current route in a component?
  60. 60.How do you set the browser tab title for a route?
  61. 61.Why doesn't this.http.get('/api/users') send any request?
  62. 62.What must be registered to inject HttpClient in a standalone app?
  63. 63.How do you format a date in a template?
  64. 64.What is @let used for in a template?
  65. 65.Where do you keep different API URLs for development and production builds?
  66. 66.How do you emit a value from a component declared with output()?
  67. 67.Why should a template call user() rather than user when user is a signal?
  68. 68.How do you update a signal based on its current value?
  69. 69.What does [disabled]="form.invalid" on a submit button do?
  70. 70.Which validators make a field mandatory and check an email format?
  71. 71.What does ng build produce by default in a new project?
  72. 72.Which file is the entry point that bootstraps a standalone Angular app?
  73. 73.What does RouterLink with an array do?
  74. 74.How do you show a button only to admins and a label to everyone else?
  75. 75.What is TypeScript strict mode in an Angular project useful for?