If you’re preparing for an Angular 20 interview in 2025, you need to know both TypeScript fundamentals and Angular core concepts.
This guide (Part 1 of the Angular 20 Interview Series) covers the first 50 questions and answers — starting from TypeScript basics to Angular modules, components, services, directives, lifecycle hooks, change detection, and dependency injection.
TypeScript Basics (Q1–Q10)
Q1. What is TypeScript, and why is it preferred in Angular?
TypeScript is a statically typed superset of JavaScript. It offers type checking, decorators, and modern ESNext features. Angular uses it for:
- Strong typing for fewer runtime errors
- Better tooling (IntelliSense, autocompletion)
- Decorators for metadata (e.g.,
@Component
,@Injectable
)
Q2. What are the key features of TypeScript used in Angular?
- Interfaces and classes
- Generics
- Enums
- Modules and namespaces
- Decorators
- Type inference
Q3. Difference between any
, unknown
, and never
in TypeScript?
-
any
: disables type checking -
unknown
: saferany
, must be narrowed before use -
never
: for functions that never return (e.g., errors, infinite loops)
Q4. Explain TypeScript decorators in Angular.
Decorators are functions that attach metadata. Examples:
-
@Component()
→ defines Angular component -
@Injectable()
→ marks a class as injectable -
@Directive()
→ creates a directive -
@NgModule()
→ defines Angular module
Q5. Difference between interface
and type
in TypeScript?
-
interface
→ extendable, recommended for Angular models -
type
→ can represent primitives, unions, intersections
Q6. How does TypeScript support Angular dependency injection?
TypeScript uses metadata reflection (with emitDecoratorMetadata
) to allow Angular’s DI system to resolve types at runtime.
Q7. What are access modifiers in TypeScript?
-
public
→ default, accessible everywhere -
private
→ only inside class -
protected
→ inside class + subclasses -
readonly
→ cannot be reassigned after initialization
Q8. How do TypeScript Generics help in Angular?
Generics provide reusable components/services. Example:
function identity<T>(arg: T): T { return arg; }
In Angular:
getData<T>(url: string): Observable<T>
Q9. Explain strict
mode in TypeScript.
Strict mode ensures stricter type checking (strictNullChecks
, noImplicitAny
, etc.), preventing runtime bugs.
Q10. What is the difference between Promise
and Observable
in Angular/TypeScript?
- Promise → resolves once, not cancellable
- Observable → multiple values over time, cancellable, supports RxJS operators
Angular Core Concepts (Q11–Q50)
Q11. What is Angular?
Angular is a TypeScript-based framework for building single-page web applications with components, dependency injection, RxJS, and powerful tooling (CLI).
Q12. What are the building blocks of Angular?
- Components
- Modules
- Templates
- Directives
- Services
- Dependency Injection
- RxJS
Q13. Explain Angular Components.
- UI building blocks
- Defined with
@Component()
decorator - Includes selector, template, styles, lifecycle hooks
Q14. What is an Angular Module (NgModule
)?
- Container for components, directives, pipes, and services
- Root module:
AppModule
- Supports lazy loading
Q15. Difference between BrowserModule and CommonModule?
-
BrowserModule
: used in root module, includes DOM services -
CommonModule
: used in feature modules, includes directives likengIf
,ngFor
Q16. Explain Angular Directives.
-
Structural Directives: change DOM layout (
*ngIf
,*ngFor
) -
Attribute Directives: change element appearance/behavior (
ngClass
,ngStyle
)
Q17. What is Angular Service?
- Reusable business logic provider
- Decorated with
@Injectable()
- Provided via DI system
Q18. Explain Angular Dependency Injection (DI).
- Design pattern for injecting dependencies instead of hardcoding
- Angular DI system resolves services and injects them into components
Q19. What are Angular Lifecycle Hooks?
-
ngOnInit()
– initialization -
ngOnChanges()
– input property changes -
ngDoCheck()
– custom change detection -
ngOnDestroy()
– cleanup
Q20. Difference between Template-driven and Reactive Forms?
- Template-driven → simple, uses directives (
ngModel
) - Reactive → scalable, programmatic form control (
FormControl
,FormGroup
)
Q21. What is Change Detection in Angular?
Process of synchronizing model and view. Two strategies:
- Default → checks all components
- OnPush → checks only when input changes
Q22. What is Angular Pipe?
- A function that transforms data in templates (
| date
,| currency
) - Custom pipes:
@Pipe({ name: '...' })
Q23. Difference between Pure and Impure Pipes?
- Pure → executes when input changes
- Impure → executes on every change detection cycle
Q24. What are Angular Standalone Components?
- Components without
NgModule
- Declared with
standalone: true
- Improve modularity and reduce boilerplate
Q25. What is Angular Zone.js?
- Library that patches async APIs
- Tracks async tasks and triggers change detection
Q26. Explain Angular Micro Frontend (MFE).
- Splitting app into multiple independent Angular apps
- Uses Module Federation (Webpack 5)
- Enables parallel development and independent deployments
Q27. What is an Angular PWA (Progressive Web App)?
- Web app with offline support, caching, push notifications
- Angular uses
@angular/pwa
Q28. What is the Angular HttpClient Module?
- Provides HTTP communication
- Built on RxJS Observables
- Supports interceptors, error handling, typed responses
Q29. What are Angular Guards?
- Route protection mechanisms
-
CanActivate
,CanDeactivate
,Resolve
,CanLoad
Q30. Difference between AOT and JIT compilation?
- AOT → compiles during build time, faster startup
- JIT → compiles in browser, slower but useful in dev
Q31. What is Lazy Loading in Angular?
- Loads feature modules only when needed
- Improves performance and initial load time
Q32. Difference between Subject and BehaviorSubject?
-
Subject
: no initial value, multicasts -
BehaviorSubject
: requires initial value, stores last emitted value
Q33. What is Angular RouterModule?
- Defines navigation rules
- Supports lazy loading, guards, resolvers
Q34. What is Angular Ivy?
- Angular’s rendering engine
- Faster compilation, smaller bundles, better debugging
Q35. Explain Angular Interceptors.
- Middleware for HTTP requests/responses
- Useful for auth tokens, logging, error handling
Q36. What is Angular Universal?
- Server-side rendering (SSR) for Angular
- Improves SEO and performance
Q37. What is Angular’s ng-content?
- Enables content projection in components
- Similar to React’s
children
Q38. Explain Angular ViewEncapsulation.
- Emulated → default, scoped CSS with attributes
- ShadowDom → uses browser’s shadow DOM
- None → no encapsulation, global CSS
Q39. What are Angular Animations?
- Uses
@angular/animations
- Based on Web Animations API
- Defined with
trigger()
,state()
,transition()
Q40. What is Angular Testing Library (Jasmine/Karma)?
- Unit testing with Jasmine
- Test runner: Karma
- E2E testing with Protractor or Cypress
Q41. Difference between ViewChild and ContentChild?
-
@ViewChild()
→ queries from template DOM -
@ContentChild()
→ queries projected content
Q42. Explain ngZone in Angular.
- Runs change detection after async tasks
-
zone.runOutsideAngular()
improves performance
Q43. What is trackBy in Angular?
- Optimization for
*ngFor
- Prevents DOM re-render by tracking items with unique keys
Q44. What are Angular Schematics?
- Code generation templates for CLI
- Example:
ng generate component
,ng generate service
Q45. What is Angular ESLint?
- Linter for Angular projects
- Ensures code quality and best practices
Q46. Explain ngOptimizedImage in Angular 20.
- New directive for automatic image optimization
- Lazy loads images, generates
srcset
, improves Core Web Vitals
Q47. What are Angular Signals (future feature)?
- Reactive primitives for state management
- Provide fine-grained reactivity (like Solid.js)
Q48. Explain Angular’s platform-browser module.
- Contains DOM-related services
- Required for running Angular apps in browsers
Q49. What is Angular Compiler (NGC)?
- Ahead-of-Time compiler
- Converts Angular templates into optimized JavaScript
Q50. Explain Angular’s Renderer2.
- Service for manipulating DOM safely
- Provides abstraction for SSR and Web Workers
Conclusion
This was Part 1 of Angular 20 Interview Questions and Answers (2025 Edition).
We covered TypeScript basics and Angular core concepts (Q1–Q50).
Top comments (0)