Angular Architecture
Smart vs presentational components, feature modules, core modules, shared modules, monorepo with Nx, folder structure
1What is the main difference between a smart component and a presentational component?
What is the main difference between a smart component and a presentational component?
Answer
Smart components (or container components) manage business logic, API calls and application state through services or state management. Presentational components focus solely on display and receive their data via @Input, emitting events via @Output. This separation improves testability and reusability of components.
2What is the main advantage of using presentational components?
What is the main advantage of using presentational components?
Answer
Presentational components are highly reusable because they don't depend on services or specific business logic. They receive all their data via @Input and communicate via @Output, making them easily testable with mocked data and reusable in different contexts. This approach also encourages using the OnPush strategy for performance optimization.
3What is a feature module in Angular?
What is a feature module in Angular?
Answer
A feature module is an Angular module that encapsulates a specific business feature of the application (example: user management, shopping cart). It contains all components, services, directives and pipes needed for that feature. Feature modules can be lazy loaded to improve performance and promote a scalable modular architecture.
What is the role of a Core Module in Angular architecture?
Why import the Core Module only once in AppModule?
+19 interview questions
Other Angular interview topics
TypeScript Basics
TypeScript Advanced
Angular Fundamentals
Components & Lifecycle
Services & Dependency Injection
Angular Modules Organization
Angular CLI
Directives & Pipes
Routing & Navigation
Reactive Forms
Template-driven Forms
RxJS Fundamentals
RxJS Operators
HttpClient & API Calls
Basic State Management
Change Detection
Angular Signals
Standalone Components
Angular Unit Testing
End-to-End Testing
Build & Optimization
NgRx Fundamentals
NgRx Advanced
Performance Optimization
Security & Best Practices
Advanced RxJS Patterns
Angular Universal & SSR
Angular Micro-frontends
Master Angular for your next interview
Access all questions, flashcards, technical tests, code review exercises and interview simulators.
Start for free