20 questions for Angular developer (junior)

1. What is Angular?

-Angular is a platform and framework for building single-page client applications using HTML, CSS, and TypeScript.

2. What is the main language used in Angular?

-TypeScript.

3. What is two-way data binding?

-Two-way data binding automatically synchronizes data between the model and the view.

4. What is an Angular component?

-An Angular component is a basic building block of the UI, consisting of an HTML template, a CSS stylesheet, and a TypeScript class.

5. What is the purpose of the Angular CLI?

-The Angular CLI is a command-line interface tool that helps in creating, developing, and maintaining Angular applications.

6. What is dependency injection in Angular?

-Dependency injection is a design pattern used to implement IoC (Inversion of Control) to allow a class to request dependencies from external sources rather than creating them itself.

7. What is a module in Angular?

-An Angular module is a container for a group of related components, services, directives, and pipes.

8. How do you create a new Angular project?

-By using the command `ng new project-name`.

9. What is a service in Angular?

-A service is a class that provides reusable functionality and can be injected into components or other services.

10. How do you define a route in Angular?

-By configuring the `RouterModule` with an array of routes in the app's module file.

11. What is an Angular directive?

-An Angular directive is a class that adds behavior to elements in your Angular applications.

12. What is the difference between `@Component` and `@Directive` in Angular?

-`@Component` is used to create a component with a template and styles, while `@Directive` is used to create a directive that manipulates the DOM.

13. What are Angular pipes?

-Angular pipes are used to transform data in templates. They can be built-in or custom.

14. How do you handle forms in Angular?

-Angular provides `ReactiveFormsModule` and `FormsModule` to handle forms.

15. What is `ngOnInit`?

-`ngOnInit` is a lifecycle hook that is called after Angular has initialized all data-bound properties of a component.

16. How do you make HTTP requests in Angular?

-By using the `HttpClient` service from the `@angular/common/http` module.

17. What is lazy loading in Angular?

-Lazy loading is a technique that delays loading of modules until they are needed to improve the application's load time.

18. How do you bind a property in Angular?

-By using property binding syntax: `[property]="value"`.

19. What is the purpose of `NgModule`?

-`NgModule` is used to define an Angular module and declare components, directives, and pipes, and to import other modules.

20. How do you handle events in Angular?

-By using event binding syntax: `(event)="handler($event)"`.