Angular Interview Question Set 12
Categories: Angular
Write an example of a simple HTML document with some header information and page content.
HTML documents are all different, but they follow a basic structure of the head and body. Here you‘re checking the candidate has a good grasp of HTML document structure and basic HTML tags such as DOCTYPE, html, head, title, meta, body, h1, p, etc.
For example:
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
<meta charset="UTF-8">
Briefly explain the CSS box model. Write some code snippets to describe show what you mean.
CSS along with HTML and JavaScript is one of the building blocks of the Internet. CSS describes how webpages look. Every front-end developer should have good CSS knowledge. Good candidates will be able to describe CSS concepts concisely.
The CSS box model refers to the layout and design of HTML elements. It‘s a box shape that wraps around each HTML element. A box is made up of its content, padding, border and margin.
- Content of the box
- Padding
- Border
- Margin
What are Single Page Applications? How do they work in Angular?
Single Page Applications (SPAs) are web applications that use only one HTML page. As the user interacts with the page, new content is dynamically updated on that master page. Navigation between pages happens without refreshing the whole page. Angular uses AJAX and to dynamically update HTML elements. Angular Routing can be used to make SPAs. The result is an application that feels more like a desktop app rather than a webpage.
What is [(ngModel)] used for?
Two-way data binding. If they say one-way binding they are incorrect.
You should expect an Angular developer to know about the Angular digest cycle. This process helps with Angular data binding.
An Angular developer should know about Angular event binding too. This helps an app to respond to user actions like keystrokes and clicks. Angular developers need thorough knowledge of the event binding syntax.
What are the basic parts of an Angular application?
Modules, Component, Property Binding, Template, Structural Directives, Dependency Injection, Services, Routing.
Note: Angular developers should know about structural directives in Angular well. Structural directives are one of the 3 types of directives in Angular. The other 2 types are as follows:
Components: These are directives with templates.
Attribute directives: These are used for changing the appearance or behavior of an element or component.
Describe how you would approach solving (some problem) on a high level?
In this question, the problem should be directly related to the work the candidate will actually be doing. You aren‘t looking for a perfect answer or even necessarily a correct answer. Instead, listen to how they approach solving a problem, their ability to break a problem down into parts, and if they can anticipate problems.
What are some advantages of using Angular framework for building web applications?
Advantages of using the Angular framework include:
- Angular does lots of things for you under the hood. It saves time for developers by doing a lot of the work for them like writing tedious DOM manipulation tasks
- TypeScript and the Angular framework allow you to catch errors much earlier
- In many cases has faster performance than traditional web development techniques
- Can give web apps the feel of a desktop application
What function is called when an object is created in TypeScript? What is it‘s basic syntax in TypeScript code?
The constructor function is called. It‘s syntax is: Constructor(){}
Note: Angular developers should have sound knowledge of the scope object in Angular, which is a built-in object.
In Angular, how can you interact between Parent and Child components?
When passing data from Parent to Child component, you can use the @Input decorator in the Child component. When passing data from Child to Parent component, you can use the @Output decorator in the Child component.