system-design

Client–Server Architecture: Complete Guide for System Design Interviews

Client - Server Architecture is one of the most fundamental concepts in System Design and backend development. Almost every application you use today - websites, mobile apps, banking applications, e-commerce platforms, and social media applications - uses the basic idea of a client communicating with one or more servers.

Key concepts
Client-Server ArchitectureSystem DesignSystem Design InterviewBackend ArchitectureSoftware ArchitectureRequest ResponseStateless ServerStateful ServerTwo Tier ArchitectureThree Tier Architecture
Fundamentals

What Is Client-Server Architecture?

Client-server architecture is a software architecture in which a client sends a request to a server, and the server processes it and returns a response.

In Simple Terms

Client asks → Server processes → Server responds → Client displays.

Core Principle

The client requests. The server processes and responds.

The CLIENT handles interaction and presentation; the SERVER handles business logic, processing, and shared resources.

Visual Overview
How client-server architecture works
Client-server architecture showing the request and response flow

Real-world systems may include multiple clients, servers, load balancers, databases, and caching layers.

Fundamentals

Basic Client Server Architecture

Basic client server architecture showing a client sending requests to a server and receiving responses
This simple request-response cycle is the foundation of many modern applications.
Fundamentals

What Is a Client?

CORE CONCEPT
Definition

CLIENT is an application or device that initiates communication with a server by sending a request.

Common Examples

Examples of Clients

Clients come in many forms. Here are some common examples you interact with every day.

Web browser

Web Browsers

Browsers such as Chrome, Firefox, Safari, and Edge send requests to websites and display the responses.

Mobile application

Mobile Applications

Mobile apps communicate with backend servers to fetch data and perform actions.

Desktop application

Desktop Applications

Desktop applications can communicate with remote servers to access services and data.

Command line terminal

Command-Line Applications

Tools such as cURL can send requests to remote servers directly from the command line.

API client

API Clients

Tools such as Postman can send API requests and help developers interact with backend services.

Smart device

Smart Devices

Smart TVs, watches, speakers, and IoT devices communicate with servers over a network.

Key Point

All of these clients follow the same fundamental pattern - they send a request to a server and receive a response.

Client-server architecture diagram showing a client sending a request to a server and receiving a response
A simple client-server flow showing - How a client sends a request and receives a response from the server.

Typical Client Responsibilities

01

Display the user interface.

02

Collect user input.

03

Validate simple input for user experience.

04

Create requests.

05

Send requests to the server.

06

Receive responses.

07

Render the returned data.

08

Maintain temporary UI state.

Fundamentals

What Is a Server?

CORE CONCEPT
Definition

SERVER is a computer or software system that receives requests from clients, processes them, and returns responses.

A server can be :

01

A process

02

A service

03

A container

04

A virtual machine

05

An application running on a physical machine

For example : How a Server Processes a Profile Request ?

Client-server architecture diagram showing a client sending a request to a server and receiving a response

In simple terms

Request → Server → Validate → Process → Generate Response

Key distinction

CLIENT and SERVER are roles in communication. A PROGRAM can act as a server in one relationship and as a client in another.
Fundamentals

Why Do We Need a Server?

CORE CONCEPT
Definition

SERVER is useful when an application needs shared data, centralized business rules, authentication, authorization, or controlled access to resources.

Why not put everything in the client?

Because the client runs in an environment that the application does not fully control. The server can enforce rules consistently for every client.

Reason

What the Server Does

Question

Store data
Provides access to shared application dataWhere should application data live?
Security
Protects sensitive operations and dataHow do we protect sensitive operations?
Authentication
Verifies the user's identityWho is this user?
Authorization
Controls what the user can accessWhat is the user allowed to do?
Business logic
Applies application rulesWhere should business rules be enforced?
Shared backend
Serves multiple clientsHow can multiple clients use the same application?
Heavy processing
Handles resource-intensive operationsWhere should heavy processing happen?
Consistency
Coordinates changes to shared dataHow do we keep shared data consistent?

Key Takeaway

