Week 8 Angular & SDLC QC Questions Prep Flashcards

1
Q

What makes a “single page application” (SPA) different from a normal web page?

A

SPAs are faster than traditional web applications because they execute the logic in the web browser itself rather than on the server. And after the initial page load, only data is sent back and forth instead of the entire HTML that reduces the bandwidth.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Explain the difference between server-side and client-side rendering

A

Client-side rendering manages the routing dynamically without refreshing the page every time a user requests a different route. But server-side rendering is able to display a fully populated page on the first load for any route of the website, whereas client-side rendering displays a blank page first.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are some features of the Angular framework?

A

Cross Platform. Progressive Web Apps. Use modern web platform capabilities to deliver app-like experiences.

Speed and Performance. Code Generation. 

Productivity. Templates. 

Full Development Story. Testing.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How does TypeScript relate to JavaScript? What are the major benefits of using it over JavaScript?

A

TypeScript is an open source syntactic superset of JavaScript that compiles to JavaScript (EcmaScript 3+). TypeScript offers type annotations which provide optional, static type checking at compile time. Since it is a superset of JavaScript, all JavaScript is syntactically valid TypeScript.

The main benefit of Typescript is that it offers the ability to add static types to your Javascript code.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

List the data types of TypeScript

A

Some common data types in TypeScript are:

number ,
string ,
boolean ,
enum ,
void ,
null ,
undefined ,
any ,
never ,
Array and tuple

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How would you create a new Angular project?

A

The first step is to install the Angular CLI.
npm install -g @angular/cli@latest

The second step is to create the project using ng new.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is an angular component? How would you create one?

A

Angular components are a subset of directives, always associated with a template.

To create a component use the command “ng g component “

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What files make up a component? What is the “spec” file used for?

A

Each component consists of:

An HTML template that declares what renders on the page

A TypeScript class that defines behavior

A CSS selector that defines how the component is used in a template

Optionally, CSS styles applied to the template

The “spec” file contains unit tests for the main AppComponent.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Explain the relevance of npm to Angular projects.

A

Angular applications and Angular itself depend upon features and functionality provided by a variety of third-party packages. These packages are maintained and installed with the Node Package Manager (npm). Node. js and npm are essential to Angular development.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Which file does npm use to track dependencies?

A

All npm packages contain a file, usually in the project root, called package. json

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

List some decorators for Angular apps

A
  • Class decorators, e.g. @Component and @NgModule
  • Property decorators for properties inside classes, e.g. @Input and @Output
  • Method decorators for methods inside classes, e.g. @HostListener
  • Parameter decorators for parameters inside class constructors, e.g. @Inject
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is the lifecycle of a component? List some lifecycle hooks:

A
  • There are 8 different stages in the component lifecycle.
  • Every stage is called as lifecycle hook event. So, we can use these hook events in different phases of our application to obtain control of the components.
  • LiefeCycleHooks include: ngOnInit, ngOnDestroy, ngDoChecks(), ngAfterViewInit()
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is a directive and what are the different types? How to tell these directives apart with syntax?

A

Directives are classes that add additional behavior to elements in your Angular applications.

The different types of Angular directives are as follows:

Components: Used with a template. This type of directive is the most common directive type.

Attribute directives: Change the appearance or behavior of an element, component, or another directive.

Structural directives: Change the DOM layout by adding and removing DOM elements.

Structural Directives are preceded by Asterix (*)symbol.
Attribute Directives do not use the Asterix.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is the benefit of using a directive like NgClass over the class attribute

A

ngClass is more powerful. It allows you to bind a string of classes, an array of strings, or an object.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is a pipe? A service?

A

Pipes are a useful feature in Angular. They are a simple way to transform values in an Angular template. There are some built in pipes, but you can also build your own pipes. A pipe takes in a value or values and then returns a value.

Angular services are objects that get instantiated just once during the lifetime of an application. They contain methods that maintain data throughout the life of an application, i.e., data is available all the time.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

How would you create a custom pipe?

A

1) Create a Pipe Class and decorate it with the decorator @Pipe.
2) Supply a name property to be used as template code name.
3) Register your Pipe in the module under declarations.
4) Finally, implement PipeTransform and write transformation logic.

17
Q

How would you create a service?

A

You can create a service using the following command:

ng generate service

18
Q

How does dependency injection work in Angular?

A

Angular facilitates the interaction between dependency consumers and dependency providers using an abstraction called Injector. When a dependency is requested, the injector checks its registry to see if there is an instance already available there. If not, a new instance is created and stored in the registry. Angular creates an application-wide injector (also known as “root” injector) during the application bootstrap process, as well as any other injectors as needed.

19
Q

What is an Angular module?

A

In Angular, a module is a mechanism to group components, directives, pipes and services that are related, in such a way that can be combined with other modules to create an application. An Angular application can be thought of as a puzzle where each piece (or each module) is needed to be able to see the full picture.

20
Q

What properties should you set inside an Angular module?

A

The following are the most important properties that should be set inside an Angular module.

declarations: The components, directives, and pipes that belong to this NgModule.

exports: The subset of declarations that should be visible and usable in the component templates of other NgModules.

imports: Other modules whose exported classes are needed by component templates declared in this NgModule.

providers: Creators of services that this NgModule contributes to the global collection of services; they become accessible in all parts of the application. (You can also specify providers at the component level.)

bootstrap: The main application view, called the root component, which hosts all other application views. Only the root NgModule should set the bootstrap property.

