What a system is made of: clients, servers, databases and the paths between them
Almost every interview design starts with the same few boxes: a phone app, a load balancer, some app servers, a cache and a database, joined by the network. This guide shows what each one does and which of them you can copy when traffic grows.
A restaurant on a busy night
Picture a restaurant on a Friday night. Diners order at the front, where the host writes a ticket and hands it to whichever of the four cooks is free. Each ticket says everything the dish needs, so any cook can make it, and if one goes home ill the others carry on. Beside the stoves is one shelf all the cooks share, stocked with what diners ask for most. A cook checks it first and walks to the storeroom only when it's empty, bringing a little extra back for the shelf.
Now map the story onto a system. The diners are the clients: phone apps and browsers. The host is the load balancer, spreading requests across the cooks, who are the app servers. The shared shelf is the cache, and the storeroom is the database, the one place that holds everything and is always right. The walks between them are the network, the paths every request travels. Make sense? Good.