The client is responsible mainly for the user-facing experience, while the server provides a trusted place for shared data, business logic, security, and processing.
Fundamentals

Client-Server Architecture in Real Life

Restaurant analogy for client-server architecture

Mapping the analogy to software

Restaurant

Software

CustomerClient
Waiter

Communication layer

KitchenServer
OrderRequest
FoodResponse

You don't normally walk into the kitchen and prepare the food yourself.

Similarly, in a typical application, the client doesn't directly perform all backend processing.

The client asks the server to perform an operation.

Basic client-server architecture showing clients sending requests to a server and receiving responses
A basic client-server flow: clients send requests, the server processes them, and responses are returned.

This cycle can happen thousands or millions of times in a large application.

For example:

❖ GET /products
 ❖ POST /login
 ❖ GET /profile
 ❖ POST /orders
 ❖ DELETE /cart/123

Each request asks the server to perform a particular operation.

Fundamentals

What Is a Request & Response?

REQUEST
Request

REQUEST is a message sent by a client asking a server to provide a resource or perform an operation.

RESPONSE
Response

RESPONSE is a message returned by the server after processing a client request.

Request
Client → Server
GET /users/42
Authorization: Bearer token
Accept: application/json
Response
Server → Client
200 OK
{
"id": 42,
"name": "Aastha",
"email": "aastha@example.com"
}

In simple terms:

Client sends a request → Server processes it → Server sends a response.
For HTTP-based applications, a request can contain:

Component

Purpose

Method
Describes the intended operation
URL / Path
Identifies the target resource
Headers
Provides additional metadata
Query parameters
Provides filtering or input values
Body
Carries data to the server
Common HTTP Methods

Method

Typical purpose

GET
Retrieve data
POST
Create or trigger an operation
PUT
Replace a resource
PATCH
Partially update a resource
DELETE
Remove a resource
HTTP Status Code Categories

Code

Meaning

2xx
Success - The request was successfully received, understood, and processed.
3xx
Redirection - The client needs to take additional action, often by following a different URL.
4xx
Client Error - Something is wrong with the request sent by the client.
5xx
Server Error - The server failed to process a valid request.
Revision

Client vs Server

Understanding the boundary between client and server is an important system design interview topic.

⇄
Architecture
Client vs Server Responsibilities
ResponsibilityClientServer
User interface✓—
User interaction✓—
Request creation✓—
Response rendering✓—
Authentication enforcement—✓
Authorization enforcement—✓
Server-side validation—✓
Business rulesLimited✓
Persistent data access—✓
Security-sensitive operations—✓
Interview Prep

Interview Questions

Answer
Client–server architecture is a distributed computing model in which a client requests a resource or service from a server, and the server processes that request and returns a response. The client initiates communication, while the server listens for requests and provides the required functionality. A typical flow is: client sends a request → server processes it → server returns a response.
Example
For example, when a browser requests a user's profile, it sends an HTTP request to an API. The server validates the request, retrieves the relevant data, and returns a response, often in JSON format.
Client–Server Request Flow
Client sending a request to a server and receiving a response
Key Takeaway
The client initiates a request. The server processes it and returns a response.
Watch Out

Common Mistakes

01

A server must be a physical machine

Common Misconception
A server does not necessarily mean a physical computer. A server can run on physical hardware, a virtual machine, a container, or cloud infrastructure.
Key Idea
Server describes a role - a system that provides a service - rather than a specific type of hardware.
02

The client directly accesses the database

Common Misconception
In a typical client-server architecture, the client communicates with the server, and the server handles communication with the database.
Key Idea
Think of the flow as Client → Server → Database.
03

More servers always means better performance

Common Misconception
Adding more servers can help handle additional traffic, but only when the system is designed to distribute requests effectively.
Key Idea
Scaling requires the right architecture, not simply more servers.
04

The client and server must always run on different machines

Common Misconception
A client and server can run on the same machine during development or in certain architectures.
Key Idea
Client and server describe roles, not necessarily separate physical machines.

Resource Info

Quick reference

Estimated read time

12 min

Difficulty

Beginner

Category

system-design