Explain ETag vs Last-Modified.

ETag and Last-Modified are HTTP cache validators: ETag is a unique identifier for a resource’s version, while Last-Modified indicates the timestamp of its most recent update.

When to Use

Use ETag when content changes frequently or with high precision (e.g., dynamic APIs). Use Last-Modified for static files where second-level accuracy is sufficient.

Example

A chat app serving fast-changing messages should use ETags, while a static blog image can rely on Last-Modified headers.

Want to strengthen your interview prep? Explore Grokking JavaScript Fundamentals, Grokking the System Design Interview, or practice with Mock Interviews with ex-FAANG engineers to get real-world guidance.

Why Is It Important

Validators prevent unnecessary data transfers by letting servers respond with 304 Not Modified, saving bandwidth and improving response times.

Interview Tips

Define both clearly: ETag = content version ID, Last-Modified = timestamp. Mention granularity differences and illustrate with a short example (dynamic API vs static file). This demonstrates both technical and practical understanding.

Trade-offs

ETag: Highly accurate but requires server computation and consistency across clusters. Last-Modified: Lightweight but limited to 1-second resolution and may refresh unnecessarily if timestamps change without actual content updates.

Pitfalls

Misconfigured ETags in distributed systems can break caching if different servers generate different tags. Last-Modified may give false positives when file metadata changes but the content remains the same.

TAGS
System Design Interview
System Design Fundamentals
CONTRIBUTOR
Design Gurus Team
-

GET YOUR FREE

Coding Questions Catalog

Design Gurus Newsletter - Latest from our Blog
Boost your coding skills with our essential coding questions catalog.
Take a step towards a better tech career now!
Explore Answers
Developing consistency in solving medium to hard coding problems
Why do you want to join our company?
How to get selected in Adobe?
What is the job of Snowflake developer?
Best Coding Pattern Resources to Pair With System Design Preparation
Master essential coding patterns like Sliding Window, DFS, and Greedy Algorithms with the best resources. Pair them with system design prep to ace your interviews!
What are the strategies for debugging code under pressure?
Related Courses
Course image
Grokking the Coding Interview: Patterns for Coding Questions
Grokking the Coding Interview Patterns in Java, Python, JS, C++, C#, and Go. The most comprehensive course with 476 Lessons.
4.6
Discounted price for Your Region

$197

Course image
Grokking Modern AI Fundamentals
Master the fundamentals of AI today to lead the tech revolution of tomorrow.
3.9
Discounted price for Your Region

$78

Course image
Grokking Data Structures & Algorithms for Coding Interviews
Unlock Coding Interview Success: Dive Deep into Data Structures and Algorithms.
4
Discounted price for Your Region

$78

Image
One-Stop Portal For Tech Interviews.
Copyright © 2026 Design Gurus, LLC. All rights reserved.