Angular Architecture & Modules Quiz – 20 Questions with Answers
20 questions · 15 min · Medium
Test your knowledge of RxJS and Observables in Angular, including Observable creation, subscriptions, operators, Subjects, error handling, asynchronous data streams, and memory management.
No sign-up needed · Last updated:
Score: 0 00:00
Create a free account to keep your scores and track your progress. It is optional.
20 questions · 15 min · Medium
15 questions · 12 min · Medium
15 questions · 12 min · Medium
15 questions · 12 min · Medium
15 questions · 12 min · Medium
15 questions · 12 min · Medium
B. A stream that can emit values over time
An Observable represents a stream of values that can be delivered over time to subscribed observers.
C. subscribe()
The subscribe() method registers an observer to receive values, errors, and completion notifications from an Observable.
A. of()
The of() creation function emits each supplied argument as a separate value and then completes.
B. map()
The map() operator applies a transformation function to each value emitted by the source Observable.
C. filter()
The filter() operator forwards only those values that pass its predicate function.
A. switchMap()
switchMap() switches to the latest inner Observable and unsubscribes from the previous inner subscription.
B. To represent an active execution and allow it to be cancelled
A Subscription represents a disposable resource associated with an Observable execution and can be unsubscribed when no longer needed.
A. Subject
A Subject is both an Observable and an Observer, allowing it to receive values and multicast them to its subscribers.
B. It stores and emits its current value to new subscribers
A BehaviorSubject requires an initial value and immediately emits its current value to each new subscriber.
A. catchError()
The catchError() operator intercepts an error and can replace the failed stream with another Observable.
B. tap()
The tap() operator is intended for side effects such as logging or debugging while passing values through unchanged.
B. HttpClient
Angular's HttpClient methods return Observables that emit HTTP response data or errors when subscribed to.
A. take()
The take() operator forwards up to the specified number of values and then completes its output Observable.
B. AsyncPipe
AsyncPipe subscribes to an Observable or Promise, exposes its latest value to the template, and automatically unsubscribes when the view is destroyed.
C. Observables can emit multiple values over time, while a Promise settles once
An Observable can emit zero or more values over time, whereas a Promise settles once with a fulfillment value or rejection reason.