tech-interview

Basics

What is Angular?

What are the key features of Angular?

Explain two-way data binding in Angular.

What is Angular CLI?

What is Angular Modules?

Component and Template

What is an Angular component?

How do you pass data from a parent component to a child component?

Explain Angular templates.

What is a structural directive in Angular?

What is event binding in Angular?

Services and Dependency Injection

What is a service in Angular?

Explain Dependency Injection in Angular.

How do you create a service in Angular?

What is the purpose of the @Injectable decorator in Angular?

How do you inject a service into a component?

Directives and Pipes

What are Angular directives?

Explain the *ngFor directive.

What are Angular pipes?

Name a few built-in Angular pipes and their uses.

How can you create a custom pipe in Angular?

Routing and Navigation

What is Angular Router?

How do you define routes in Angular?

How do you navigate to a different route programmatically?

Explain route guards in Angular.

What is lazy loading in Angular routing?

Forms and Validation

How do you create a template-driven form in Angular?

Explain reactive forms in Angular.

What is Angular validation and how is it implemented?

What is FormControl and FormGroup in Angular forms?

How do you handle form submission in Angular?

HTTP and Observables

How do you make HTTP requests in Angular?

What is an Observable in Angular?

Explain the difference between subscribe() and async pipe when working with Observables.

What is CORS, and how does it relate to Angular and HTTP requests?

How do you handle errors in HTTP requests in Angular?

State Management

What is state management in Angular, and why is it important?

Explain the role of NgRx in Angular state management.

What are the core principles of Redux?

How do you share data between components that are not directly related?

What are the key differences between local and global state in Angular?

Testing

What is unit testing in Angular?

What tools and libraries can you use for testing in Angular?

How do you create a unit test for an Angular component?

Explain the TestBed in Angular testing.

What is a mock in Angular testing, and why is it used?

Optimization and Performance

1. How can you improve the performance of an Angular application?

2. What is Ahead-of-Time (AOT) compilation in Angular?

3. Explain tree-shaking in the context of Angular.

4. What are Angular Interceptors, and how can they be used for performance optimization?

5. How do you minimize the number of change detection cycles in Angular?

Security

1. What are some common security vulnerabilities in web applications, and how can Angular help mitigate them?

2. How does Angular protect against XSS attacks?

3. Explain Content Security Policy (CSP) and its relationship with Angular.

4. What is Angular’s recommended approach for handling user authentication and authorization?

4. How can you secure your Angular application against CSRF attacks?

Deployment and Build Process

1. How do you deploy an Angular application to a production server?

2. Explain the difference between development and production builds in Angular.

3. What is the Angular CLI command to build a production-ready application?

4. What is the purpose of the angular.json configuration file?

5. How can you configure environment-specific settings in an Angular application?

Dependency Management

1. What is the purpose of the package.json file in an Angular project?

2. How can you add a third-party library to an Angular project?

3. What is the Angular Package Format (APF), and how does it relate to Angular libraries?

4. Explain the difference between rxjs and ng2-rxjs.

5. How do you update the dependencies in an Angular project?

Error Handling

1. What are some common Angular error messages, and how can you troubleshoot them?

2. How do you handle uncaught errors in an Angular application?

3. What is a NullInjectorError, and how can you resolve it?

4. How can you debug an Angular application?

5. What is the purpose of source maps in Angular development?

Best Practices

1. What are some best practices for organizing the structure of an Angular application?

2. How can you optimize the performance of an Angular application?

3. Explain the importance of code splitting in Angular.

4. What is Angular’s approach to internationalization and localization (i18n)?

5. What is the Angular Change Detection Strategy, and how does it work?

RxJS

1. What is RxJS, and how is it used in Angular?

2. Explain the concept of Observables in RxJS.

3. What is the difference between a Subject and an Observable in RxJS?

4. How do you unsubscribe from an Observable to prevent memory leaks?

5. What are some common operators in RxJS and their use cases?

Performance Optimization

1. What is the purpose of lazy loading in Angular?

2. Explain Angular Universal and its benefits.

3. How can you improve the initial loading time of an Angular application?

4. What is tree shaking, and how does it affect bundle size?

5. What is the purpose of service workers in Angular, and how do they improve performance?

Accessibility

Why is accessibility important in web development, and how does Angular support it?

What is ARIA, and how can it be used in Angular for accessibility?

How can you ensure keyboard navigation in Angular applications?

1. What is an Angular directive, and how is it different from a component?

Can you explain the Angular CLI and its key commands for managing an Angular project?

ng new <app-name>: Creates a new Angular application.
ng generate component <component-name>: Generates a new component.
ng build: Compiles the application.
ng serve: Starts a development server.
ng test and ng e2e: Run unit and end-to-end tests, respectively.

How does Angular support internationalization (i18n) and localization in applications?

What is the purpose of Angular’s HttpClient Interceptors, and how can they be used?

How do you handle authentication and authorization in an Angular application?

Explain the role of Angular’s NgZone and change detection in improving application performance.

What is the purpose of Angular’s ng-content directive, and how is it used for content projection?

How do you implement server-side rendering (SSR) in an Angular application, and what are its benefits?

What are Angular schematics, and how can they be used for code generation and project scaffolding?

Can you explain the Angular Zone and how it relates to change detection and performance optimization?