System Design Freedom Flashcards

Get into Google

1
Q

What are

Load Balancers

A

Servers that evenly distribute incoming traffic among web servers that are defined in a load-balanced set to optimize system performance, reliability and capacity.

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

Size of

int32

A

4 bytes

This is the most common int type used across systems.

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

HTTP Status Code

406

A

Not Acceptable – Request succeeded but couldn’t generate a response that matches the content type in the Accept header.

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

Size of

float64

A

8 bytes

This is the most common float type used across systems.

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

What is a

Content Delivery Network ( CDN )

A

A network of geographically dispersed cache servers used to deliver static content.

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

What is

Database Normalization

A

Process used to organize a database into tables and columns to reduce data redundancy and improve data integrity.

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

How to estimate

Query Per Second

A

QPS = number of CPU cores / average time for a request in seconds

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

Define

System tests

A

System testing, also referred to as system-level testing or system integration testing, is the process in which a quality assurance (QA) team evaluates how the various components of an application interact together in the full, integrated system or application.

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

What is

BASE

A

Basically Available, Soft state, Eventual consistency - an alternative to ACID.

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

What is

RPC

A

Remote Procedure Call.

Communication method where a program causes a procedure to execute in another address space.

Calling functions directly from another server.

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

HTTP Status Code

1xx

A

Informational – Communicates transfer protocol-level information.

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

How to estimate

Latency

Given two resource 1 and resource 2.
Answer both ‘Sequentially’ and ‘Parallelly’

A
  • Sequentially: latency = latency_resource_1 + latency_resoure_2
  • Parallelly: max(latency_resource_1, latency_resource_2)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is

CAP Theorem

A

Consistency, Availability, Partition Tolerance - pick two out of three.

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

What is

Synchronous

A

Synchronous is a blocking architecture, so the execution of each operation depends on completing the one before it. Each task requires an answer before moving on to the next iteration. Synchronous waits for tasks to complete.

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

HTTP Status Code

4xx

A

Client Error – This category of error status codes points the finger at clients.

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

What is

Eventual Consistency

A

A consistency model which allows for some lag in data update recognition, stating that if no new updates are made, eventually all accesses will return the last updated value.

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

Define

Acceptance tests

A

Acceptance testing, sometimes called UAT (User Acceptance Testing), is a testing technique to verify whether the system works as the end user requested or not. Acceptance testing is run after software testing is complete, and the main purpose isn’t to find bugs in the system but to check if the system works as expected. By running acceptance testing before going live, development teams can ensure users can use the software/app smoothly.

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

Size of

UTF-8 in Chinese

A

3 bytes

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

HTTP Status Code

409

A

Conflict – Request is well-formed but conflicts with another resource or permission.

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

HTTP Status Code

2xx

A

Success – Indicates that the client’s request was accepted successfully.

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

What is

Asynchronous

A

Asynchronous is a non-blocking architecture, so the execution of one task isn’t dependent on another. Tasks can run simultaneously.

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

What is a

Cache

A

A temporary storage area that stores the result of expensive responses or frequently accessed data in memory.

Stored in volatile memory, not good at persisting data.

23
Q

What is

Rate Limiting

A

Control of the frequency of actions in a system, often to manage capacity or maintain quality of service.

24
Q

HTTP Status Code

500

A

System error – Given when no specific error message is available.

25
# Size of boolean
4 bytes
26
# What is ACID
Atomicity, Consistency, Isolation, Durability - properties of reliable transactions.
27
# HTTP Status Code 422
Invalid parameter – Request well-formed but contained semantic errors. Also used to indicate that a runstate change was attempted on a busy resource.
28
# HTTP Status Code 302
URL redirection
29
# HTTP Status Code 429
Too many HTTP requests in a given period of time.
30
# What is Partition Tolerance
## Footnote System continues to function even if communication fails between nodes.
31
# What are some Cache eviction policy
* Least-recently-used * Least-frequently-used * First-in-first-out
32
# HTTP Status Code 5xx
Server Error – The server takes responsibility for these error status codes.
33
# HTTP Status Code 200
Success
34
# What is a Service-Level Agreement (**SLA**)
SLA is an explicit or implicit contract between a service provider and the users. The SLA documents the set of services the service provider will offer to the user and defines the service standards the provider is obligated to fulfill. ## Footnote A contract of how a service will be designed.
35
# What is Availability
System continues to function even with node reaches failure. High availability is the ability of a service to **remain reachable** and **not lose data** even when a **failure** occurs.
36
# Size of UTF-8 character
1 byte
37
# HTTP Status Code 3xx
Redirection – Indicates that the client must take some additional action in order to complete their request.
38
# What is Vertical scaling
**Vertical scaling** is achieved by increasing the number of CPU cores, memory, and disk storage on a single server. However, the server will reach a point of saturation where increasing the number of components does not further increase the throughput.
39
# HTTP Status Code 423
Resource is busy; please wait and try your request again shortly.
40
# HTTP Status Code 401
Unauthorized – Authentication is required and has failed, or authorization hasn’t been provided
41
# What is Horizontal scaling
**Horizontal scaling** is the method of adding multiple machines to scale the pool of resources. The drawback of horizontal scaling is increased complexity.
42
# What is Diagonal scaling
**Diagonal scaling** is a combination of both vertical and horizontal scaling. Diagonal scaling brings the best of both worlds by increasing or upgrading the components on a single server and replicating the server. Diagonal scaling offers relatively better performance and a reasonable price.
43
# Size of UNIX timestamp
4 bytes
44
# Define Unit tests
In computer programming, unit testing is a software testing method by which individual units of source code—sets of one or more computer program modules together with associated control data, usage procedures, and operating procedures—are tested to determine whether they are fit for use. It is a standard step in development and implementation approaches such as Agile.
45
# What is (Data) Consistency
Data is consistent on all corresponding nodes at the same time, regardless of the user or geographic location. ## Footnote All user see the **same data** at the **same time**.
46
# How to measure Availability time
1. A percentage of **uptime** over a given period 2. MTBF ( Mean Time Between Failure ), the average time **between system failures**. 3. MTTR ( Mean Time To Repair), the average time to **restore** a system after a failure.
47
# HTTP Status Code 404
Not found – Resource can’t be found, may be available in the future.
48
# What is Token Bucket Algorithm | for Rate Limiters
Use a bucket with a capacity that stores token. Every request takes a token. If bucket is empty, drops request and return 429. Refills bucket after a certain time period. ## Footnote Parameters: Bucket Size and Refill rate.
49
# What is a Rate Limiter
Control the **rate of traffic** sent by a client or a service. Limits the number of client requests allowed to be sent over a specific period.
50
# What is **The order for System Design**? * Requirements Engineering * Capacity Estimation * Data Modeling * API Design * System Design * Discuss the Designs in Detail
1. Requirements Engineering 2. Capacity Estimation 3. Data Modeling 4. API Design 5. System Design 6. Discuss the Designs in Detail
51
# What is **Availability**? 1. The percentage of time a system is up and running per year 2. The degree of accessability of data for end users 3. The system's ability to keep data in cache and thereby available 4. The ability of a system to be accessed on a certain range of end user devices
The percentage of time a system is up and running per year
52
# Difference between HTTP and gRPC(or RPC) when chosen in a distributed system?
* HTTP is a protocol based on TCP, which requires handshake, where gRPC or RPC calls the components from a known address (service). * The serialization process is more complicated.
53
# What is DAU and MAU
Daily Active User. Monthly Active User.