System Design '23 Flashcards
What distributed problems does a Load Balancer solve?
Server hotspot and Parallel Requests
What problems can be solved by Data replication?
Geo location, server hotspot, parallel requests.
What problems can Data Sharding solve?
Parallel requests, Data size limitations, and data hotspots.
What problems can caching solve?
Data Hotspots, Parallel Requests, Geolocation problems,
What’s the format for writing an API on the whiteboard?
POST /order
request:
{
“user” : user_id
“quantity” : number
“item” : barcode
“date” datetime
}
response:
{
…data
}
What is a 401 code?
Not Authorized
What code is use for Not Authorized?
401
What does a 500 Response code mean?
Internal Service Error
What’s a 403 mean?
Forbidden - valid formatted credentials but not authorized
What’s the diff between 401 and 403 response codes?
401 means no or invalid credentials supplied. 403 means valid credential but user isn’t authorized.
What type of database do you use with any kind of file storage?
Blob, or S3 storage
What do you need to mention when file transfers are mentioned?
Chunking, or torrent protocol. Break the file transfer into chunks and store them one at a time. Server can still be stateless and just map out the necessary file chunks.
Describe Linearizability?
This is how you achieve strong consistency, as in all transactions are read dealt with as if in sequential order.
What is the cost of Linearization on a distributed system?
Availability, there will be latency in sending each transaction to all the replicas before allowing them to process a subsequent transaction.
What is a serialization problem on a non distributed system?
When parallel transactions occur, how do you make sure one happens in order? Serially.
What does Blob stand for?
Binary Large object store.
What does serialization mean for?
Trxs happening in a sequential order.
What’s the difference between web sockets and polling?
Polling repeatedly polls the network for a data change. Web sockets have a two way open communication and can each speak to each other when needed.
What is session affinity?
When a LB stores a session and sends user requests to the same backend server.
What is gRPC used for?
It can be used in internal microservices
What 6 main api architectures?
Soap, gRPC, REST, GraphQl, Web sockets, webhooks.
What’s a good usecase for web sockets?
Real time updates (Uber, delivery status, chat app)
What are the 3 main standards for Event Driven APIs?
Webhooks, WebSockets, HttpStreaming
What type of connection is gRPC/RPC good for?
Microservice communication
What are 3 use cases for consistent Hashing?
Distributed Cache, Load Balancing, Distributed databases