System design interview Flashcards

(9 cards)

1
Q

Explain the client/server interaction for a web application

A
  1. user accessed website through domain name, DNS usually provided by a 3rd party
  2. IP is returned to the user
  3. HTTP requests are sent from the user to the server using the obtained IP address
  4. the web server returns http pages or json as a response
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Give reasons to use a non relational database

A
  • Application requires low latency
  • The data is unstructured or no relational data present
  • Only need to serialize and deserialize data
  • Need to store massive amounts of data
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Explain vertical vs horizontal scaling

A

vertical => more power (CPU, RAM), simple, doesn’t favor redundancy

horizontal (scale out) => increasing the number of instances of the servers in the pool, more suitable for larger applications

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

Why use a load balancer?

A
  • Evenly distribute web traffic among web servers of a pool
  • Add security because only the IP of the load, the server IPs are now private
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Explain database replication

A
  • Master databases only support write operations
  • Slave databases with copied data from the master database only support read operations
  • Better performance and redundancy
  • If the master database goes offline, a slave database will be promoted to master
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Explain cache

A
  • Temporary storage that stores responses of expensive or frequent requests
  • Useful when data is frequently read but infrequently modified
  • Not ideal for persisting data because data is stored in volatile memory
  • Add an expiration policy to prevent cache from growing too big
  • Keep the data between the cache and the source up to date
  • Single point of failure
  • Eviction: when the cache is full, adding new data will remove data (LRU, LFU, FIFO)
  • Cache tier: cache layer between database and server
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Explain CDN

A
  • Geographically dispersed server that caches static content (html, css, js, images, videos)
  • Cache between the server and the user
  • Usually provided by a third party
  • CDN outages should be planned for by redirecting requests on the client side
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is relational data?

A

Relational data refers to data organized in tables composed of rows and columns, where the relationships between data points are defined and managed through keys.

Each table, also known as a relation, represents a specific entity or concept, such as customers or products.

The connections between tables are established using primary keys—unique identifiers for each row—and foreign keys, which reference the primary key of another table.

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

What does serialize and deserialize mean?

A

Serialization is the process of converting a data structure, object, or state into a format that can be stored, transmitted, or persisted, such as a string, byte stream, or file.

Deserialization is the reverse process, where the serialized data is reconstructed back into its original object or data structure.

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