Technical Questions Flashcards

1
Q

What happens when you navigate to a website? -Very Technical

A

https://www.tryexponent.com/questions/114/what-happens-navigate-website

  1. You type maps.google.com into the address bar of your browser.
  2. Browser completes the address, for example, maps.google.com →
  3. [Address decoding] → browser breaks down the URL into parts
  4. The browser checks the cache for a DNS record to find the corresponding IP address of maps.google.com, but how?
  5. 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
  6. The browser initiates a TCP connection with the server.
  7. The browser sends an HTTP request to the webserver!
  8. The server handles the request and sends back a response
  9. The server sends out an HTTP response
  10. 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
2
Q

What happens when you navigate to a website? - Grandma’s Answer

A

Goal:

User tries to access a website, she enters the site name and expects to see content loaded in the browser to start exploring

Under the covers - high-level internet

On the Internet every website is hosted in a server that has an IP number that identifies it, this is part of the network protocols, and the different steps to get from a web site domain to the machine that has the content we want to access is well defined in the OSI model, I will go through the model to explain what happens under the covers.

Name Resolution - DNS

The first step the browser needs to do is to contact the Domain Name System to transform the URL or the domain part of the URL (between :// and the next /) to an IP number that can answer the request.

DNS is like a dictionary, there are servers replicated all over the world and the client machine with the browser will do a query to DNS to get an IP Address where we need to get the data.

If the name does not exist, there will be an error and the browser can show this to the user. But if the domain exists, now the network kicks off to bring the content needed according to the full URL

Routing

If you look at it from the server point of view, it is running some kind of service that has all the documents and information that need to be displayed, it also manages sessions with Clients and it has a network card that is connected to the Ethernet with a cable. All of this is basically represented in the OSI model.

The cable is the physical layer, the network card has a Mac Address that should be unique in the world, then it is translated to the IP layer to the IP number we were talking about.

When the request leaves the client the Internet does its magic with the carrier to find the best route from this machine to the server machine, this depends on many things and there are different methods to do it, but in the end, there is a known path from one machine to the server.

Server request resolution

The server receives the request from the client and resolves the full URL, not only the domain name but also what is specifically being asked, maybe a particular web page, maybe it is a login request, maybe it is a request of a video. The Web Server running can understand the URL and can start answering with what was requested.

Is it a secure request?

Most of the websites today use what we know as Secure request or Secure website, the first part of the URL is the part that specifies the security level, for instance, http or https.

If the request is https, besides returning the content, the server needs to create a secure session, with encryption and authentication, this is using something called SSL and it makes sure that no-one can sniff the communication between client and server.

Return packages with data

Once the session is established and security is activated when needed, depending on the request the server will answer with one or many packages with the content to be displayed to the user. In some cases, for instance, when streaming music and video, this will keep happening until streaming finishes, but in most cases, it is just a bunch of packages with the result of the query.

Rendering in the Browser

The browser receives all the packages and puts them together, there are other things happening in the middle, like making sure the packages are complete, in order, and so on. All the communication between clients and servers is well defined and has been used for decades now.

But basically, the browser is smart enough to start rendering the web page or showing the content. Modern browsers do not wait for all the content to arrive so they can be perceived as faster to the user, but the speed only depends on the network speed and the size of the content to be loaded.

The user can see what she wanted and is happy to start interacting with it.

Drawbacks:

Error codes: at any moment, the network can be down, the server can be down, routing errors, there are specific error defined and workaround defined, but at the end, if there is a fatal error the browser will end up saying “something is wrong”

Special media: for video calls, audio calls, movie streaming, the request will be longer than a simple page, and new protocols and compression techniques are used to guarantee a good service.

Privacy: for sites using personal information, HTTPS and SSL are a must, this will warranty the security of the content of the session. This is what is used for bank transactions as well. The browser usually warns when the access is not secure.

Optimizations: The browser and network can use a cache of common requests, making the process faster. Also, the browser implements things that make the task for the user easier like auto-complete of URL based on history.

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

What are the top 3 technology trends that will change the landscapes in the next decade?

A

Artificial intelligence (AI) and machine learning. The increasing ability of machines to learn and act intelligently will absolutely transform our world. It is also the driving force behind many of the other trends on this list.

The Internet of Things (IoT). This refers to the ever-growing number of “smart” devices and objects that are connected to the internet. Such devices are constantly gathering and transmitting data, further fueling the growth in Big Data and AI.

Blockchains and distributed ledgers. This super-secure method of storing, authenticating, and protecting data could revolutionize many aspects of business – particularly when it comes to facilitating trusted transactions.

Cloud and edge computing. Cloud computing – where data is stored on other computers and accessed via the internet – has helped to open up data and analytics to the masses. Edge computing – where data is processed on smart devices (like phones) – will take this to the next level.

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

What is API

A

API enable the the communication between applications.

Restaurant/Waiter/Kitchen scenario

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

There is a fire in a data center. What would you do?

A

It is an emergency. I will coordinate the people to do the following in parallel, if I am the first one to know.

Get immediate attention of folks in the data center. Get someone and many people to call 911 and security. Coordinate to have people in need evacuated.
Turn off the power supply to data center, assuming it did not happen automatically. Of course, I may not know, but by this time the folks in charge of the DC have already started acting on it.
When and if the experts have arrived, then follow their lead.
If the extent of fire and smoke is less, then keep calm and find the fire extinguisher. Try and use the fire extinguisher to douse the flames. If there’s no power, use my phone.
If the extent of fire can be more and power has not be turned off yet, evacuate because it is not safe.

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

YouTube went down last week. What factors do you think could have caused a big system like that to fail?

A

Clarifying Questions

Have we confirmed this was a server side issue and not client side or network related?
Interviewer confirms this was a server side issue
Do we have additional information on whether this was region specific, user specific?
Interviewer says you can make some assumptions

Introduction

I am going to focus on a few potential factors and describe how they could lead to system downtime:

Data Center Power Outage
Software Deployment
Software Bug
Performance and Scale
Authentication and Security

Data Center Outage

If a natural disaster such as a hurricane takes out power at an entire data center, this can cause YouTube to go down region wide. Data centers are likely to have backup generators or backup locations but an outage can happen in extreme circumstances.

Software Deployment

It is possible for downtime to occur during software deployment. When deploying a new release, traffic is directed from an older version to a newer version of the code. If requests are not switched over successfully the user may experience downtime.

Software Bug

It is reported that Microsoft Azure was once down due to a leap day related software bug, where the calendar used by the system did not account for Feb 29th every four years. There are rumors this may have caused Robinhood to go down more recently. This is just one example of a software related outage.

Performance and Scale

If server utilization is at capacity or overloaded, it could be possible the queue is backed up to the point where the server stops responding to incoming requests. This can happen due to CPU utilization or memory utilization. It is also possible for DDoS attacks to maliciously overload servers. That said, Google should be able to spin up additional capacity as needed and have threat detection mechanisms, protecting against downtime as a result of overload.

Authentication and Security

If there is an issue with authentication servers (ex. keys, tokens going out of sync between services) it is possible the request is unable to authenticate. Alternatively, it is possible that if a hacker gains entry into the system as a security administrator they can prevent access to other users.

Overall, software deployment and software bugs are more likely causes of downtime for a company like Google as opposed to data center, performance, or authentication issues.

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

How does internet work

A

Internet is a global network of computers, each computer connected to the Internet must have a unique address. We can it IP address here.

The Internet is represented as an abstract object in-between the two computers.

These two computer connected to internet talked to each other through protocol stack. It is usually built into the computer’s operating system.

When you enter a web address into your web browser, the browser first connects to your primary DNS server. After obtaining the IP address for the domain name you entered, the browser then connects to the target computer and requests the web page you wanted.

When you type a URL into a web browser, this is what happens (Sandford)

If the URL contains a domain name, the browser first connects to a domain name server and retrieves the corresponding IP address for the web server.
The web browser connects to the web server and sends an HTTP request (via the protocol stack) for the desired web page.
The web server receives the request and checks for the desired page. If the page exists, the web server sends it. If the server cannot find the requested page, it will send an HTTP 404 error message. (404 means ‘Page Not Found’ as anyone who has surfed the web probably knows.)
The web browser receives the page back and the connection is closed.
The browser then parses through the page and looks for other page elements it needs to complete the web page. These usually include images, applets, etc.
For each element needed, the browser makes additional connections and HTTP requests to the server for each element.
When the browser has finished loading all images, applets, etc. the page will be completely loaded in the browser window.

When you type a URL into a web browser, this is what happens (YouTube)

Use Case: You want to access data on the internet, i.e. YouTube video.

Concept of IP Address: Through IP, the information has a sender and a recipient

Data location - stored in a data center on an SSD of a server ( server has an IP address)

Any device connected to the internet is identified by IP address given by internet service provider.

User Case: You want to access google.com
Google.com also have an IP address, hidden under a domain name, to be easier to use. For human being is much easier for us to remember google.com than to remember numbers like 105.30.4.284

Concept of DNS Server: Works like a phone book. DNS (Domain Name System) associates a name for each website IP address in the world. i.e. Google.com - 142.250.60.196.

From here, this data request that you made, is transmitted to the respective server and the data transfer to you starts. The data flow through the fiber optic cable system in the form of light pulses and reaches your router. The data is transmitted by the router in the form of electrical signals via cable or wifi.

Google.com content is displayed.

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

What is API?

A

Application Programming Interface
Enables communication between applications

Restaurant scenario: you can imagine API as a waiter or an intermediary between you (client) and the kitchen (server) and helps to communicate your order (request) to the kitchen and then brings your food (response) to you

Real life scenario: Online travel agency (application) to book hotel from different hotel website (application) via an API (i,e. Find your ticket button)

Tech scenario:
Client (service consumer) send request to Server (service provider)
Server (service provider) sends respond to Client (service consumer)

Medium: http
Format: Json, xml
coding languages

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