What is Angular?
A TypeScript-based front-end framework by Google for building scalable single-page applications (SPAs).
What are Angular Components?
Basic building blocks of Angular applications, containing a template (HTML), class (logic), and metadata (@Component).
What is Data Binding in Angular?
Synchronization between component and template: Interpolation {{ }}, Property binding [ ], Event binding ( ), Two-way binding [(ngModel)].
What are Directives?
Special markers in the DOM: Structural (*ngIf, *ngFor), Attribute (ngClass, ngStyle), Custom directives.
What is Dependency Injection?
Angular injects services into components instead of creating them manually, promoting modularity.
What are Services in Angular?
Classes for reusable business logic and data handling. Injected into components.
Difference between Template-driven and Reactive Forms?
Template-driven: Simple, uses [(ngModel)]. Reactive: More control, uses FormGroup, FormControl, better for large apps.
What is Angular Routing?
Handles navigation in SPAs. Supports lazy loading, guards, and parameterized routes.
What are Lifecycle Hooks?
Methods that run during component lifecycle: ngOnInit, ngOnChanges, ngOnDestroy.
What is Change Detection?
Mechanism to update DOM when model data changes. Strategies: Default and OnPush.
What are Angular Guards?
Functions that control route access (CanActivate, CanDeactivate, CanLoad).
What are Angular Interceptors?
Middleware for HTTP requests/responses (e.g., adding auth tokens, logging, error handling).
What is React?
A JavaScript library by Meta for building component-based UIs.
What are React Components?
Building blocks of React apps: Functional (hooks) or Class-based (state, lifecycle methods).
What is JSX?
JavaScript XML – syntax extension that lets you write HTML-like code inside JavaScript.
What is State in React?
Built-in object storing dynamic data. Updated using setState (class) or useState (hooks).
What are Props in React?
Inputs to a component, passed down from parent to child, read-only.
Difference between State and Props?
State: Managed within the component, can change. Props: Passed from parent, immutable.
What are React Hooks?
Functions that let you use state and lifecycle features in functional components. Examples: useState, useEffect, useContext.
What is useEffect?
A hook for side effects (e.g., data fetching, subscriptions, DOM updates). Runs after render.
What is Virtual DOM?
A lightweight copy of the real DOM. React updates it first, then efficiently updates only changed parts in the real DOM.
What is React Router?
A library for routing in React apps. Allows navigation without reloading the page.
What is Redux?
A state management library for predictable state handling. Uses actions, reducers, and a central store.
How do you optimize performance in React?
Use React.memo, lazy loading (React.lazy), avoid unnecessary re-renders, useCallback, and useMemo.