System Design Speed Tricks - How Things Work So Fast
Learn the algorithms, data structures, and infrastructure patterns that make modern systems respond in milliseconds. From client-side validation to global routing, understand why things feel instant.
System Design Speed Tricks - How Things Work So Fast
Learn the algorithms, data structures, and infrastructure patterns that make modern systems respond in milliseconds. From client-side validation to global routing, understand why things feel instant.
You need to check if a user ID exists in a set of 10 million active sessions. A list scan takes seconds, but a different approach answers in microseconds. What is the difference between O(1) and O(n) lookups, and which data structure gives you O(1)?
O(n) means you potentially scan every element (a list). O(1) means constant-time access regardless of size. A **hash table** (hash map, dictionary, set) gives O(1) average lookup by computing an index from the key: ```python # O(n) - scanning a list user_ids = [1, 2, 3, ..., 10_000_000] if target in user_ids: # checks up to 10M items # O(1) - hash set user_ids = {1, 2, 3, ..., 10_000_000} if target in user_ids: # one hash computation ``` This single distinction underpins nearly every speed trick in system design.
More flashcard decks
API Design
Designing Rate Limiting for APIs
Token bucket, leaky bucket, fixed and sliding window algorithms, plus the patterns for building rate limiters that work in distributed systems without falling over.
20 minutes
GitOps
ArgoCD Fundamentals
Master GitOps principles and ArgoCD essentials including app deployment, sync policies, multi-cluster management, and security best practices.
20 minutes
Serverless
AWS Lambda Cold Start Optimization
How cold starts actually work in AWS Lambda and the techniques that cut them down: runtime and memory choices, code and package tuning, provisioned concurrency, and SnapStart.
18 minutes
Also worth your time on this topic
Back-of-the-Envelope Estimation Quiz
The napkin-math skill that makes or breaks a system design interview: turning users into QPS, data into storage, traffic into bandwidth, and knowing the latency numbers every engineer should have memorised.
16-22 minutes
DNS Resolution When You Type a URL
Walk me through what happens when you type a URL and press Enter, focusing specifically on the DNS resolution process.
junior
Complete Web Server Automation with Ansible
Build a comprehensive Ansible playbook to automate web server deployment, configuration, and security hardening across multiple environments.
75 minutes