21
Q

What’s the difference between a JavaScript module and Angular module?

A

The difference between Js Module & Angular Module is Js module is just a file, but angular module is a class that logically groups the components and others.

Some common Angular Modules are:

BrowserModule: @angular/platform-browser - When you want to run your app in a browser

CommonModule: @angular/common - When you want to use NgIf, NgFor

FormsModule: @angular/forms - When you want to build template driven forms (includes NgModel)

ReactiveFormsModule: @angular/forms - When you want to build reactive forms

RouterModule: @angular/router - When you want to use RouterLink, .forRoot(), and .forChild()

HttpClientModule: @angular/common/http - When you want to talk to a server

22
Q

How would you run your unit tests for an Angular project?

A

You can execute the unit tests for your app via the CLI by running ng test from within the root, project directory. Upon running ng test , two things happen. First, Angular uses the Karma test runner to open up a new browser window that contains the reporting mechanism for your unit tests.

23
Q

How have you used the HttpClient? What methods does it have and what do they return?

A

I used the HttpClient to send and receive Http requests and responses from URLs. It was used for the login and registration functions of our current project 2.

Some methods HttpClients have are:
GET, POST, PUT, and DELETE.

GET returns an HTTP status code of 200 (OK)

POST request is used to send data (file, form data, etc.) to the server. On successful creation, it returns an HTTP status code of 201.

A PUT request is used to modify the data on the server. It replaces the entire content at a particular location with data that is passed in the body payload. If there are no resources that match the request, it will generate one.

A DELETE request is used to delete the data on the server at a specified location.`

24
Q

What is an Observable? What’s the difference between it and a Promise?

A

Promises deal with one asynchronous event at a time, while observables handle a sequence of asynchronous events over a period of time.

25
Q

What forms of data binding does Angular support?

A

One-way databinding: a simple one way communication where HTML template is changed when we make changes in TypeScript code.

Two-way databinding: automatic synchronization of data happens between the Model and the View. Here, change is reflected in both components. Whenever you make changes in the Model, it will be reflected in the View and when you make changes in View, it will be reflected in Model.

26
Q

What does Webpack do for your ng project?

A

Webpack is a tool that lets you compile JavaScript modules, also known as module bundler. Given a large number of files, it generates a single file (or a few files) that run your app. It can perform many operations: helps you bundle your resources

27
Q

How would you implement routing in your project?

A

Install Angular CLI globally on your system

Next, make components for the application such as home, about, dashboard and so on.

Once those are set I would import the routing modules inside the app.modules.ts file, then configure it by making sure the file paths are correct.

After that I would configure the routes by creating a routerConfig.ts file and including some imports in relation to the components created. Then I would import that object in the app.module.ts file.

Once that is complete I would define the router outlet in the app.component.html file.

28
Q

What are the steps in the software development lifecycle?

A

Planning / Requirements gathering
Analysis
Design
Development
Testing
Deployment
Maintenance

29
Q

What is the difference between Waterfall and Agile methodologies? Explain the benefits and drawbacks of each

A

Waterfall: linear, one-way, unable to make changes; best for projects with fixed, rigid requirements or highly regulated

Agile: iterative approach, customer collaboration, responding to change; best for projects in dynamic environments where adaptation required
30
Q

List some of the principles declared in the Agile manifesto

A

Our highest priority is to satisfy the customer through early and continuous delivery of valuable software

Welcome changing requirements

Preference for shorter timescale for releases

Business people & developers work together

Value face to face conversation for communication

Working software is the primary measure of progress

Sustainable development - should be able to maintain constant pace

Continuous attention to technical excellence and good design enhances agility.

Simplicity – the art of maximizing the amount of work not done – is essential.

The best architectures, requirements, and designs emerge from self-organizing teams.

At regular intervals, the team reflects on how to become more effective, then tunes and adjusts its behavior accordingly.
31
Q

What specific Agile frameworks exist? What are the main features of each?

A

XP (Extreme programming) - paired programming, code reviews
Scrum - sprints, daily standups, story pointing
Kanban - kanban board

32
Q

What is the Scrum process? Explain each of the Scrum ceremonies

A

Sprint planning meeting
Daily scrum (standups)
Sprint review
Sprint retrospective

33
Q

How long is a typical sprint?

A

2-4 weeks

34
Q

What is a “standup” and what should you report about your work?

A

Short, ~15 min total; update on the status of everyone’s work
What you worked on yesterday, what you plan to work on today, and any blockers you have

35
Q

What is the role of a “Scrum master” in a project? What about the “Product owner”?

A

Scrum master is like the cheerleader / advocate for the team; they make sure nothing is in the team’s way

Product owner sets the vision for the product, helps with generating requirements / user stories and prioritizing
36
Q

Explain the following metrics/charts: sprint velocity, burndown chart

A

Velocity - average story points completed per sprint

Burndown chart - showing reduction in outstanding story points over the sprint
37
Q

What is a Scrum board? Have you used any software tools for your team’s Scrum board?

A

Board that has multiple columns as categories for the state of user stories

Backlog, Todo, In Progress, Done are typical categories
38
Q

What is the “Definition of Done”?

A

The requirements the team agrees have to be met for a user story to be considered “done”

Example: all unit tests pass, code is reviewed and merged in feature branch, non-functional requirements met
39
Q

Name some technologies teams can use to keep track of progress on different projects, tasks, and due dates.

A

JIRA, Github projects, Trello, Asana