Loading…
Loading…
Frontend · Senior full stack preparation
Explain Angular templates, directives, pipes and component lifecycle decisions. Read practical answers and use the examples to explain your reasoning.
21 of 21 questions
The async pipe subscribes to an Observable or Promise, renders its latest emitted/resolved value, marks the component for checking when a new value arrives, and automatically unsubscribes when destroyed or when its expression reference changes. It reduces manual subscription cleanup.
Link to question 6A custom pipe transforms values for display; a custom directive adds behavior or modifies an element. Pipes should normally be pure; directives are appropriate for reusable DOM interactions, validation or input constraints. Explain a real example you built, if any.
Link to question 11Interpret restrict as blocking these characters. Use an attribute directive listening to input, remove disallowed characters, update the native input, and dispatch a new input event so Angular forms can observe the sanitized value. In production also consider cursor position, composition events and validation.
Link to question 12Name the actual version used on your current project, the version you have evaluated, and key features you have shipped. Do not equate familiarity with production adoption.
Link to question 17Upgrade incrementally through supported major versions using ng update, matching Node/TypeScript/RxJS and Angular Material compatibility for each hop. Commit and run tests at every step; resolve deprecated APIs, third-party package constraints, builder changes and styling regressions. Standalone conversion and signals are optional refactors, not prerequisites.
Link to question 18Angular synchronizes the template with application state. Default change detection checks broadly; OnPush limits checks based on input changes, template events, signal updates and explicit marks. Signals track template dependencies. Avoid mutating object inputs in place under OnPush.
Link to question 21Measure first using browser profiling and Angular DevTools. Lazy-load routes, use @defer for noncritical content, track stable IDs in @for, apply OnPush and signals where useful, avoid expensive template expressions, virtualize large lists, cache appropriate API requests and reduce bundle size.
Link to question 22Use a backend identity provider/session endpoint; validate credentials server-side. Prefer secure HttpOnly, Secure, SameSite cookies when appropriate; implement CSRF defenses for cookie-based auth. Guards improve UX but backend authorization is mandatory. Protect routes, handle expiry and logout, and never store secrets in the client.
Link to question 25Describe only issues you actually handled. Common findings include XSS, broken access control, insecure headers, exposed tokens, dependency vulnerabilities and missing rate limits. Prioritize by severity, reproduce safely, fix root causes, retest and document evidence.
Link to question 26Use short-lived access tokens and refresh-token rotation with server-side revocation/reuse detection when applicable. Store refresh credentials securely (often HttpOnly cookies); serialize concurrent refresh attempts, retry the original request once and log out on refresh failure.
Link to question 27Use a functional HTTP interceptor for consistent status mapping, correlation IDs and user-facing errors. Preserve useful server errors, avoid logging secrets, distinguish network failures from 401/403/404/5xx, and let feature screens handle domain-specific failures.
Link to question 28signal stores writable reactive state; computed derives a memoized read-only value; effect performs side effects when dependencies change. Prefer computed for derived state, and avoid effects that merely copy one signal into another.
Link to question 31computed is read-only derived state. linkedSignal is writable state whose value is recalculated when its source changes, useful for selections that should reset or reconcile with changing options.
Link to question 32input() exposes a read-only InputSignal; output() creates an OutputEmitterRef for events; model() creates writable model input with an associated Change output for two-way binding. Decorator APIs remain supported; signal-based APIs integrate naturally with computed and templates.
Link to question 33Zoneless Angular does not rely on Zone.js to discover asynchronous work. State changes must notify Angular via signals, template listeners, AsyncPipe, markForCheck and supported mechanisms. In Angular versions supporting provideZonelessChangeDetection(), configure it in application providers and remove unnecessary zone.js imports after compatibility testing.
Link to question 34@defer splits eligible standalone dependencies into lazy chunks. Triggers include on idle, viewport, interaction, hover, immediate, timer and when condition; prefetch has separate triggers. Use @placeholder, @loading and @error for UX.
Link to question 35resource coordinates signal-driven asynchronous loading and exposes status, value and error; httpResource integrates HTTP requests with signal-based reactive request configuration. These APIs have evolved and may be experimental depending on Angular version: verify the exact installed API before adopting. Use HttpClient Observables when they better fit streams or established patterns.
Link to question 36track provides stable identity for DOM reconciliation and is required in @for. In *ngFor, trackBy is a callback function returning a key. Prefer unique stable IDs; tracking by index is appropriate mainly for static lists.
Link to question 37Signal Forms model field state and validation with signals and declarative schema APIs, while Reactive Forms use FormControl/FormGroup and observable valueChanges/statusChanges. Signal Forms APIs are newer and version-dependent; assess maturity, ecosystem compatibility and migration cost before choosing them.
Link to question 38Both resolve dependencies from Angular DI. Constructor injection declares parameters; inject() works in injection contexts such as field initializers, constructors, provider factories and code run via runInInjectionContext. Do not call inject() from arbitrary lifecycle hooks or asynchronous callbacks without an active context.
Link to question 39Hydration reuses server-rendered DOM and attaches client-side behavior rather than recreating all markup. Incremental hydration defers hydrating selected deferred sections until triggers occur, reducing initial client work. Test event replay, DOM consistency and browser-only code.
Link to question 40