System Design Freedom Flashcards
Get into Google
What are
Load Balancers
Servers that evenly distribute incoming traffic among web servers that are defined in a load-balanced set to optimize system performance, reliability and capacity.
Size of
int32
4 bytes
This is the most common int type used across systems.
HTTP Status Code
406
Not Acceptable – Request succeeded but couldn’t generate a response that matches the content type in the Accept header.
Size of
float64
8 bytes
This is the most common float type used across systems.
What is a
Content Delivery Network ( CDN )
A network of geographically dispersed cache servers used to deliver static content.
What is
Database Normalization
Process used to organize a database into tables and columns to reduce data redundancy and improve data integrity.
How to estimate
Query Per Second
QPS = number of CPU cores / average time for a request in seconds
Define
System tests
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.
What is
BASE
Basically Available, Soft state, Eventual consistency - an alternative to ACID.
What is
RPC
Remote Procedure Call.
Communication method where a program causes a procedure to execute in another address space.
Calling functions directly from another server.
HTTP Status Code
1xx
Informational – Communicates transfer protocol-level information.
How to estimate
Latency
Given two resource 1 and resource 2.
Answer both ‘Sequentially’ and ‘Parallelly’
- Sequentially: latency = latency_resource_1 + latency_resoure_2
- Parallelly: max(latency_resource_1, latency_resource_2)
What is
CAP Theorem
Consistency, Availability, Partition Tolerance - pick two out of three.
What is
Synchronous
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.
HTTP Status Code
4xx
Client Error – This category of error status codes points the finger at clients.
What is
Eventual Consistency
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.
Define
Acceptance tests
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.
Size of
UTF-8 in Chinese
3 bytes
HTTP Status Code
409
Conflict – Request is well-formed but conflicts with another resource or permission.
HTTP Status Code
2xx
Success – Indicates that the client’s request was accepted successfully.
What is
Asynchronous
Asynchronous is a non-blocking architecture, so the execution of one task isn’t dependent on another. Tasks can run simultaneously.
What is a
Cache
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.
What is
Rate Limiting
Control of the frequency of actions in a system, often to manage capacity or maintain quality of service.
HTTP Status Code
500
System error – Given when no specific error message is available.
Size of
boolean
4 bytes
What is
ACID
Atomicity, Consistency, Isolation, Durability - properties of reliable transactions.
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.
HTTP Status Code
302
URL redirection
HTTP Status Code
429
Too many HTTP requests in a given period of time.
What is
Partition Tolerance
System continues to function even if communication fails between nodes.
What are some
Cache eviction policy
- Least-recently-used
- Least-frequently-used
- First-in-first-out
HTTP Status Code
5xx
Server Error – The server takes responsibility for these error status codes.
HTTP Status Code
200
Success
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.
A contract of how a service will be designed.
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.
Size of
UTF-8 character
1 byte
HTTP Status Code
3xx
Redirection – Indicates that the client must take some additional action in order to complete their request.
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.
HTTP Status Code
423
Resource is busy; please wait and try your request again shortly.
HTTP Status Code
401
Unauthorized – Authentication is required and has failed, or authorization hasn’t been provided
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.
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.
Size of
UNIX timestamp
4 bytes
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.
What is
(Data) Consistency
Data is consistent on all corresponding nodes at the same time, regardless of the user or geographic location.
All user see the same data at the same time.
How to measure
Availability time
- A percentage of uptime over a given period
- MTBF ( Mean Time Between Failure ), the average time between system failures.
- MTTR ( Mean Time To Repair), the average time to restore a system after a failure.
HTTP Status Code
404
Not found – Resource can’t be found, may be available in the future.
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.
Parameters: Bucket Size and Refill rate.
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.
What is
The order for System Design?
- Requirements Engineering
- Capacity Estimation
- Data Modeling
- API Design
- System Design
- Discuss the Designs in Detail
- Requirements Engineering
- Capacity Estimation
- Data Modeling
- API Design
- System Design
- Discuss the Designs in Detail
What is
Availability?
- The percentage of time a system is up and running per year
- The degree of accessability of data for end users
- The system’s ability to keep data in cache and thereby available
- 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
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.
What is
DAU and MAU
Daily Active User.
Monthly Active User.