Angular Scenario Questions, Coding Round and Career Roadmap

Angular 15 min min read Updated: Nov 16, 2026 Intermediate
Angular Scenario Questions, Coding Round and Career Roadmap
Intermediate Topic 3 of 3

Scenario Questions

S1. The page is slow when a list has 10,000 rows. What do you do?

  • Use virtual scrolling (cdk-virtual-scroll-viewport) or pagination
  • Use track with a unique id
  • Use OnPush and signals
  • Move filtering to the server if possible
  • Profile with Angular DevTools

S2. Users see old data after saving. Why?

  • The local state was not updated after the API call
  • Cached response (check shareReplay or the HTTP cache)
  • Fix: update the signal or call resource.reload() after success

S3. Search sends a request for every keystroke. Fix it.

typescript term = new FormControl('', { nonNullable: true }); results = toSignal( this.term.valueChanges.pipe( debounceTime(300), distinctUntilChanged(), filter(t => t.length >= 2), switchMap(t => this.api.search(t).pipe(catchError(() => of([])))), ), { initialValue: [] });

debounceTime waits for typing to pause, distinctUntilChanged skips repeats and switchMap cancels the old request.

S4. Two components must share a cart. How?

A root-provided service with signals (CartStore). Both inject it. No parent-child link is needed.

S5. A user opens a protected link while logged out. What should happen?

The guard redirects to /login?returnUrl=.... After login, navigate to the saved returnUrl.

S6. A token expires while the user works.

The interceptor sees 401, refreshes the token once (shared among parallel requests), retries the failed request, and logs out only if the refresh fails.

S7. Your first page takes too long to load.

  • Run ng build and inspect bundle sizes
  • Lazy load routes, @defer heavy widgets
  • Optimize images with NgOptimizedImage
  • Use SSR or prerender for public pages
  • Enable compression and caching on the server

S8. A memory leak makes the app slower over time.

Look for subscriptions never unsubscribed, listeners added with addEventListener, intervals and dynamic components not destroyed. Use takeUntilDestroyed, async pipe and DestroyRef.

Live Coding Tasks

Task 1: Reusable toggle button component

typescript @Component({ selector: 'app-toggle', template: `<button role="switch" [attr.aria-checked]="checked()" (click)="checked.set(!checked())"> {{ checked() ? onLabel() : offLabel() }} </button>`, }) export class Toggle { checked = model(false); // two-way: [(checked)]="value" onLabel = input('On'); offLabel = input('Off'); }

Task 2: Custom pipe that shortens text

typescript @Pipe({ name: 'truncate' }) export class TruncatePipe implements PipeTransform { transform(value: string, max = 50, tail = '...'): string { return value.length > max ? value.slice(0, max).trimEnd() + tail : value; } }

Task 3: Fetch users and show loading, error, empty

typescript users = httpResource<User[]>(() => '/api/users');
html @if (users.isLoading()) { Loading... } @else if (users.error()) { <button (click)="users.reload()">Retry</button> } @else { @for (u of users.value(); track u.id) { <p>{{ u.name }}</p> } @empty { <p>No users</p> } }

Task 4: Form with password confirmation

Create a FormGroup with password and confirm, add a group validator that returns { passwordMismatch: true } when they differ, and show the message when the confirm field is touched.

Task 5: Debounced input directive

typescript @Directive({ selector: '[appDebounce]' }) export class Debounce { delay = input(300); debounced = output<string>(); private timer?: ReturnType<typeof setTimeout>; @HostListener('input', ['$event.target.value']) onInput(value: string) { clearTimeout(this.timer); this.timer = setTimeout(() => this.debounced.emit(value), this.delay()); } }
Interview behavior: Talk while you code. Explain what you are doing, start simple, handle empty and error states and mention how you would test it.

Portfolio Checklist

  • 3 or 4 finished projects on GitHub with a clear README and live link
  • One project with login, guards and role-based pages
  • One project using a real API with search, paging and error handling
  • Tests for at least services and key components
  • Clean commit history, linting and consistent formatting
  • Deployed with CI on GitHub Actions

Resume Tips

  • List the Angular version and tools: TypeScript, RxJS, signals, Angular Material, NgRx, Jest/Vitest, Playwright
  • Describe results: "reduced load time by 40% using lazy loading and @defer"
  • Link your GitHub and live demos
  • Keep it to one page for fresher roles

Learning Roadmap

StageLearnBuild
1. FoundationsHTML, CSS, JavaScript ES6+, GitStatic pages
2. TypeScriptTypes, interfaces, generics, classesSmall typed utilities
3. Angular coreComponents, templates, signals, services, routingTodo app
4. DataForms, HttpClient, RxJS, resourcesProduct catalog
5. Real worldAuth, guards, interceptors, state, testingAdmin dashboard
6. AdvancedPerformance, SSR, zoneless, CI/CDDeploy and optimize
7. ExtrasAngular Material, NgRx, Node or backend basics, DockerFull-stack app
Keep learning: Follow the official blog and docs at angular.dev, read release notes for each major version and try new features in a side project.

Conclusion

Practice scenarios out loud, solve small coding tasks until they feel easy, build a few deployed projects and follow the roadmap step by step. Consistent practice is what gets you hired.

Quick Summary: Scenarios + live coding + portfolio + roadmap = job-ready.

Get Newsletter

Subscibe to our newsletter and we will notify you about the newest updates on Edugators