Angular
Typescript
HTML
CSS
Rxjs
100

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.

100

What are the three ways to declare a variable in typescript? How are they different?

var, let, const

100

What should be on the first line of an html file

<!DOCTYPE html>

100

How do you apply a CSS style to a specific HTML element with an id of 'header'?

#header { style properties }

100

How do you create an Observable in RxJS?

Use the new Observable constructor or creation operators like of, from, interval, etc.

200

What are Angular lifecycle hooks, and can you name a few?

  • ngOnInit: Called once, after the first ngOnChanges.
  • ngOnChanges: Called before ngOnInit and whenever one or more data-bound input properties change.
  • ngDoCheck: Called during every change detection run, immediately after ngOnChanges and ngOnInit.
  • ngAfterContentInit: Called once after the first ngDoCheck.
  • ngAfterContentChecked: Called after ngAfterContentInit and every subsequent ngDoCheck.
  • ngAfterViewInit: Called once after the first ngAfterContentChecked.
  • ngAfterViewChecked: Called after the ngAfterViewInit and every subsequent ngAfterContentChecked.
  • ngOnDestroy: Called just before the directive is destroyed.
200

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.

200

How to set the language of the page to english in html?

<html lang="en">

...

200

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.

200

Can you name a few RxJS operators?

300

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

300

Name at least two typescript helper/utility types. Explain what they do.

  • Awaited<Type>
  • Partial<Type>
  • Required<Type>
  • Readonly<Type>
  • Record<Keys, Type>
  • Pick<Type, Keys>
  • Omit<Type, Keys>
  • Exclude<UnionType, ExcludedMembers>
  • Extract<Type, Union>
  • NonNullable<Type>
  • Parameters<Type>
  • ConstructorParameters<Type>
  • ReturnType<Type>
  • InstanceType<Type>
  • ThisParameterType<Type>
  • OmitThisParameter<Type>
  • ThisType<Type>
  • Intrinsic String Manipulation Types
    • Uppercase<StringType>
    • Lowercase<StringType>
    • Capitalize<StringType>
    • Uncapitalize<StringType>


300

Explain how to implement accessibility in HTML elements.

Use semantic HTML, alt text for images, ARIA roles, and ensure keyboard navigability.

300

What are 2 main reasons your z-index isn't working?

 1 - position: static, like relative or absolute

2 - parents z-index

300

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.

400

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.

400

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.

400

When does localStorage expire. 

When does session storage expire?

Never. 

When the page is closed.

400

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).

400

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.

500

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.

500

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.

500

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.

500

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.

500

What is a switchMap?

A switch map switches the source of an observable after a value has been emitted.

M
e
n
u