---
title: "What is Latency in Software?"  
description: "What is Latency in Software?"  
author: "Anubhav Sharma"  
published: 2026-01-13  
updated: 2026-01-13  
canonical: https://www.mindstick.com/interview/34441/what-is-latency-in-software  
category: "software development"  
tags: ["developer"]  
reading_time: 5 minutes  

---

# What is Latency in Software?

**Latency** in software refers to the **time delay** between a **request** being made and the **response** being received.

In simple terms:

> ## Latency = How long you wait before something starts happening

##

## Interview One-Liner

> **Latency is the delay between sending a request and receiving a response in a software system.**

## Simple Example

You click a **button**

- The app responds **after 300 ms**
- That **300 ms is latency**

## Formal Definition

> **Latency is the total time taken for data to travel from source to destination and back, including processing delays.**

## Types of Latency in Software

### 1. Network Latency

Time taken for data to travel over the network.

## Causes:

- Physical distance
- Number of hops (routers)
- Congestion
- DNS lookup time

## Example:

API call taking 120 ms due to network delay

### 2. Application Latency

Time spent inside the application.

## Causes:

- Slow business logic
- Blocking threads
- Poor algorithms

## Example:

Heavy loop or synchronous I/O

### 3. Database Latency

Time taken to execute DB queries.

## Causes:

- Missing indexes
- Locking
- Slow joins

## Example:

SQL query taking 500 ms

### 4. Disk / I/O Latency

Time to read/write from disk.

## Causes:

- HDD vs SSD
- File system overhead

## Example:

File read delay

### 5. Rendering / UI Latency

Time from data arrival to UI update.

## Example:

- Slow DOM rendering
- Heavy UI frameworks

## Latency vs Throughput (Important Difference)

| Metric | Latency | Throughput |
| --- | --- | --- |
| Meaning | Delay per request | Requests per second |
| Unit | ms, μs | req/sec |
| Focus | Speed of response | Volume of work |

> ## Low latency ≠ high throughput

## Real-World Analogy

- **Latency** → Time taken for a car to reach destination
- **Throughput** → Number of cars passing per hour

## Why Latency Matters

- User experience (anything > 100ms feels slow)
- Real-time systems (chat, trading)
- Distributed systems
- APIs and microservices

## Acceptable Latency (Rule of Thumb)

| Latency | User Perception |
| --- | --- |
| < 100 ms | Instant |
| 100–300 ms | Slight delay |
| 300–1000 ms | Noticeable |
| > 1 sec | Slow |
| > 3 sec | Unusable |

## How to Reduce Latency

### Network

- [Use CDN](https://www.mindstick.com/blog/305904/how-to-use-a-cdn-content-delivery-network-to-improve-site-speed)
- Reduce round trips
- Keep connections alive

### Application

- [Async / non-blocking code](https://www.mindstick.com/interview/34235/what-is-the-async-and-await-pattern-in-c-sharp-when-should-you-use-it)
- [Caching](https://www.mindstick.com/forum/161233/what-is-caching-and-why-is-it-used)
- Efficient algorithms

### Database

- [Indexing](https://www.mindstick.com/blog/303489/the-significance-of-indexing-in-databases-for-seo)
- Query optimization
- Read replicas

## Latency in Real-Time Systems

- **WebSocket / SSE** → designed for low latency
- **REST APIs** → higher latency per request
- **Polling** → high latency & wasteful

##

## Answers

### Answer by Anubhav Sharma

**Latency** in software refers to the **time delay** between a **request** being made and the **response** being received.

In simple terms:

> ## Latency = How long you wait before something starts happening

##

## Interview One-Liner

> **Latency is the delay between sending a request and receiving a response in a software system.**

## Simple Example

You click a **button**

- The app responds **after 300 ms**
- That **300 ms is latency**

## Formal Definition

> **Latency is the total time taken for data to travel from source to destination and back, including processing delays.**

## Types of Latency in Software

### 1. Network Latency

Time taken for data to travel over the network.

## Causes:

- Physical distance
- Number of hops (routers)
- Congestion
- DNS lookup time

## Example:

API call taking 120 ms due to network delay

### 2. Application Latency

Time spent inside the application.

## Causes:

- Slow business logic
- Blocking threads
- Poor algorithms

## Example:

Heavy loop or synchronous I/O

### 3. Database Latency

Time taken to execute DB queries.

## Causes:

- Missing indexes
- Locking
- Slow joins

## Example:

SQL query taking 500 ms

### 4. Disk / I/O Latency

Time to read/write from disk.

## Causes:

- HDD vs SSD
- File system overhead

## Example:

File read delay

### 5. Rendering / UI Latency

Time from data arrival to UI update.

## Example:

- Slow DOM rendering
- Heavy UI frameworks

## Latency vs Throughput (Important Difference)

| Metric | Latency | Throughput |
| --- | --- | --- |
| Meaning | Delay per request | Requests per second |
| Unit | ms, μs | req/sec |
| Focus | Speed of response | Volume of work |

> ## Low latency ≠ high throughput

## Real-World Analogy

- **Latency** → Time taken for a car to reach destination
- **Throughput** → Number of cars passing per hour

## Why Latency Matters

- User experience (anything > 100ms feels slow)
- Real-time systems (chat, trading)
- Distributed systems
- APIs and microservices

## Acceptable Latency (Rule of Thumb)

| Latency | User Perception |
| --- | --- |
| < 100 ms | Instant |
| 100–300 ms | Slight delay |
| 300–1000 ms | Noticeable |
| > 1 sec | Slow |
| > 3 sec | Unusable |

## How to Reduce Latency

### Network

- [Use CDN](https://www.mindstick.com/blog/305904/how-to-use-a-cdn-content-delivery-network-to-improve-site-speed)
- Reduce round trips
- Keep connections alive

### Application

- [Async / non-blocking code](https://www.mindstick.com/interview/34235/what-is-the-async-and-await-pattern-in-c-sharp-when-should-you-use-it)
- [Caching](https://www.mindstick.com/forum/161233/what-is-caching-and-why-is-it-used)
- Efficient algorithms

### Database

- [Indexing](https://www.mindstick.com/blog/303489/the-significance-of-indexing-in-databases-for-seo)
- Query optimization
- Read replicas

## Latency in Real-Time Systems

- **WebSocket / SSE** → designed for low latency
- **REST APIs** → higher latency per request
- **Polling** → high latency & wasteful

##


---

Original Source: https://www.mindstick.com/interview/34441/what-is-latency-in-software

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
