Describe how to pass data from a parent component to a child component.
Data can be passed from a parent component to a child component in Angular using the @Input() decorator. The parent component binds data to a property decorated with @Input() in the child component's class.
What are the three ways to declare a variable in typescript? How are they different?
var, let, const
What should be on the first line of an html file
<!DOCTYPE html>
How do you apply a CSS style to a specific HTML element with an id of 'header'?
#header { style properties }
How do you create an Observable in RxJS?
Use the new Observable constructor or creation operators like of, from, interval, etc.
What are Angular lifecycle hooks, and can you name a few?
What are decorators in TypeScript, and how are they used?
Decorators are special kinds of declarations that can be attached to a class, method, accessor, property, or parameter to modify their behavior.
How to set the language of the page to english in html?
<html lang="en">
...
What is the difference between class selectors and id selectors in CSS?
Class selectors are reusable and can be applied to multiple elements, whereas id selectors are unique and should be used for a single element.
What is a Directive and how are they used? Give a few examples of the native directives in Angular.
What are the main differences between a directive and a component?
What are the different types of directives?
Directives are used to extend the behavior of HTML by encapsulating and manipulating DOM elements, binding event listeners, and/or modifying how the element and its children are displayed.
The main difference between components and directives are that directives lack a template and instead rely on the element they're attached to for view manipulation.
The different types of directives are attribute and structural directives
Name at least two typescript helper/utility types. Explain what they do.
Explain how to implement accessibility in HTML elements.
Use semantic HTML, alt text for images, ARIA roles, and ensure keyboard navigability.
What are 2 main reasons your z-index isn't working?
1 - position: static, like relative or absolute
2 - parents z-index
What is a Subject in RxJS?
A Subject in RxJS is a type of Observable that allows multiple observers to listen to the same data stream. It also has the ability to emit new data to the subscribers at any time.
Explain the concept of Dependency Injection in Angular. What type of data should live in services and not components? Give an example of dependency injection in Angular.
In Angular Services and Injection Tokens (bonus points) can be provided to a component through the constructor.
Data centric logic, data stores, and http calls should live in services and not components.
Explain the difference between 'type' and 'interface' in TypeScript.
Both define shapes for objects and functions, but 'type' can represent a union or intersection of types, whereas 'interface' is extendable and can be implemented by classes.
When does localStorage expire.
When does session storage expire?
Never.
When the page is closed.
What are CSS variables, and how do you use them?
CSS variables (custom properties) store specific values to be reused throughout a document. They are set using --var-name: value; and accessed with var(--var-name).
What is the takeUntil operator and when would you use it?
The takeUntil operator emits the values from the source Observable until a notifier Observable emits a value.
How do you optimize change detection in a large Angular application with many bindings?
To optimize change detection, you can use strategies like OnPush change detection strategy, which instructs Angular to run change detection on components only when their @Input() properties change. You can also detach the change detector for specific components if they don't need to be checked, and use pure pipes to avoid unnecessary template recalculations.
Describe the use of 'unknown' vs. 'any' in TypeScript.
'unknown' is a type-safe counterpart of 'any' that forces developers to perform type checking before operating on the value, whereas 'any' bypasses the compiler's type checking.
What is the difference between "server" side and "client" side rendering?
Client side rendering uses javascript to generate and render the html.
Server side is when the html is generated on the server.
How can you achieve a responsive design with CSS?
Use media queries to apply different styles based on device characteristics, like width, height, or orientation.
What is a switchMap?
A switch map switches the source of an observable after a value has been emitted.