Angular Flashcards

(24 cards)

1
Q

What is Angular?

A

A TypeScript-based front-end framework by Google for building scalable single-page applications (SPAs).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are Angular Components?

A

Basic building blocks of Angular applications, containing a template (HTML), class (logic), and metadata (@Component).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is Data Binding in Angular?

A

Synchronization between component and template: Interpolation {{ }}, Property binding [ ], Event binding ( ), Two-way binding [(ngModel)].

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are Directives?

A

Special markers in the DOM: Structural (*ngIf, *ngFor), Attribute (ngClass, ngStyle), Custom directives.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is Dependency Injection?

A

Angular injects services into components instead of creating them manually, promoting modularity.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What are Services in Angular?

A

Classes for reusable business logic and data handling. Injected into components.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Difference between Template-driven and Reactive Forms?

A

Template-driven: Simple, uses [(ngModel)]. Reactive: More control, uses FormGroup, FormControl, better for large apps.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is Angular Routing?

A

Handles navigation in SPAs. Supports lazy loading, guards, and parameterized routes.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What are Lifecycle Hooks?

A

Methods that run during component lifecycle: ngOnInit, ngOnChanges, ngOnDestroy.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is Change Detection?

A

Mechanism to update DOM when model data changes. Strategies: Default and OnPush.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What are Angular Guards?

A

Functions that control route access (CanActivate, CanDeactivate, CanLoad).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What are Angular Interceptors?

A

Middleware for HTTP requests/responses (e.g., adding auth tokens, logging, error handling).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is React?

A

A JavaScript library by Meta for building component-based UIs.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What are React Components?

A

Building blocks of React apps: Functional (hooks) or Class-based (state, lifecycle methods).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is JSX?

A

JavaScript XML – syntax extension that lets you write HTML-like code inside JavaScript.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is State in React?

A

Built-in object storing dynamic data. Updated using setState (class) or useState (hooks).

17
Q

What are Props in React?

A

Inputs to a component, passed down from parent to child, read-only.

18
Q

Difference between State and Props?

A

State: Managed within the component, can change. Props: Passed from parent, immutable.

19
Q

What are React Hooks?

A

Functions that let you use state and lifecycle features in functional components. Examples: useState, useEffect, useContext.

20
Q

What is useEffect?

A

A hook for side effects (e.g., data fetching, subscriptions, DOM updates). Runs after render.

21
Q

What is Virtual DOM?

A

A lightweight copy of the real DOM. React updates it first, then efficiently updates only changed parts in the real DOM.

22
Q

What is React Router?

A

A library for routing in React apps. Allows navigation without reloading the page.

23
Q

What is Redux?

A

A state management library for predictable state handling. Uses actions, reducers, and a central store.

24
Q

How do you optimize performance in React?

A

Use React.memo, lazy loading (React.lazy), avoid unnecessary re-renders, useCallback, and useMemo.