Trivia Flashcards

1
Q

Define hoisting.

A

when declared variables have their declaration “moved up” to top of the current scope

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

Explain Event Delegation.

A

technique involving adding event listeners to a parent element instead to descendant elements.

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

Describe Closure.

A

feature where an inner function has access to the outer enclosing function’s variables.
(Scope Chain)

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

Explain how “this” in Javascript works.

A
  • the object that “this” refers changes every time execution context is changed
  • refers to the object depending which scope
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Differences between let, var and const?

A
  • var: can be updated or redeclared within scope
  • let: can be updated but NOT redeclared
  • const: CANNOT be updated and CANNOT be redeclared
  • let and const are BLOCKED scope whereas var is globally scoped
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is TCP?

A

Transmission Control Protocol

  • CONNECTION ORIENTED
  • once connection established, data can be sent bidirectional
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is UDP?

A

User Datagram Protocol

  • CONNECTIONLESS Internet Protocol
  • multiple messages can be sent as packets in chunks using UDP
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Prototypal Inheritance:
- All JS objects have a 1 property that is reference to another 2.
- When property accessed on an object, and if not found on that object, the JS engine looks at object’s 3, and so on until end of prototype chain.
This stimulates 4 inheritance, but really more of 5 inheritance.

A
  1. ) prototype
  2. ) object
  3. ) prototype
  4. ) classical
  5. ) delegation
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Define Promise.

A

An object may produce a single value some time in the future: either a resolved value, or a reason that it is not resolved.

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

Describe Event Bubbling.

A

When an event triggers on the DOM element, it will attempt to handle the event if there’s a listener attached, then the event is bubbled up to its parent and the same thing happens.
This bubbling occurs up the element’s ancestors all the way up to the document.

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

Describe Load Balancer.

A

It helps spread traffic across cluster of servers to improve app/site/db.
Can add between client-server, and server-db.

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

What are CSS preprocessors? Give example(s) and give pros and cons.

A

A css preprocessor is a program that generate CSS from preprocessors’s own unique syntax.

  • ex: Sass and LESS
  • Pro: allows you to reuse pieces of code that you’ve already written
    • more organized
  • Con: longer to debug
    • time-consuming to compile
    • performance may be compromised
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Can you name 2 programming paradigms important for JS app developers?

A

Javascript is a multi-paradigm language, supporting imperative/procedural programming along with OOP and functional programming. JS supports OOP with prototypal inheritance.

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

What is functional programming?

A

type of language that avoids shared state and mutable data.

- pure functions used, avoiding side-effects

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

Define CORS

A

Cross-Origin Resource Sharing
allows restricted resources (eg. fonts) on a web page to be requested from another domain outside the domain from which the resource originated

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

What are Websockets?

A

Protocol providing communication channels over a single TCP connection