WebDev General Stuff Flashcards

1
Q

What does it mean to be RESTFUL?

A

REST = Representational State Transfer

Set of design principles for making network communication more scalable & flexible.

Constraints that make it restful.

  1. Network made up of clients and servers (one-to-one communication.
  2. Uniform Interface: common language between servers and clients that allows each part to be swapped out or modified without breaking the entire system.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What’s an example of non-RESTful alternative to a client-server architecture?

A

event-based integration architecture.

In this model, each component continuously broadcasts events while listening for pertinent events from other components.

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

What happens when you type an URL in the browser and press enter?

A
  1. The browser checks the cache for a DNS record to find the corresponding IP address of maps.google.com.
    - browser cache
    - OS cache
    - router cache
    - ISP cache
  2. If the requested URL is not in the cache, ISP’s DNS server initiates a DNS query to find the IP address of the server that hosts maps.google.com.
    - Root domain “.”
    - Top-level domain “.com”
    - Second-level domain “google” in google.com
    - third-level domain “maps” in maps.google.com
  3. Browser initiates a TCP connection with the server.

A. Client machine sends a SYN packet to the server over the internet asking if it is open for new connections.

B. If the server has open ports that can accept and initiate new connections, it’ll respond with an ACKnowledgment of the SYN packet using a SYN/ACK packet.

C. The client will receive the SYN/ACK packet from the server and will acknowledge it by sending an ACK packet.

Then a TCP connection is established for data transmission!

  1. The browser sends an HTTP request to the web server.
  2. The server handles the request and assembles back a response.
  3. The server sends out an HTTP response.
  4. The browser displays the HTML content (for HTML responses which is the most common).
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is the DOM?

A

A Web page is a document. This document can be either displayed in the browser window or as the HTML source. But it is the same document in both cases. The Document Object Model (DOM) represents that same document so it can be manipulated. The DOM is an object-oriented representation of the web page, which can be modified with a scripting language such as JavaScript.

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

What is a Promise?

A

Promises give us a way to handle asynchronous processing in a more synchronous fashion. They represent a value that we can handle at some point in the future. And, better than callbacks here, Promises give us guarantees about that future value, specifically.

3 States:

  1. Pending - until a Promise is fulfilled it is in pending state
  2. Fulfilled - when the first handler is called the Promise is considered fulfilled with the value passed to that handler.
  3. Rejected - if the second handler is called, the Promise is considered rejected with the value passed to that handler.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly