Angular Kickstart: Easy Quiz on Core Features Quiz

  1. Purpose of Angular

    Which statement best describes Angular as a framework for web development?

    1. A framework for building single-page web applications using components
    2. A relational database management system
    3. A CSS preprocessor for nesting and variables
    4. A desktop web browser
    5. A static site generator that produces only plain HTML with no client logic
  2. Role of a Component

    In Angular, what is the main purpose of a component in an app such as a simple to-do list?

    1. To encapsulate the view, logic, and styles for a part of the UI
    2. To maintain a persistent TCP connection to a server
    3. To compile scripts into machine code
    4. To store user passwords securely
    5. To manage low-level DOM APIs without templates
  3. Interpolation

    Which Angular feature lets you display a component property named title inside a template by writing {{ title }}?

    1. Interpolation
    2. Compilation
    3. Installation
    4. Isolation
    5. Intercession
  4. Structural Directives

    Which directive would you use to show a welcome message only when a boolean variable isLoggedIn is true?

    1. *ngIf
    2. *ngShow
    3. *ngRepeat
    4. *ngVisible
    5. *ngSwitchCase
  5. Services and Dependency Injection

    Why would you create a service and inject it into multiple components, such as a CartService used by both a product list and a checkout view?

    1. To share reusable data and business logic across components via dependency injection
    2. To render CSS styles more efficiently
    3. To guarantee zero network latency
    4. To automatically generate database schemas
    5. To replace the routing system with hard-coded URLs
  6. Modules (NgModule)

    What is the primary role of an Angular module (NgModule) in an application?

    1. To organize related components, directives, pipes, and providers into a cohesive block
    2. To schedule tasks on the operating system
    3. To manage browser cookies and local storage exclusively
    4. To compress images before upload
    5. To render server-side templates on a remote host
  7. Routing Basics

    In a single-page app with a home page and a details page, what does the Angular router enable?

    1. Navigating between views based on URL changes without a full page reload
    2. Encrypting URLs so users cannot see them
    3. Blocking network requests from third-party domains
    4. Automatically resizing images for mobile screens
    5. Compiling templates into server-side HTML only
  8. Pipes for Display

    When you need to format a date for display (for example, 2025-01-01 to Jan 1, 2025) without changing the underlying data, which Angular feature should you use?

    1. Pipe
    2. Guard
    3. Service
    4. Resolver
    5. Injector
  9. Lifecycle Hooks

    If you want to run initialization code after a component is created, such as loading initial items for a list, which lifecycle hook should you implement?

    1. ngOnInit
    2. ngOnDestroy
    3. ngAfterExit
    4. onCreate
    5. construct
  10. Two-Way Binding

    Which template syntax enables two-way data binding for a text input bound to a name property, so editing the input updates name and vice versa?

    1. [(ngModel)]
    2. [value]
    3. (input)
    4. {{ name }}
    5. [ngModel]