Skip to content

Software Engineering Interview Questions

1503+ curated interview questions covering system design, data structures & algorithms, and core computer science. Each question includes difficulty level, Bloom taxonomy level, and answer options.

Grouped by 64 high-demand topics

Practice All Questions Free →

Arrays & Strings

Data Structures 34 questions

What is the time complexity of accessing an element by index in an array?

Easy · Remember · Multiple Choice

Which operation has O(n) worst-case time when performed at the beginning of an array?

Easy · Remember · Multiple Choice

What is the space complexity of a prefix sum array for n elements?

Easy · Remember · Multiple Choice

What does nums.slice(1,3) return for nums = [10,20,30,40,50]?

Easy · Remember · Multiple Choice

Output of [1,2,3].map(x=>x*2).filter(x=>x>2) in JavaScript?

Easy · Remember · Multiple Choice

In a variable sliding window, what triggers moving the left pointer inward?

Medium-Easy · Understand · Multiple Choice

What is the time complexity of the sliding window solution to Longest Substring Without Repeating Characters?

Medium-Easy · Understand · Multiple Choice

Given nums = [-2,1,-3,4,-1,2,1,-5,4], what does Kadane's algorithm return?

Medium-Easy · Apply · Multiple Choice

Implement two-sum for an unsorted array returning indices. One solution guaranteed.

Medium-Easy · Apply · open_ended

What is the amortized time complexity of Array.push() in JavaScript?

Medium-Easy · Understand · Multiple Choice

Why is string concatenation in a loop O(n²) in JavaScript?

Medium-Easy · Understand · open_ended

What does Product of Array Except Self return for [1,2,3,4]?

Medium-Easy · Apply · Multiple Choice

What overlap condition must be true for intervals [a,b] and [c,d] (a<=c) to overlap?

Medium-Easy · Apply · Multiple Choice

After fixing nums[i] in 3Sum, what is the two-pointer time complexity for finding all pairs?

Medium-Easy · Understand · Multiple Choice

Time complexity of searching in an n×m matrix where rows and columns are sorted (LC 240)?

Medium-Easy · Understand · Multiple Choice

Why must you sort by start time before merging intervals?

Medium-Easy · Understand · open_ended

Time complexity of Group Anagrams (LC 49) using sorted string as hash key?

Medium-Easy · Understand · Multiple Choice

Worst-case time complexity of naive string search?

Medium-Easy · Remember · Multiple Choice

Time complexity of finding longest common prefix among n strings each of length ≤m?

Medium-Easy · Understand · Multiple Choice

What is the optimal time complexity for solving the 'Arrays & Strings' classic problem?

Medium-Easy · Understand · Multiple Choice

Explain why initializing the prefix-sum map with {0:1} is necessary for 'Subarray Sum Equals K'.

Medium · Understand · open_ended

After finding a valid window in Minimum Window Substring, why advance the left pointer?

Medium · Analyze · open_ended

Describe the two-step in-place algorithm to rotate a matrix 90 degrees clockwise.

Medium · Apply · open_ended

What distinguishes the Maximum Product Subarray trick from Kadane's?

Medium · Analyze · open_ended

Which greedy choice minimizes intervals removed to make the rest non-overlapping (LC 435)?

Medium · Evaluate · Multiple Choice

How does length-prefix encoding in LC 271 handle strings containing the separator character?

Medium · Apply · open_ended

What is the key insight enabling O(n) O(1)-space two-pointer solution to Trapping Rain Water?

Medium-Hard · Analyze · open_ended

Describe Boyer-Moore Majority Vote algorithm.

Medium-Hard · Analyze · open_ended

In Longest Repeating Character Replacement (LC 424), why keep maxFreq non-decreasing even when window shrinks?

Medium-Hard · Evaluate · open_ended

Greedy approach for Jump Game II (LC 45) — minimum jumps to reach end?

Medium-Hard · Apply · open_ended

How to find subarrays with sum divisible by k using prefix sums (LC 523)?

Medium-Hard · Analyze · open_ended

When would you choose a different approach for Arrays & Strings problems?

Medium-Hard · Analyze · open_ended

How does Z-algorithm help in string pattern matching?

Hard · Evaluate · open_ended

Design an optimal solution for a real-world application of Arrays & Strings.

Hard · Create · open_ended

Dynamic Programming

Algorithms 32 questions

What two properties must a problem have to be solvable with dynamic programming?

Easy · Remember · Multiple Choice

What is the time complexity of Longest Common Subsequence for strings of length m and n?

Easy · Remember · Multiple Choice

What is the recurrence relation for Coin Change (minimum coins) DP?

Medium-Easy · Remember · open_ended

Explain the difference between memoization (top-down) and tabulation (bottom-up) DP.

Medium-Easy · Understand · open_ended

What is dp[i][j] in the Edit Distance recurrence?

Medium-Easy · Understand · open_ended

What is the base case for Edit Distance when one string is empty?

Medium-Easy · Apply · Multiple Choice

What does dp[i] represent in Word Break (LC 139)?

Medium-Easy · Apply · open_ended

What is Unique Paths (LC 62) — how many paths from top-left to bottom-right in m×n grid?

Medium-Easy · Apply · Multiple Choice

What is the time complexity of Word Break (LC 139) with the DP approach?

Medium-Easy · Understand · Multiple Choice

Why does the naive recursive Fibonacci have O(2^n) time complexity?

Medium-Easy · Understand · open_ended

What is the minimum number of coins needed to make amount=11 with coins=[1,5,6]?

Medium-Easy · Apply · Multiple Choice

What is the optimal substructure property and give an example.

Medium-Easy · Understand · open_ended

What is the optimal time complexity for solving the 'Dynamic Programming' classic problem?

Medium-Easy · Understand · Multiple Choice

House Robber circular (LC 213): why do two linear passes work?

Medium · Understand · open_ended

In 0/1 Knapsack with space optimization, why must you iterate weight in DESCENDING order?

Medium · Understand · open_ended

Coin Change II (LC 518) counts combinations, not permutations. How does loop order enforce this?

Medium · Analyze · open_ended

In the stock problem state machine (LC 309 with cooldown), what are the three states?

Medium · Apply · open_ended

Time complexity of Burst Balloons (LC 312)?

Medium · Understand · Multiple Choice

How does Delete and Earn (LC 740) reduce to the House Robber problem?

Medium · Apply · open_ended

Why is Decode Ways (LC 91) a DP problem and what are the two choices at each digit?

Medium · Apply · open_ended

Partition Equal Subset Sum (LC 416): what DP state do you use?

Medium · Apply · open_ended

What is the space-optimized form of LCS that uses O(n) space?

Medium · Apply · open_ended

How does the sliding window (rolling array) optimization reduce Edit Distance space from O(m*n) to O(n)?

Medium · Understand · open_ended

Palindromic Substrings (LC 647): what is the DP approach and what does dp[i][j] represent?

Medium · Apply · open_ended

What is 'interval DP' and when do you use it?

Medium · Understand · open_ended

What is the state for Burst Balloons (LC 312) interval DP?

Medium-Hard · Analyze · open_ended

What is the O(n log n) algorithm for Longest Increasing Subsequence?

Medium-Hard · Apply · open_ended

In Longest Increasing Subsequence O(n log n), what does tails[i] represent?

Medium-Hard · Analyze · open_ended

Target Sum (LC 494): how does it transform into subset sum with count?

Medium-Hard · Analyze · open_ended

In the stock problem Best Time to Buy and Sell Stock III (LC 123), what is the state?

Medium-Hard · Analyze · open_ended

When would you choose a different approach for Dynamic Programming problems?

Medium-Hard · Analyze · open_ended

Design an optimal solution for a real-world application of Dynamic Programming.

Hard · Create · open_ended

Trees & BST

Data Structures 33 questions

What does inorder traversal of a BST produce?

Easy · Remember · Multiple Choice

What is the time complexity of search in a balanced BST?

Easy · Remember · Multiple Choice

What does the right side view of a binary tree (LC 199) return?

Easy · Remember · Multiple Choice

Why does comparing a node only to its direct parent fail when validating a BST?

Medium-Easy · Understand · open_ended

In Lowest Common Ancestor of a Binary Tree (LC 236), when does the algorithm return the current root?

Medium-Easy · Understand · Multiple Choice

What is the time complexity of the O(n) balanced-tree check (LC 110) that returns -1 for unbalanced?

Medium-Easy · Understand · Multiple Choice

Implement maxDepth of a binary tree recursively.

Medium-Easy · Apply · open_ended

What is the difference between tree height and tree depth?

Medium-Easy · Understand · open_ended

What is the inorder successor of a node in a BST?

Medium-Easy · Remember · Multiple Choice

Time complexity of constructing a BST from a sorted array?

Medium-Easy · Understand · Multiple Choice

Why is iterative inorder traversal useful even though recursive is simpler?

Medium-Easy · Understand · open_ended

Explain how to check if a binary tree is symmetric (LC 101).

Medium-Easy · Apply · open_ended

What is the time complexity of LCA in a BST vs a general binary tree?

Medium-Easy · Understand · Multiple Choice

What is the time and space complexity of level-order traversal?

Medium-Easy · Understand · Multiple Choice

What is the space complexity of recursive DFS on a balanced binary tree?

Medium-Easy · Understand · Multiple Choice

What property makes AVL trees different from regular BSTs?

Medium-Easy · Remember · Multiple Choice

What is the difference between a complete binary tree and a perfect binary tree?

Medium-Easy · Understand · open_ended

Solve Range Sum of BST (LC 938): count sum of values in range [low, high].

Medium-Easy · Apply · open_ended

What is the time complexity of finding the kth smallest element in a BST?

Medium-Easy · Understand · Multiple Choice

What is the optimal time complexity for solving the 'Trees & BST' classic problem?

Medium-Easy · Understand · Multiple Choice

What are the three cases in BST node deletion?

Medium · Apply · open_ended

How do you serialize a binary tree to uniquely reconstruct it?

Medium · Apply · open_ended

How does the Diameter of Binary Tree (LC 543) differ from max depth?

Medium · Analyze · open_ended

Construct Binary Tree from Preorder and Inorder (LC 105): how do you find the left subtree size?

Medium · Apply · open_ended

What is the time complexity of BST Iterator (LC 173) nextSmallest() and hasNext() operations?

Medium · Understand · Multiple Choice

In Binary Tree Maximum Path Sum (LC 124), what does the 'gain' function return vs what it records?

Medium-Hard · Analyze · open_ended

In Populating Next Right Pointers (LC 116), how do you connect nodes across different parent subtrees without extra space?

Medium-Hard · Apply · open_ended

What is the key insight for Flatten Binary Tree to Linked List (LC 114) in O(1) space?

Medium-Hard · Apply · open_ended

For Binary Tree Cameras (LC 968), what do the three states of each node represent?

Medium-Hard · Analyze · open_ended

How many unique BSTs can be formed with n distinct keys?

Medium-Hard · Analyze · open_ended

When would you choose a different approach for Trees & BST problems?

Medium-Hard · Analyze · open_ended

What is Morris traversal and what makes it special?

Hard · Evaluate · open_ended

Design an optimal solution for a real-world application of Trees & BST.

Hard · Create · open_ended

Graphs

Algorithms 33 questions

What is the time complexity of BFS on a graph with V vertices and E edges?

Easy · Remember · Multiple Choice

What is the difference between a directed and undirected graph?

Easy · Remember · open_ended

What property of a graph must hold for topological sort to be possible?

Easy · Remember · Multiple Choice

What is the in-degree of a node in a directed graph?

Easy · Remember · Multiple Choice

What does an empty result from Kahn's topological sort indicate?

Medium-Easy · Understand · Multiple Choice

Time complexity of Dijkstra's algorithm with a binary min-heap?

Medium-Easy · Remember · Multiple Choice

Implement BFS to find shortest path length between source and destination in an unweighted graph.

Medium-Easy · Apply · open_ended

How does multi-source BFS differ from single-source BFS?

Medium-Easy · Understand · open_ended

Number of Islands (LC 200): what is the time and space complexity of the BFS approach?

Medium-Easy · Understand · Multiple Choice

Why must BFS (not DFS) be used to guarantee shortest path in unweighted graphs?

Medium-Easy · Understand · open_ended

What makes a graph bipartite?

Medium-Easy · Understand · open_ended

What is the time complexity of Floyd-Warshall all-pairs shortest path?

Medium-Easy · Remember · Multiple Choice

What is the space complexity of storing a graph as an adjacency matrix vs adjacency list?

Medium-Easy · Understand · Multiple Choice

How do you generate all 8 neighboring cells for a position (r,c) in a grid?

Medium-Easy · Apply · open_ended

What is the time complexity of topological sort using Kahn's algorithm?

Medium-Easy · Remember · Multiple Choice

Why is the adjacency list preferred over adjacency matrix for most interview problems?

Medium-Easy · Evaluate · open_ended

What is the optimal time complexity for solving the 'Graphs' classic problem?

Medium-Easy · Understand · Multiple Choice

Why does Dijkstra's algorithm fail with negative edge weights?

Medium · Understand · open_ended

What optimizations make Union-Find nearly O(1) per operation?

Medium · Understand · open_ended

In cycle detection for a directed graph using DFS, what do the three colors (0,1,2) represent?

Medium · Understand · open_ended

Explain how to detect a redundant connection in an undirected graph using Union-Find.

Medium · Apply · open_ended

Clone Graph (LC 133): why use a visited map from original node to cloned node?

Medium · Apply · open_ended

What is the key difference between using DFS vs Union-Find for connected components?

Medium · Evaluate · open_ended

How does the 'stale entry' check work in Dijkstra's priority queue implementation?

Medium · Understand · open_ended

What is a strongly connected component (SCC) in a directed graph?

Medium · Remember · open_ended

What does path compression do to the amortized complexity of Union-Find?

Medium · Understand · Multiple Choice

Minimum Cost to Connect All Points (LC 1584): which algorithm and why?

Medium · Apply · open_ended

What is the Alien Dictionary (LC 269) approach?

Medium-Hard · Apply · open_ended

Describe how to find all eventually safe nodes (LC 802) using topological sort.

Medium-Hard · Analyze · open_ended

Cheapest Flights Within K Stops (LC 787): why NOT use standard Dijkstra?

Medium-Hard · Evaluate · open_ended

Accounts Merge (LC 721): how do you apply Union-Find to emails?

Medium-Hard · Apply · open_ended

When would you choose a different approach for Graphs problems?

Medium-Hard · Analyze · open_ended

Design an optimal solution for a real-world application of Graphs.

Hard · Create · open_ended

Linked Lists

Data Structures 33 questions

Time complexity of accessing the kth element of a singly linked list?

Easy · Remember · Multiple Choice

Time complexity of reversing a singly linked list?

Easy · Remember · Multiple Choice

Output of reversing [1,2,3,4,5]?

Easy · Apply · Multiple Choice

Time complexity of inserting a node immediately AFTER a given node (pointer already in hand)?

Easy · Remember · Multiple Choice

Space complexity of Floyd's cycle detection?

Easy · Remember · Multiple Choice

Why is a dummy head node useful when manipulating linked lists?

Medium-Easy · Understand · open_ended

In Floyd's cycle detection, if slow moves 1 step and fast moves 2 steps, what does their meeting guarantee?

Medium-Easy · Understand · Multiple Choice

What three pointer variables are needed for iterative linked list reversal?

Medium-Easy · Remember · Multiple Choice

Implement iterative linked list reversal.

Medium-Easy · Apply · open_ended

What does dummy.next return after Merge Two Sorted Lists?

Medium-Easy · Apply · Multiple Choice

Why does LRU Cache require a doubly linked list rather than singly?

Medium-Easy · Understand · open_ended

Both naive (two-pass) and slow/fast (one-pass) approaches to find list middle are O(n). What is the practical advantage of slow/fast?

Medium-Easy · Understand · Multiple Choice

Time and space complexity of Odd Even Linked List (LC 328)?

Medium-Easy · Understand · Multiple Choice

Why must you save next=cur.next BEFORE setting cur.next=prev in iterative reversal?

Medium-Easy · Understand · open_ended

Time complexity of deleting tail node in a singly linked list without a tail pointer?

Medium-Easy · Remember · Multiple Choice

What distinguishes sentinel nodes from regular nodes in a doubly linked list?

Medium-Easy · Understand · open_ended

Correct order of three operations in Reorder List (LC 143)?

Medium-Easy · Apply · Multiple Choice

Time complexity of finding kth node from END of singly linked list in one pass?

Medium-Easy · Understand · Multiple Choice

What is the optimal time complexity for solving the 'Linked Lists' classic problem?

Medium-Easy · Understand · Multiple Choice

Time and space complexity of merging K sorted linked lists using a min-heap?

Medium · Understand · Multiple Choice

Space complexity of top-down recursive merge sort on a linked list?

Medium · Understand · Multiple Choice

How does the two-pointer technique find intersection of two linked lists (LC 160)?

Medium · Analyze · open_ended

In Reverse Nodes in k-Group (LC 25), how do you verify k nodes remain before reversing?

Medium · Apply · open_ended

How to solve Add Two Numbers II (LC 445) without modifying input lists?

Medium · Apply · open_ended

Why is merge sort preferred over quicksort for linked lists?

Medium · Evaluate · open_ended

How does recursive reversal of a linked list work?

Medium · Understand · open_ended

What happens during a cache HIT in LRU Cache (LC 146)?

Medium · Apply · open_ended

What does Rotate List (LC 61) do and what is the efficient approach?

Medium · Apply · open_ended

After detecting a cycle (slow and fast have met), why reset slow to head and advance both by 1 to find cycle entry?

Medium-Hard · Analyze · open_ended

What is the interleaving approach to Copy List with Random Pointer (LC 138)?

Medium-Hard · Apply · open_ended

Describe approach to Flatten a Multilevel Doubly Linked List (LC 430).

Medium-Hard · Apply · open_ended

When would you choose a different approach for Linked Lists problems?

Medium-Hard · Analyze · open_ended

Design an optimal solution for a real-world application of Linked Lists.

Hard · Create · open_ended

System Design Interview Framework

System Design 20 questions

What does RADIO stand for in the system design interview framework?

Easy · Remember · Multiple Choice

In a 45-minute system design interview, how many minutes should you spend on the Infrastructure (architecture diagram) phase?

Easy · Remember · Multiple Choice

Which of the following is a NON-functional requirement?

Medium-Easy · Understand · Multiple Choice

What HTTP status code should a URL shortener return when redirecting a user from the short URL to the original URL?

Medium-Easy · Apply · Multiple Choice

What is the correct REST URL for retrieving all tweets posted by a specific user?

Medium-Easy · Apply · Multiple Choice

What is the polyglot persistence pattern?

Medium-Easy · Understand · Multiple Choice

Why should you always announce phase transitions during a system design interview?

Medium-Easy · Understand · Multiple Choice

You need to store 500 billion social graph edges with sub-millisecond multi-hop traversal queries. Which database do you choose?

Medium · Evaluate · Multiple Choice

What pagination type should you use for an infinite-scroll social feed and why?

Medium · Evaluate · Multiple Choice

A database primary server goes down. What is the standard recovery sequence?

Medium · Apply · Multiple Choice

What is the circuit breaker pattern used for?

Medium · Understand · Multiple Choice

When should you use gRPC instead of REST for service-to-service communication?

Medium · Evaluate · Multiple Choice

How do you handle a client submitting the same write request twice due to a network retry?

Medium · Apply · Multiple Choice

Which phase of RADIO is most commonly run short by candidates, and why does this hurt their score?

Medium · Analyze · Multiple Choice

Why is it better to use cursor-based pagination than offset pagination for a social media timeline?

Medium · Evaluate · Multiple Choice

What is the correct order of concern when selecting a database in a system design interview?

Medium · Apply · Multiple Choice

A system has 100K read QPS and 5K write QPS on a single PostgreSQL instance. Which scaling action addresses the bottleneck?

Medium-Hard · Analyze · Multiple Choice

What is the trade-off introduced by sharding a database by user_id?

Medium-Hard · Evaluate · Multiple Choice

A ride-sharing app needs to find all available drivers within 5 km of a rider's location in under 10ms. What is the most appropriate technology?

Medium-Hard · Evaluate · Multiple Choice

What is the Saga pattern used for in microservices?

Medium-Hard · Understand · Multiple Choice

Load Balancing

System Design 20 questions

What does a load balancer primarily do?

Easy · Remember · Multiple Choice

Which load balancing algorithm always routes the same client IP to the same server?

Easy · Remember · Multiple Choice

L7 load balancers can route based on HTTP headers and URL paths.

Easy · Remember · true_false

AWS ALB (Application Load Balancer) operates at which OSI layer?

Medium-Easy · Understand · Multiple Choice

Explain the difference between active and passive health checks in load balancing.

Medium-Easy · Understand · open_ended

A server has 100 active connections and another has 5. Which algorithm would route the next request to the less loaded server?

Medium-Easy · Understand · Multiple Choice

True or False: AWS ALB supports routing to Lambda functions as targets.

Medium-Easy · Remember · true_false

You have 3 servers: Server A (4 CPU), Server B (8 CPU), Server C (16 CPU). Which LB algorithm and weights would you configure?

Medium · Apply · open_ended

Configure an Nginx upstream block that implements least-connections load balancing with server2 marked as backup.

Medium · Apply · open_ended

Why does IP hash load balancing create problems when servers are behind NAT?

Medium · Apply · open_ended

What is connection draining (deregistration delay) and why is it critical for deployments?

Medium · Understand · open_ended

Compare the trade-offs between sticky sessions via IP hash vs cookie-based sticky sessions.

Medium-Hard · Analyze · open_ended

Your service has 4 backend servers. Server 1 goes down. With modulo hashing (client_id % 4), how many clients are remapped? With consistent hashing?

Medium-Hard · Analyze · open_ended

Analyze why least-connections is better than round-robin for long-polling API endpoints.

Medium-Hard · Analyze · open_ended

A load balancer with round-robin sends requests to 3 servers. Server 2 is slow (1000ms response) while servers 1 and 3 respond in 10ms. What happens to overall throughput?

Medium-Hard · Analyze · open_ended

Explain the 'power of two choices' load balancing strategy and why it outperforms random selection.

Medium-Hard · Analyze · open_ended

Design a highly available load balancer setup that eliminates the LB itself as a single point of failure.

Hard · Evaluate · open_ended

Evaluate when you would choose AWS NLB over ALB for a production service.

Hard · Evaluate · open_ended

Design a health check system for a load balancer that minimizes both false positives (removing healthy servers) and false negatives (keeping sick servers).

Hard · Create · open_ended

Design the load balancing architecture for a ride-sharing app like Uber handling 1 million RPS globally.

Hard · Create · open_ended

Caching

System Design 20 questions

Which caching pattern checks the cache first, then the database on miss, then populates the cache?

Easy · Remember · Multiple Choice

Write-through caching always writes to both cache and database simultaneously.

Easy · Remember · true_false

Which Redis data structure is best for implementing a real-time leaderboard?

Medium-Easy · Understand · Multiple Choice

What is a cache stampede?

Medium-Easy · Understand · Multiple Choice

Explain negative caching and when to use it.

Medium-Easy · Understand · open_ended

Your Redis cache has 1GB memory limit. What eviction policy would you choose for a web session store where you want to keep recent sessions?

Medium · Apply · open_ended

Design a cache key naming scheme for a multi-tenant SaaS application.

Medium · Apply · open_ended

How does the Cache-Control header 's-maxage' differ from 'max-age'?

Medium · Apply · open_ended

True or False: Redis is always faster than Memcached for caching.

Medium · Analyze · true_false

What is the write-around caching pattern and when would you use it?

Medium · Apply · Multiple Choice

What is the difference between Redis Sentinel and Redis Cluster?

Medium · Understand · open_ended

What is stale-while-revalidate and how does it improve user experience?

Medium · Understand · open_ended

Compare LRU vs LFU eviction policies. When would LFU outperform LRU?

Medium-Hard · Analyze · open_ended

A popular article on your news site has 100,000 concurrent readers. Its cache entry expires. How do you prevent the cache stampede?

Medium-Hard · Analyze · open_ended

How would you implement cache warming after a Redis server restart?

Medium-Hard · Analyze · open_ended

A cache has 95% hit rate. A new feature doubles the number of cacheable objects. What happens to hit rate and how do you address it?

Medium-Hard · Analyze · open_ended

Design the caching strategy for a social media news feed where users see posts from accounts they follow.

Hard · Evaluate · open_ended

Explain cache coherence problems in a multi-region deployment and how to address them.

Hard · Evaluate · open_ended

How does Facebook's TAO system differ from a simple Redis cache?

Hard · Analyze · open_ended

Design a multi-layer cache for a global video streaming service.

Hard · Create · open_ended

Database Design

System Design 21 questions

What does ACID stand for?

Easy · Remember · Multiple Choice

Which type of index is best for a query with a range condition like WHERE age BETWEEN 20 AND 30?

Medium-Easy · Understand · Multiple Choice

The left-prefix rule for composite indexes means a composite index on (a, b, c) can serve a query filtering only on column b.

Medium-Easy · Understand · true_false

What is denormalization and when is it appropriate?

Medium-Easy · Understand · open_ended

True or False: A foreign key constraint automatically creates an index on the referencing column.

Medium-Easy · Remember · true_false

What is a covering index and how does it improve query performance?

Medium-Easy · Understand · Multiple Choice

How would you model a many-to-many relationship between Products and Tags?

Medium-Easy · Apply · open_ended

Design a database schema for a Twitter-like system. What tables and indexes would you create?

Medium · Apply · open_ended

Explain the N+1 query problem and how to fix it.

Medium · Apply · open_ended

What is an index-only scan and when does it occur?

Medium · Understand · open_ended

What is optimistic locking and when does it fail?

Medium · Apply · open_ended

What is connection pooling and how do you size a connection pool?

Medium · Apply · open_ended

A query using WHERE email = ? is slow despite an index on email. What could cause this?

Medium-Hard · Analyze · open_ended

What is the difference between REPEATABLE READ and SERIALIZABLE isolation levels?

Medium-Hard · Analyze · open_ended

When would you choose Cassandra over PostgreSQL?

Medium-Hard · Analyze · open_ended

How do you handle storing hierarchical/tree data in a relational database?

Medium-Hard · Analyze · open_ended

Design an audit trail system that records all changes to a users table.

Medium-Hard · Create · open_ended

Explain the CAP theorem as it relates to database selection.

Medium-Hard · Analyze · open_ended

A PostgreSQL table has 10 million rows. A query SELECT * FROM orders WHERE status = 'pending' runs a sequential scan despite an index on status. Why?

Medium-Hard · Analyze · open_ended

You need to add a NOT NULL column to a 500-million-row table in production. How do you do it without downtime?

Hard · Evaluate · open_ended

Design a database schema for a multi-tenant SaaS CRM application.

Hard · Create · open_ended

Microservices Architecture

System Design 20 questions

What is Conway's Law?

Easy · Remember · Multiple Choice

Microservices should always share a single database to maintain data consistency.

Easy · Remember · true_false

Which pattern allows migrating from monolith to microservices incrementally without big-bang rewrite?

Medium-Easy · Understand · Multiple Choice

What is a bounded context in Domain-Driven Design?

Medium-Easy · Understand · open_ended

True or False: gRPC is always better than REST for microservice communication.

Medium-Easy · Understand · true_false

Design the service decomposition for a food delivery app like DoorDash.

Medium · Apply · open_ended

What is the bulkhead pattern and how does it relate to microservices resilience?

Medium · Apply · open_ended

Compare client-side vs server-side service discovery.

Medium · Analyze · open_ended

What problems does the microservices pattern introduce that a monolith doesn't have?

Medium · Analyze · open_ended

How does the API Gateway pattern relate to the BFF (Backend for Frontend) pattern?

Medium · Understand · open_ended

What is the primary advantage of Microservices Architecture?

Medium · · Multiple Choice

When should you NOT use Microservices Architecture?

Medium · · Multiple Choice

What is the time complexity of the core operation in Microservices Architecture?

Medium · · Multiple Choice

How does Microservices Architecture handle failures?

Medium · · Multiple Choice

How do you handle data consistency across microservices that own separate databases?

Medium-Hard · Analyze · open_ended

What is the outbox pattern and why is it important?

Medium-Hard · Analyze · open_ended

What is a service mesh and when is it justified?

Medium-Hard · Evaluate · open_ended

How would you implement distributed tracing across 5 microservices?

Medium-Hard · Create · open_ended

Design the microservices communication strategy for a real-time ride-matching service.

Hard · Create · open_ended

Design a microservices architecture that handles Black Friday traffic (100x normal load).

Hard · Create · open_ended

Sorting & Searching

Algorithms 31 questions

What is the time complexity of binary search on a sorted array of n elements?

Easy · Remember · Multiple Choice

Which sorting algorithm is stable and guarantees O(n log n) worst case?

Easy · Remember · Multiple Choice

What is the space complexity of mergesort?

Easy · Remember · Multiple Choice

Why does quicksort degrade to O(n²) on already-sorted input with last-element pivot?

Medium-Easy · Understand · open_ended

Implement binary search to find the leftmost occurrence of a target.

Medium-Easy · Apply · open_ended

What is the time complexity of the 'binary search on answer' approach for Koko Eating Bananas (LC 875)?

Medium-Easy · Understand · Multiple Choice

When should you use counting sort instead of comparison-based sort?

Medium-Easy · Evaluate · open_ended

What is the loop termination condition for binary search on answer and why?

Medium-Easy · Understand · open_ended

Find First and Last Position (LC 34): what two binary searches do you run?

Medium-Easy · Apply · open_ended

What is Dutch National Flag problem (LC 75) and what algorithm solves it?

Medium-Easy · Apply · open_ended

What is the time complexity of Median of Two Sorted Arrays (LC 4)?

Medium-Easy · Remember · Multiple Choice

Why is heapsort in-place while mergesort requires O(n) extra space?

Medium-Easy · Understand · open_ended

Count inversions in [3,1,2,4]: how many inversions are there?

Medium-Easy · Apply · Multiple Choice

What is the worst-case time and space complexity of quicksort?

Medium-Easy · Remember · Multiple Choice

What does stability in a sorting algorithm mean and why does it matter?

Medium-Easy · Understand · open_ended

What is the optimal time complexity for solving the 'Sorting & Searching' classic problem?

Medium-Easy · Understand · Multiple Choice

In the Lomuto partition scheme, what loop invariant is maintained?

Medium · Understand · open_ended

What makes binary search on rotated sorted array (LC 33) more complex than standard binary search?

Medium · Analyze · open_ended

Quickselect finds the kth largest element in O(n) average. Why is it not O(n log n)?

Medium · Analyze · open_ended

Search a 2D Matrix (LC 74) in O(log(m*n)): how do you treat it as a sorted 1D array?

Medium · Apply · open_ended

What is the lower bound on the number of comparisons needed to sort n elements?

Medium · Understand · Multiple Choice

Implement the Lomuto partition function for quicksort.

Medium · Apply · open_ended

What is Timsort (used in Python and modern JS) and what makes it adaptive?

Medium · Understand · open_ended

What happens at the boundary when lo==hi in binary search on answer?

Medium · Understand · open_ended

For what type of problems is binary search on answer NOT applicable?

Medium · Evaluate · open_ended

How does binary search apply to finding the minimum in a rotated sorted array (LC 153)?

Medium · Apply · open_ended

How does mergesort count inversions (pairs where i<j but arr[i]>arr[j])?

Medium-Hard · Analyze · open_ended

Aggressive Cows (classic problem): how does binary search on answer apply?

Medium-Hard · Apply · open_ended

Split Array Largest Sum (LC 410): what is the feasibility check for binary search on answer?

Medium-Hard · Apply · open_ended

When would you choose a different approach for Sorting & Searching problems?

Medium-Hard · Analyze · open_ended

Design an optimal solution for a real-world application of Sorting & Searching.

Hard · Create · open_ended

Stacks & Queues

Data Structures 34 questions

What does LIFO stand for and which data structure follows this principle?

Easy · Remember · Multiple Choice

What is the time complexity of getMin() in a Min Stack using an auxiliary min-stack?

Easy · Remember · Multiple Choice

Why is array.shift() O(n) in JavaScript, and how can you avoid this for a queue?

Medium-Easy · Understand · open_ended

In Valid Parentheses (LC 20), why pop and compare rather than just peek?

Medium-Easy · Understand · open_ended

In Daily Temperatures (LC 739), why store indices rather than temperature values in the stack?

Medium-Easy · Understand · open_ended

Time complexity of the monotonic stack approach to Next Greater Element?

Medium-Easy · Understand · Multiple Choice

What is the space complexity of BFS on a graph with V vertices and E edges?

Medium-Easy · Understand · Multiple Choice

Which expression evaluates correctly with RPN (Reverse Polish Notation): ['2','3','+','4','*']?

Medium-Easy · Apply · Multiple Choice

BFS vs DFS: which guarantees shortest path in an unweighted graph?

Medium-Easy · Understand · Multiple Choice

What is the space complexity of Largest Rectangle in Histogram (LC 84) using the monotonic stack?

Medium-Easy · Understand · Multiple Choice

What is the time complexity of Decode String (LC 394) and why?

Medium-Easy · Understand · Multiple Choice

Why does a stack naturally model DFS while a queue naturally models BFS?

Medium-Easy · Understand · open_ended

Stack or Queue for implementing Undo/Redo in a text editor?

Medium-Easy · Apply · Multiple Choice

What does 'monotonic' mean in the context of a monotonic stack?

Medium-Easy · Understand · open_ended

How many times is each element pushed and popped in the monotonic stack for Next Greater Element?

Medium-Easy · Understand · Multiple Choice

What is the worst-case time complexity of a single pop() operation in a two-stack queue?

Medium-Easy · Understand · Multiple Choice

What is the optimal time complexity for solving the 'Stacks & Queues' classic problem?

Medium-Easy · Understand · Multiple Choice

What is the amortized time complexity of dequeue in a two-stack queue?

Medium · Understand · Multiple Choice

What invariant does a monotonic decreasing stack maintain?

Medium · Understand · open_ended

Implement a Min Stack with O(1) push, pop, top, and getMin.

Medium · Apply · open_ended

Why must BFS mark nodes as visited BEFORE enqueuing rather than after dequeuing?

Medium · Understand · open_ended

In Largest Rectangle in Histogram (LC 84), what does the sentinel 0 appended to heights array do?

Medium · Understand · open_ended

What two stacks (or one stack of pairs) does Decode String (LC 394) use?

Medium · Apply · open_ended

How does Rotting Oranges (LC 994) use multi-source BFS?

Medium · Apply · open_ended

Car Fleet (LC 853): which pattern and why?

Medium · Apply · open_ended

How do you represent state in Open the Lock (LC 752) BFS?

Medium · Apply · open_ended

What is the time complexity of Word Ladder (LC 127) BFS?

Medium · Understand · Multiple Choice

What invariant does the deque maintain in Sliding Window Maximum (LC 239)?

Medium-Hard · Analyze · open_ended

What is the key insight for Basic Calculator (LC 224) handling parentheses?

Medium-Hard · Analyze · open_ended

Pacific Atlantic Water Flow (LC 417): why BFS from oceans rather than from cells?

Medium-Hard · Analyze · open_ended

Design a data structure supporting push, pop, top, and retrieveMax all in O(1).

Medium-Hard · Synthesize · open_ended

Explain how to implement a stack using a single queue.

Medium-Hard · Synthesize · open_ended

When would you choose a different approach for Stacks & Queues problems?

Medium-Hard · Analyze · open_ended

Design an optimal solution for a real-world application of Stacks & Queues.

Hard · Create · open_ended

Hash Tables

Data Structures 32 questions

What is the average time complexity of inserting into a hash table?

Easy · Remember · Multiple Choice

What is the time complexity of checking if a string is an anagram of another using a frequency array?

Easy · Remember · Multiple Choice

What is the difference between a JS Map and a plain Object for use as a hash map?

Medium-Easy · Understand · open_ended

In Two Sum (LC 1), what is stored as key and value in the hash map?

Medium-Easy · Apply · Multiple Choice

Why does grouping anagrams with a sorted-string key cost O(n*k*log k) while a frequency-count key costs O(n*k)?

Medium-Easy · Understand · open_ended

What does a hash collision mean and how does separate chaining resolve it?

Medium-Easy · Understand · open_ended

What is the time complexity of Top K Frequent Elements (LC 347) with bucket sort?

Medium-Easy · Understand · Multiple Choice

What is the load factor of a hash table and why does it matter?

Medium-Easy · Understand · open_ended

What are the two main collision resolution strategies?

Medium-Easy · Remember · Multiple Choice

What is the time complexity of Time Based Key-Value Store (LC 981) get() operation?

Medium-Easy · Understand · Multiple Choice

How do you use a hash set to detect if a linked list has a cycle?

Medium-Easy · Apply · open_ended

What hash key would you use to group strings that are 'scramble anagrams' (same chars in same or different order)?

Medium-Easy · Apply · Multiple Choice

What is the space complexity of Group Anagrams (LC 49) with n strings of length k?

Medium-Easy · Understand · Multiple Choice

What is the average time to find all subarrays with sum equals k using a hash map?

Medium-Easy · Understand · Multiple Choice

Why does validating an anagram with a fixed-size array (size 26) use O(1) space?

Medium-Easy · Understand · open_ended

How does Isomorphic Strings (LC 205) differ from checking if strings are anagrams?

Medium-Easy · Understand · open_ended

In Happy Number (LC 202), why can you use a set instead of Floyd's cycle detection?

Medium-Easy · Evaluate · open_ended

What is the optimal time complexity for solving the 'Hash Tables' classic problem?

Medium-Easy · Understand · Multiple Choice

In Subarray Sum Equals K (LC 560), why initialize the map with {0:1}?

Medium · Understand · open_ended

Longest Consecutive Sequence (LC 128): why check only from sequence STARTS?

Medium · Analyze · open_ended

In Word Pattern (LC 290), why do you need TWO maps?

Medium · Apply · open_ended

How does Contiguous Array (LC 525) convert the equal-zeros-and-ones problem to a prefix sum problem?

Medium · Apply · open_ended

Four Sum Count (LC 454): how does splitting into two two-sum problems reduce O(n⁴) to O(n²)?

Medium · Analyze · open_ended

What is open addressing with linear probing?

Medium · Understand · open_ended

Repeated DNA Sequences (LC 187): find all 10-char sequences that appear more than once.

Medium · Apply · open_ended

How does Insert Delete GetRandom O(1) (LC 380) achieve O(1) deletion from the middle of the value set?

Medium-Hard · Analyze · open_ended

What trick does First Missing Positive (LC 41) use to achieve O(n) time and O(1) space?

Medium-Hard · Analyze · open_ended

What is a perfect hash function?

Medium-Hard · Understand · open_ended

When would you choose a different approach for Hash Tables problems?

Medium-Hard · Analyze · open_ended

Explain how Rabin-Karp rolling hash enables O(n) substring search.

Hard · Evaluate · open_ended

LFU Cache (LC 460): what is different from LRU and what data structures does it use?

Hard · Evaluate · open_ended

Design an optimal solution for a real-world application of Hash Tables.

Hard · Create · open_ended

Heaps & Priority Queues

Data Structures 31 questions

In a min-heap stored as an array, what is the parent index of the node at index i?

Easy · Remember · Multiple Choice

What is the time complexity of extracting the minimum from a min-heap?

Easy · Remember · Multiple Choice

What is the heap invariant for a min-heap?

Easy · Remember · Multiple Choice

What is the time complexity of peek() (see minimum without removing) in a min-heap?

Easy · Remember · Multiple Choice

Why use a min-heap of size k to find the kth LARGEST element?

Medium-Easy · Understand · open_ended

What is the time complexity of building a heap from n elements (Floyd's heapify)?

Medium-Easy · Understand · Multiple Choice

What is the time complexity of merging K sorted lists of total N elements using a min-heap?

Medium-Easy · Understand · Multiple Choice

How do you simulate a max-heap using a min-heap in JavaScript?

Medium-Easy · Apply · open_ended

What is the difference between a heap and a sorted array for priority queue operations?

Medium-Easy · Understand · open_ended

In heapsort, after building the max-heap, what is the next step?

Medium-Easy · Apply · open_ended

Why is the heap called a 'partially sorted' structure?

Medium-Easy · Understand · open_ended

What is the time complexity of Reorganize String (LC 767)?

Medium-Easy · Understand · Multiple Choice

What is the time and space complexity of the two-heap MedianFinder?

Medium-Easy · Understand · Multiple Choice

What happens if you insert into a max-heap a value smaller than the root?

Medium-Easy · Apply · Multiple Choice

What is the optimal time complexity for solving the 'Heaps & Priority Queues' classic problem?

Medium-Easy · Understand · Multiple Choice

Explain the two-heap approach to Find Median from Data Stream.

Medium · Apply · open_ended

Task Scheduler (LC 621): what determines the minimum intervals needed?

Medium · Analyze · open_ended

How does Connect Ropes for Minimum Cost work with a heap?

Medium · Apply · open_ended

When would you prefer a sorted array over a heap as a priority queue?

Medium · Evaluate · open_ended

Why is heapsort not stable?

Medium · Understand · open_ended

What is the Kth Smallest Element in a Sorted Matrix (LC 378) approach using binary search vs heap?

Medium-Hard · Evaluate · open_ended

Find K Pairs with Smallest Sums (LC 373): what initial entries go into the heap?

Medium-Hard · Apply · open_ended

Furthest Building (LC 1642): what is the heap-based greedy strategy?

Medium-Hard · Apply · open_ended

IPO (LC 502): why use two heaps — one for capital and one for profit?

Medium-Hard · Analyze · open_ended

Design Twitter (LC 355): how do you implement getNewsFeed efficiently with a heap?

Medium-Hard · Apply · open_ended

Swim in Rising Water (LC 778): how is this a heap problem?

Medium-Hard · Analyze · open_ended

Explain why buildHeap (Floyd's algorithm) is O(n) rather than O(n log n).

Medium-Hard · Analyze · open_ended

When would you choose a different approach for Heaps & Priority Queues problems?

Medium-Hard · Analyze · open_ended

Sliding Window Median (LC 480): how do you handle element removal from the two heaps?

Hard · Analyze · open_ended

What is the advantage of a d-ary heap over a binary heap for Dijkstra's algorithm?

Hard · Evaluate · open_ended

Design an optimal solution for a real-world application of Heaps & Priority Queues.

Hard · Create · open_ended

Recursion & Backtracking

Algorithms 32 questions

What is the recursion base case for Combination Sum (LC 39)?

Easy · Remember · Multiple Choice

What does the 'un-choose' step in backtracking accomplish?

Easy · Understand · open_ended

For Letter Combinations of Phone Number (LC 17) with input '23', how many combinations are there?

Easy · Apply · Multiple Choice

What is the key difference between permutations and combinations in backtracking?

Medium-Easy · Understand · open_ended

In backtracking, why must you push `[...path]` instead of `path` to the result?

Medium-Easy · Understand · open_ended

Time complexity of generating all permutations of n distinct elements?

Medium-Easy · Remember · Multiple Choice

What is the choose/explore/un-choose pattern in backtracking?

Medium-Easy · Understand · open_ended

In Combination Sum (LC 39), why sort the candidates array first?

Medium-Easy · Understand · open_ended

Implement the backtracking solution to generate all subsets of [1,2,3].

Medium-Easy · Apply · open_ended

In Word Search (LC 79), why mark the cell with '#' instead of using a separate visited set?

Medium-Easy · Understand · open_ended

Generate Parentheses (LC 22): what are the two pruning conditions?

Medium-Easy · Apply · open_ended

What is the time complexity of generating all combinations C(n,k)?

Medium-Easy · Understand · Multiple Choice

N-Queens: how many solutions exist for n=4?

Medium-Easy · Apply · Multiple Choice

How does the start index in the combinations template prevent duplicate combinations?

Medium-Easy · Understand · open_ended

What is the relationship between backtracking and DFS?

Medium-Easy · Understand · open_ended

What is the time complexity of Word Search (LC 79)?

Medium-Easy · Understand · Multiple Choice

What are the three types of conflict in N-Queens (same row, column, diagonal)?

Medium-Easy · Remember · open_ended

What is the optimal time complexity for solving the 'Recursion & Backtracking' classic problem?

Medium-Easy · Understand · Multiple Choice

In N-Queens, why does row-col uniquely identify a diagonal?

Medium · Understand · open_ended

What is the time complexity of Sudoku Solver in the worst case?

Medium · Understand · Multiple Choice

How do you handle duplicate elements in Subsets II (LC 90)?

Medium · Apply · open_ended

In the Combination Sum II (LC 40), how do you skip duplicates at the same recursion level?

Medium · Apply · open_ended

What is the branching factor and depth of the recursion tree for Permutations(n)?

Medium · Analyze · open_ended

Palindrome Partitioning (LC 131): how do you efficiently check if a substring is a palindrome?

Medium · Apply · open_ended

In Restore IP Addresses (LC 93), what constraints limit each segment?

Medium · Apply · open_ended

Why is backtracking considered 'exhaustive' yet often practical?

Medium · Evaluate · open_ended

Beautiful Arrangement (LC 526): what constraint is checked at each position?

Medium · Apply · open_ended

Why does Permutations II (LC 47) skip nums[i] when nums[i]==nums[i-1] AND !used[i-1]?

Medium-Hard · Analyze · open_ended

How does the Trie improve Word Search II (LC 212) compared to running LC 79 for each word?

Medium-Hard · Analyze · open_ended

When would you choose a different approach for Recursion & Backtracking problems?

Medium-Hard · Analyze · open_ended

Expression Add Operators (LC 282): why track the 'previous operand' in the backtracking state?

Hard · Analyze · open_ended

Design an optimal solution for a real-world application of Recursion & Backtracking.

Hard · Create · open_ended

API Gateway

System Design 21 questions

What is the primary purpose of an API Gateway?

Easy · Remember · Multiple Choice

API Gateways can perform SSL termination, meaning they decrypt HTTPS traffic and forward HTTP to backends.

Easy · Remember · true_false

Which of the following is NOT typically handled by an API Gateway?

Medium-Easy · Understand · Multiple Choice

What is the circuit breaker pattern in the context of an API Gateway?

Medium-Easy · Understand · Multiple Choice

Explain the difference between an API Gateway and a Load Balancer.

Medium-Easy · Understand · open_ended

What HTTP status code should an API gateway return when the circuit is open?

Medium-Easy · Remember · Multiple Choice

What is the BFF (Backend for Frontend) pattern?

Medium-Easy · Understand · open_ended

You have a mobile app and a web app consuming the same API. Mobile needs compact JSON responses, web needs full responses. Which pattern do you use?

Medium · Apply · Multiple Choice

Design the authentication flow for an API gateway handling JWT tokens with 100ms latency budget.

Medium · Apply · open_ended

True or False: AWS HTTP API is always the better choice over REST API in AWS API Gateway.

Medium · Apply · true_false

How does distributed rate limiting work across 10 API gateway instances?

Medium-Hard · Analyze · open_ended

Compare URL path versioning vs header versioning for APIs. Which would you recommend and why?

Medium-Hard · Analyze · open_ended

A payment service is experiencing 30% error rate. How should the API gateway circuit breaker respond?

Medium-Hard · Analyze · open_ended

How do you handle WebSocket connections through an API Gateway?

Medium-Hard · Analyze · open_ended

Explain idempotency keys and how the API gateway can help implement them.

Medium-Hard · Analyze · open_ended

What is request collapsing (or request coalescing) at the API gateway level?

Medium-Hard · Analyze · open_ended

Evaluate the trade-offs of putting an API gateway vs using a service mesh (Istio) for cross-cutting concerns.

Hard · Evaluate · open_ended

A developer reports that 10% of API requests are getting 401 errors even with valid tokens. How do you debug this at the gateway?

Hard · Evaluate · open_ended

How would you implement request signing (like AWS Signature V4) at the API gateway?

Hard · Evaluate · open_ended

Design an API gateway that handles 1 million requests per second with 99.99% availability.

Hard · Create · open_ended

Design an API versioning strategy for a public API used by 1000+ third-party developers.

Hard · Create · open_ended

Database Scaling

System Design 21 questions

What is the primary purpose of a read replica in a database setup?

Easy · Remember · Multiple Choice

In master-slave replication, replicas can accept write operations.

Easy · Remember · true_false

Which sharding strategy ensures that adding a new shard requires moving minimal data?

Medium-Easy · Understand · Multiple Choice

What is replication lag and why does it matter?

Medium-Easy · Understand · open_ended

What is the difference between vertical partitioning and horizontal partitioning (sharding)?

Medium-Easy · Understand · Multiple Choice

True or False: Adding more read replicas always improves write throughput.

Medium-Easy · Understand · true_false

What is the main problem with modulo-based hash sharding when you need to add a new shard?

Medium · Apply · open_ended

Explain geographic sharding and how it helps with GDPR compliance.

Medium · Apply · open_ended

How does PostgreSQL table partitioning differ from sharding?

Medium · Analyze · open_ended

Explain synchronous vs asynchronous replication. When would you use each?

Medium · Analyze · open_ended

What is CQRS and what problem does it solve?

Medium · Understand · open_ended

What is the difference between a partition key and a sort key in DynamoDB?

Medium · Apply · open_ended

A company has a users table with 200M rows. Queries by user_id are fast but queries by email are slow. What is the solution?

Medium · Apply · open_ended

What are virtual nodes in consistent hashing and why are they needed?

Medium · Understand · open_ended

What is a hot shard and how do you detect and fix it?

Medium-Hard · Analyze · open_ended

Why is a foreign key relationship across shards problematic?

Medium-Hard · Analyze · open_ended

Explain the CAP trade-off between PostgreSQL and Cassandra.

Medium-Hard · Analyze · open_ended

Design a sharding strategy for a social network where you need to efficiently fetch all posts by a user AND efficiently fetch a global feed of recent posts.

Hard · Evaluate · open_ended

Design a strategy for migrating from 4 shards to 8 shards with zero downtime.

Hard · Create · open_ended

Design a strategy for handling the 'celebrity problem' in a sharded social network database.

Hard · Evaluate · open_ended

Design the database scaling architecture for a ride-sharing app with 5M rides per day globally.

Hard · Create · open_ended

Message Queues

System Design 20 questions

What is the primary advantage of using a message queue over direct synchronous API calls?

Easy · Remember · Multiple Choice

What is the difference between at-least-once and at-most-once delivery?

Easy · Remember · Multiple Choice

In Kafka, what determines which partition a message is sent to when using a key?

Medium-Easy · Understand · Multiple Choice

AWS SQS Standard Queue guarantees exactly-once delivery.

Medium-Easy · Remember · true_false

What is a Dead Letter Queue (DLQ)?

Medium-Easy · Understand · open_ended

What is the visibility timeout in SQS and why is it important?

Medium-Easy · Understand · open_ended

True or False: Kafka deletes messages after they are consumed by a consumer group.

Medium-Easy · Remember · true_false

Implement an idempotent Kafka consumer for processing payment events.

Medium · Apply · open_ended

What is the difference between Kafka's consumer group and a traditional queue consumer?

Medium · Analyze · open_ended

A Kafka topic has 6 partitions. Consumer group A has 4 consumers. How are partitions distributed?

Medium · Apply · open_ended

Compare Kafka and RabbitMQ. When would you choose each?

Medium-Hard · Analyze · open_ended

What is the saga pattern and how does it solve distributed transactions?

Medium-Hard · Analyze · open_ended

Explain event sourcing and its trade-offs.

Medium-Hard · Analyze · open_ended

A consumer is processing Kafka messages slowly, causing increasing lag. How do you address this?

Medium-Hard · Analyze · open_ended

Explain choreography vs orchestration in the saga pattern.

Medium-Hard · Analyze · open_ended

How does Kafka handle broker failures without losing messages?

Medium-Hard · Analyze · open_ended

How do you achieve message ordering across multiple Kafka partitions?

Hard · Evaluate · open_ended

Design a real-time notification system for a food delivery app using message queues.

Hard · Create · open_ended

How would you implement exactly-once semantics in Kafka?

Hard · Evaluate · open_ended

Design a system to process 10 million IoT sensor readings per second using message queues.

Hard · Create · open_ended

Distributed Systems Fundamentals

System Design 21 questions

In the CAP theorem, what does 'P' (Partition Tolerance) mean?

Easy · Remember · Multiple Choice

Raft requires a majority (quorum) of nodes to elect a leader.

Easy · Remember · true_false

Which databases are examples of CP systems?

Medium-Easy · Understand · Multiple Choice

What is eventual consistency?

Medium-Easy · Understand · open_ended

True or False: Vector clocks can detect concurrent events, while Lamport timestamps cannot.

Medium-Easy · Understand · true_false

A distributed database processes a write. How many nodes must acknowledge before the client gets a success response?

Medium-Easy · Apply · Multiple Choice

For a 5-node distributed database, what R and W values guarantee strong consistency?

Medium · Apply · open_ended

What is the two-generals problem?

Medium · Understand · open_ended

How does consistent hashing relate to distributed systems consensus?

Medium · Analyze · open_ended

What happens to a Raft cluster when the leader node crashes?

Medium · Apply · open_ended

Explain the split-brain problem and how Raft prevents it.

Medium-Hard · Analyze · open_ended

What is the difference between Lamport timestamps and vector clocks?

Medium-Hard · Analyze · open_ended

Explain the PACELC theorem and give an example of a PA/EL system.

Medium-Hard · Understand · open_ended

What is hinted handoff in Cassandra and how does it improve availability?

Medium-Hard · Analyze · open_ended

Compare Paxos and Raft consensus algorithms.

Medium-Hard · Analyze · open_ended

Explain anti-entropy and how it maintains consistency in eventually consistent systems.

Medium-Hard · Analyze · open_ended

Design a distributed lock service from scratch.

Hard · Create · open_ended

What is linearizability and how does it differ from sequential consistency?

Hard · Evaluate · open_ended

How does Google's Spanner achieve global consistency across data centers?

Hard · Analyze · open_ended

Design a distributed ID generator that produces unique, roughly-sorted IDs.

Hard · Create · open_ended

What is the FLP impossibility result?

Hard · Understand · open_ended

Scalability Patterns

System Design 20 questions

What is the primary advantage of horizontal scaling over vertical scaling?

Easy · Remember · Multiple Choice

Back-pressure allows a consumer to signal a producer to slow its output rate.

Easy · Remember · true_false

Which of the following makes a service stateless?

Medium-Easy · Understand · Multiple Choice

Explain the bulkhead pattern with a real-world analogy.

Medium-Easy · Understand · open_ended

What is sticky session and why is it considered an anti-pattern?

Medium-Easy · Understand · Multiple Choice

True or False: Vertical scaling eliminates the need for stateless service design.

Medium-Easy · Understand · true_false

An application server uses in-memory sessions. It has 5 instances behind a load balancer. What problem occurs and how do you fix it?

Medium · Apply · open_ended

What is the difference between performance and scalability?

Medium · Analyze · open_ended

How does queue-based load leveling prevent system overload?

Medium · Understand · open_ended

What are the 12-Factor App principles and why do they enable scalability?

Medium · Apply · open_ended

A service makes calls to 3 external APIs. One API becomes slow. How does bulkhead help?

Medium · Apply · open_ended

Explain the X, Y, Z axes of the Scale Cube.

Medium · Understand · open_ended

What is Amdahl's Law parallel limit for a system where 5% of work must be sequential?

Medium · Apply · Multiple Choice

What is the primary advantage of Scalability Patterns?

Medium · · Multiple Choice

Design a system that scales from 100 users to 1 million users over 12 months.

Medium-Hard · Create · open_ended

What is Amdahl's Law and how does it limit horizontal scaling?

Medium-Hard · Analyze · open_ended

How do you implement graceful shutdown to support auto-scaling?

Medium-Hard · Apply · open_ended

Design an auto-scaling strategy for a video transcoding service with highly variable load.

Hard · Create · open_ended

How do you scale a WebSocket service horizontally?

Hard · Evaluate · open_ended

Design a system to handle Black Friday traffic (100x normal load) for an e-commerce site.

Hard · Create · open_ended

Design: URL Shortener (TinyURL)

System Design Cases 22 questions

What HTTP status code should a URL shortener return for a permanent redirect?

Hard · ·

With Base62 encoding using 6 characters, how many unique short URLs can be generated?

Hard · ·

Which ID generation strategy avoids collisions entirely without database lookups?

Hard · ·

A URL shortener has 100M URLs and uses MD5 hash truncated to 6 Base62 chars. What is the main risk?

Hard · ·

Two users simultaneously request a custom alias 'mylink'. How do you handle this safely?

Hard · ·

Your URL shortener's Redis cache suddenly goes down. What happens to the system?

Hard · ·

Your URL shortener goes viral — a single short URL is clicked 1 million times per second. How do you handle this 'hot key' problem?

Hard · ·

Why would you use Cassandra for analytics instead of PostgreSQL?

Hard · ·

What caching eviction policy is most appropriate for URL shortener cache?

Hard · ·

You need to add a feature: 'show all URLs created by user X'. How does this affect your database design?

Hard · ·

What is the purpose of a 'tombstone' record when a short URL is deleted?

Hard · ·

How would you design a multi-region active-active URL shortener with no single region as master?

Hard · ·

What is the read/write ratio typically assumed for a URL shortener?

Hard · ·

A customer complains that clicking a link shows 'URL not found' even though the link was created 1 hour ago. What could cause this?

Hard · ·

Should you use 301 or 302 redirect for maximum analytics accuracy? What are the trade-offs?

Hard · ·

Your URL shortener needs to handle 350,000 redirect requests/sec at peak. How many Redis nodes do you need, assuming each handles 100,000 ops/sec?

Hard · ·

How would you implement link expiration at scale without scanning the entire database?

Hard · ·

How would you prevent your URL shortener from being used to spread malicious links?

Hard · ·

Which data store is most appropriate for storing the core short_code → long_url mapping at scale?

Hard · ·

How would you migrate from auto-increment IDs to Snowflake IDs in a live production system with zero downtime?

Hard · ·

What happens when the same long URL is shortened twice by two different users?

Hard · ·

You want to guarantee that a short URL redirect returns in <10ms p99. Which architecture achieves this?

Hard · ·

Design: Chat System (WhatsApp/Slack)

System Design Cases 22 questions

Why is WebSocket preferred over HTTP for a chat application?

Hard · ·

Alice is connected to Chat Server 1. Bob is connected to Chat Server 2. Alice sends Bob a message. How is it delivered?

Hard · ·

Why is Cassandra chosen for message storage over PostgreSQL?

Hard · ·

A chat server crashes while 50,000 users are connected. What happens to their messages and connections?

Hard · ·

What does 'delivered' status mean vs 'read' status in WhatsApp?

Hard · ·

You have a group chat with 100,000 members (think a public community). Someone sends a message. How do you fan-out?

Hard · ·

How do you implement 'message ordering' when messages arrive out of order due to network issues?

Hard · ·

How many WebSocket servers are needed for 100 million concurrent connections, if each server handles 50,000 connections?

Hard · ·

A user receives 1,000 notifications while their phone is off. When they turn it on, what should happen?

Hard · ·

Explain how you would implement end-to-end encryption for group messages.

Hard · ·

What is the purpose of a Hybrid Logical Clock (HLC) in a distributed chat system?

Hard · ·

How do you handle typing indicators without overloading the server?

Hard · ·

What is the role of Kafka in the chat message pipeline?

Hard · ·

Design the unread message count feature. How do you efficiently show '5 unread' per conversation?

Hard · ·

Your Kafka cluster goes down. What happens to message delivery?

Hard · ·

What Cassandra partition key design supports efficient message retrieval for a conversation?

Hard · ·

How would you design message search ('find all messages containing hello') at scale?

Hard · ·

What is the difference between push notifications and WebSocket delivery? When do you use each?

Hard · ·

What mechanism prevents a message from being delivered twice if the sender retries due to network timeout?

Hard · ·

A chat server needs to be deployed with zero downtime. How do you drain WebSocket connections?

Hard · ·

How do you handle the case where two users send messages to each other at the exact same millisecond?

Hard · ·

What is the 'session affinity' or 'sticky session' problem with WebSocket servers?

Hard · ·

Design: News Feed (Facebook/Twitter)

System Design Cases 22 questions

What is 'fan-out on write' in the context of a news feed?

Hard · ·

A celebrity has 50 million followers and posts 10 times per day. Fan-out on write generates how many feed updates per day?

Hard · ·

Why is cursor-based pagination preferred over offset-based for news feeds?

Hard · ·

A user follows both Taylor Swift (50M followers) and a friend (100 followers). How do you merge their posts into one ranked feed?

Hard · ·

What data structure in Redis is best for storing a user's feed (ordered list of post IDs)?

Hard · ·

Your Kafka fan-out workers fall behind during a viral event. Followers see the post 10 minutes late. How do you handle this?

Hard · ·

How do you efficiently count likes on a post when 1 million people like it within 1 minute?

Hard · ·

What is the 'thundering herd' problem in a news feed system?

Hard · ·

How would you design the 'who liked this post' feature showing mutual friends first?

Hard · ·

How do you prevent a user from seeing posts they've already seen when infinite scrolling loads the next page?

Hard · ·

Which signal is most important for ranking a post higher in the news feed?

Hard · ·

A user deactivates their account. How should this affect the news feed of their 10,000 followers?

Hard · ·

What is the difference between a chronological feed and an algorithmic feed? What are the trade-offs?

Hard · ·

How should media uploads be handled to avoid overloading the post service?

Hard · ·

Your Redis cluster storing feed caches goes down. What is the fallback strategy?

Hard · ·

How would you implement hashtag-based trending topics?

Hard · ·

What approach does Facebook use to serve a single user's news feed from pre-computed data?

Hard · ·

How do you ensure a user never sees a post they blocked or from a user they blocked?

Hard · ·

How would you design A/B testing for news feed ranking algorithms?

Hard · ·

What technique avoids the N+1 query problem when hydrating a list of 50 post IDs from cache?

Hard · ·

A new user signs up and follows 0 people. What do you show in their empty feed?

Hard · ·

How would you handle the news feed for a user who follows 10,000 accounts (power user)?

Hard · ·

JavaScript Fundamentals

Programming Languages 34 questions

Which statement about let and var is TRUE?

Easy · Remember · Multiple Choice

What does console.log(typeof null) output?

Easy · Remember · predict_output

What is the difference between == and ===?

Easy · Remember · open_ended

Where does the prototype chain end?

Easy · Remember · Multiple Choice

What is the difference between forEach and map?

Easy · Remember · open_ended

What is the difference between null and undefined in JavaScript?

Easy · Remember · open_ended

What is a closure in JavaScript?

Medium-Easy · Understand · open_ended

What is the Temporal Dead Zone (TDZ)?

Medium-Easy · Understand · open_ended

What does Promise.all do if one promise rejects?

Medium-Easy · Understand · Multiple Choice

What output? ```javascript const obj = { x: 1 }; const copy = obj; copy.x = 2; console.log(obj.x); ```

Medium-Easy · Understand · predict_output

What is hoisting and how does it differ for var, let, const, and function declarations?

Medium-Easy · Understand · open_ended

What is the difference between call, apply, and bind?

Medium-Easy · Understand · open_ended

What does Object.freeze do?

Medium-Easy · Understand · Multiple Choice

What does the async keyword do to a function's return value?

Medium-Easy · Understand · Multiple Choice

What is optional chaining (?.) and nullish coalescing (??)?

Medium-Easy · Understand · open_ended

What does Array.prototype.reduce do? Implement sum.

Medium-Easy · Understand · open_ended

Predict output: ```javascript const a = [1, 2, 3]; const b = [...a]; b.push(4); console.log(a.length, b.length); ```

Medium-Easy · Understand · predict_output

What output does this produce? ```javascript for (var i = 0; i < 3; i++) { setTimeout(() => console.log(i), 0); } ```

Medium · Apply · predict_output

Implement a memoize function that caches results by arguments.

Medium · Apply · open_ended

What are the 4 rules of this binding in order of precedence?

Medium · Apply · open_ended

What is the difference between __proto__ and prototype?

Medium · Apply · open_ended

How do arrow functions differ from regular functions regarding this?

Medium · Apply · open_ended

What is a generator function and when would you use one?

Medium · Apply · open_ended

Explain event delegation and why it is useful.

Medium · Apply · open_ended

What is a WeakMap and how does it differ from Map?

Medium · Analyze · open_ended

Implement a once function — callable only once, returning cached result thereafter.

Medium · Apply · open_ended

Explain the JavaScript event loop and the difference between microtasks and macrotasks.

Medium-Hard · Analyze · open_ended

What does this output? ```javascript console.log('1'); setTimeout(() => console.log('2'), 0); Promise.resolve().then(() => console.log('3')); console.log('4'); ```

Medium-Hard · Analyze · predict_output

Implement debounce from scratch.

Medium-Hard · Analyze · open_ended

Explain synchronous vs asynchronous error handling.

Medium-Hard · Analyze · open_ended

Implement throttle from scratch.

Medium-Hard · Analyze · open_ended

What is the Proxy object used for?

Medium-Hard · Analyze · open_ended

Implement Promise.all from scratch.

Hard · Evaluate · open_ended

Design a pub/sub EventEmitter in JavaScript.

Hard · Evaluate · open_ended

React

Frontend 32 questions

What are the two rules of React hooks?

Easy · Remember · open_ended

What does the dependency array in useEffect do?

Medium-Easy · Understand · open_ended

What is the difference between useMemo and useCallback?

Medium-Easy · Understand · open_ended

What is reconciliation in React?

Medium-Easy · Understand · open_ended

What does React.memo do?

Medium-Easy · Understand · Multiple Choice

What is the difference between controlled and uncontrolled components?

Medium-Easy · Understand · open_ended

What is the Context API and when would you use it?

Medium-Easy · Understand · open_ended

What does useRef do and when would you use it?

Medium-Easy · Understand · open_ended

What is prop drilling and how do you solve it?

Medium-Easy · Understand · open_ended

What is the purpose of the key prop?

Medium-Easy · Understand · open_ended

What happens when you return a function from useEffect?

Medium-Easy · Understand · Multiple Choice

What output does this produce on the first render? ```jsx function Component() { const [count, setCount] = useState(0); useEffect(() => { setCount(count + 1); }, []); return <div>{count}</div>; } ```

Medium · Apply · predict_output

When should you use useReducer instead of useState?

Medium · Apply · open_ended

What is a stale closure in React?

Medium · Apply · open_ended

Why should you not use array index as a key in React lists?

Medium · Apply · open_ended

What causes infinite re-render loops in React?

Medium · Apply · open_ended

What is the difference between server components and client components in Next.js?

Medium · Apply · open_ended

How does useCallback help performance?

Medium · Apply · open_ended

What is an error boundary and why must it be a class component?

Medium · Apply · open_ended

What does React.lazy and Suspense do?

Medium · Apply · open_ended

What is forwardRef used for?

Medium · Apply · open_ended

What is the difference between useState initializer and useState with a function argument?

Medium · Apply · open_ended

Implement a useLocalStorage custom hook.

Medium-Hard · Analyze · open_ended

Implement a useDebounce hook.

Medium-Hard · Analyze · open_ended

What is the compound component pattern?

Medium-Hard · Analyze · open_ended

Explain React Fiber.

Medium-Hard · Analyze · open_ended

What is the useTransition hook used for?

Medium-Hard · Analyze · open_ended

How would you implement optimistic updates in React?

Medium-Hard · Analyze · open_ended

What is the difference between useLayoutEffect and useEffect?

Medium-Hard · Analyze · open_ended

Why does React StrictMode double-invoke effects in development?

Medium-Hard · Analyze · open_ended

Implement useFetch — a hook that fetches data from a URL.

Medium-Hard · Analyze · open_ended

What are React Server Components and what problem do they solve?

Medium-Hard · Analyze · open_ended

SQL

Databases 31 questions

What does LEFT JOIN return when there is no matching row in the right table?

Easy · Remember · open_ended

What does `NULL + 1` evaluate to in SQL?

Easy · Remember · Multiple Choice

True or False: A FULL OUTER JOIN returns all rows from both tables, including unmatched rows from each.

Easy · Remember · true_false

What is the difference between a primary key and a unique constraint?

Easy · Remember · open_ended

What is the purpose of `COALESCE` in SQL?

Easy · Remember · open_ended

What is the difference between WHERE and HAVING?

Medium-Easy · Understand · open_ended

What is the difference between RANK() and DENSE_RANK()?

Medium-Easy · Understand · open_ended

What are the four ACID properties?

Medium-Easy · Remember · open_ended

What is the difference between TRUNCATE and DELETE?

Medium-Easy · Understand · open_ended

What does `COUNT(col)` vs `COUNT(*)` count?

Medium-Easy · Understand · open_ended

Write a query to find customers who have placed more than 3 orders.

Medium-Easy · Apply · open_ended

What is a self-join and when would you use one?

Medium-Easy · Understand · open_ended

What does the SQL `EXISTS` operator do?

Medium-Easy · Understand · open_ended

What is SQL injection and how do you prevent it?

Medium-Easy · Apply · open_ended

Arrange these SQL clauses in their logical execution order: HAVING, FROM, SELECT, WHERE, GROUP BY, ORDER BY

Medium-Easy · Understand · ordering

What is the difference between UNION and UNION ALL?

Medium-Easy · Understand · open_ended

Write a SQL query to find the second-highest salary.

Medium · Apply · open_ended

Explain what a composite index is and how column order matters.

Medium · Apply · open_ended

What is a correlated subquery and why can it be slow?

Medium · Apply · open_ended

What is an index-only scan?

Medium · Apply · open_ended

What is the N+1 query problem in SQL?

Medium · Apply · open_ended

What is a covering index?

Medium · Apply · open_ended

What is a deadlock in a database and how is it resolved?

Medium · Apply · open_ended

What does `EXPLAIN ANALYZE` show in PostgreSQL?

Medium · Apply · open_ended

What is the difference between a clustered and non-clustered index?

Medium · Apply · open_ended

What is a window function PARTITION BY and how does it differ from GROUP BY?

Medium · Apply · open_ended

How would you find duplicate rows in a table?

Medium · Apply · open_ended

What is `JSONB` in PostgreSQL and why is it preferred over `JSON`?

Medium · Apply · open_ended

Write a query using a window function to get the top 3 salaries per department.

Medium-Hard · Analyze · open_ended

Write a recursive CTE to traverse an employee hierarchy and show all subordinates of a manager.

Medium-Hard · Analyze · open_ended

What are transaction isolation levels and what phenomena do they prevent?

Medium-Hard · Analyze · open_ended

OOP & Design Patterns

Software Engineering 30 questions

What does the 'O' in SOLID stand for and how do you achieve it?

Medium-Easy · Understand · open_ended

What is Dependency Injection and why does it make code more testable?

Medium-Easy · Understand · open_ended

What is the Observer pattern and where does it appear in real systems?

Medium-Easy · Understand · open_ended

What is the difference between the Adapter and Facade patterns?

Medium-Easy · Understand · open_ended

True or False: The Singleton pattern is always an antipattern.

Medium-Easy · Evaluate · true_false

What is the Repository pattern and why is it useful?

Medium-Easy · Understand · open_ended

What is a God Class and how do you fix it?

Medium-Easy · Apply · open_ended

What is the Interface Segregation Principle?

Medium-Easy · Understand · open_ended

Explain the Builder pattern and when to use it over a constructor with many parameters.

Medium-Easy · Understand · open_ended

What is 'Feature Envy' code smell?

Medium-Easy · Understand · open_ended

Arrange these in the order of abstraction from lowest to highest: Implementation, Interface, Concrete Class, Abstract Class

Medium-Easy · Understand · ordering

True or False: The Observer pattern and Publish/Subscribe (pub/sub) pattern are identical.

Medium-Easy · Understand · true_false

What pattern do middleware systems (Express, Django, Laravel) implement?

Medium-Easy · Apply · Multiple Choice

What is the Liskov Substitution Principle and give an example of a violation?

Medium · Apply · open_ended

What is the difference between the Factory Method and Abstract Factory patterns?

Medium · Apply · open_ended

What problem does the Decorator pattern solve that subclassing cannot?

Medium · Apply · open_ended

Implement the Singleton pattern in TypeScript with lazy initialization.

Medium · Apply · open_ended

What is the Strategy pattern and how does it support the Open/Closed Principle?

Medium · Apply · open_ended

What is the Command pattern and how does it enable undo functionality?

Medium · Apply · open_ended

What is the Composite pattern?

Medium · Apply · open_ended

What is the Template Method pattern and where does it appear in frameworks?

Medium · Apply · open_ended

What is the Chain of Responsibility pattern?

Medium · Apply · open_ended

What is 'Shotgun Surgery' antipattern and which SOLID principle does it violate?

Medium · Analyze · open_ended

What is the difference between Composition and Aggregation in OOP?

Medium · Understand · open_ended

What is 'Primitive Obsession' and how do you fix it?

Medium · Apply · open_ended

What is the Null Object pattern?

Medium · Apply · open_ended

What is the Single Responsibility Principle in practice — how do you identify when a class has too many responsibilities?

Medium · Apply · open_ended

What is the difference between the Proxy and Decorator patterns?

Medium-Hard · Analyze · open_ended

What is the Flyweight pattern and when is it useful?

Medium-Hard · Analyze · open_ended

Design a logging system using the appropriate design pattern that supports multiple outputs (console, file, network) and log levels.

Medium-Hard · Analyze · open_ended

Operating Systems

Computer Science Fundamentals 30 questions

True or False: The heap and stack grow in opposite directions in a typical process address space.

Easy · Remember · true_false

What is the purpose of the PCB (Process Control Block)?

Easy · Remember · open_ended

What is the difference between a process and a thread?

Medium-Easy · Understand · open_ended

What are the four Coffman conditions required for deadlock?

Medium-Easy · Remember · open_ended

What is virtual memory and why does every process need its own?

Medium-Easy · Understand · open_ended

What is a race condition? Give a concrete example.

Medium-Easy · Apply · open_ended

What is a zombie process?

Medium-Easy · Understand · open_ended

Explain the Round Robin scheduling algorithm and its tradeoffs.

Medium-Easy · Understand · open_ended

What is the difference between fork() and exec()?

Medium-Easy · Understand · open_ended

What does an inode contain?

Medium-Easy · Remember · open_ended

What is a context switch and what information is saved/restored?

Medium-Easy · Understand · open_ended

What are Unix signals and give 3 examples?

Medium-Easy · Apply · open_ended

What is the difference between a hard link and a symbolic (soft) link?

Medium-Easy · Understand · open_ended

What is the difference between preemptive and cooperative (non-preemptive) scheduling?

Medium-Easy · Understand · open_ended

What is an orphan process?

Medium-Easy · Remember · open_ended

What is the /proc filesystem in Linux?

Medium-Easy · Understand · open_ended

What is the difference between a mutex and a semaphore?

Medium · Apply · open_ended

What is a page fault and what happens when one occurs?

Medium · Apply · open_ended

What is thrashing in OS and what causes it?

Medium · Apply · open_ended

What is a condition variable and why must the condition be checked in a while loop?

Medium · Apply · open_ended

What is copy-on-write (COW) and how does it make fork() efficient?

Medium · Apply · open_ended

What is a spinlock and when is it appropriate?

Medium · Apply · open_ended

What is the purpose of the TLB (Translation Lookaside Buffer)?

Medium · Apply · open_ended

What is memory fragmentation and what are its two types?

Medium · Apply · open_ended

What is the difference between a major and minor page fault?

Medium · Analyze · open_ended

Arrange these CPU scheduling metrics from the perspective of an interactive user from most important to least: Throughput, Response time, Turnaround time, Waiting time

Medium · Evaluate · ordering

What does the kernel do during a system call?

Medium · Apply · open_ended

What is a binary semaphore and how does it differ from a mutex?

Medium · Analyze · open_ended

Explain the concept of CPU affinity and when you would use it.

Medium-Hard · Analyze · open_ended

What are Linux namespaces and how do they enable containers?

Medium-Hard · Analyze · open_ended

Networking

Computer Science Fundamentals 30 questions

What does HTTPS add over HTTP?

Easy · Remember · open_ended

What is the difference between GET and POST in REST APIs?

Easy · Remember · open_ended

What is the difference between authentication and authorization?

Easy · Remember · open_ended

What HTTP status code should you return when a client sends a valid request but doesn't have permission?

Easy · Remember · Multiple Choice

What is the difference between TCP and UDP?

Medium-Easy · Understand · open_ended

Describe the TCP 3-way handshake.

Medium-Easy · Remember · open_ended

Explain the DNS resolution process step by step.

Medium-Easy · Apply · open_ended

What is a certificate authority and why is it needed for TLS?

Medium-Easy · Understand · open_ended

What is CORS and why does it exist?

Medium-Easy · Understand · open_ended

What is the difference between a 301 and 302 redirect?

Medium-Easy · Understand · open_ended

What is an idempotent HTTP method?

Medium-Easy · Understand · open_ended

True or False: WebSockets use HTTP for the initial connection.

Medium-Easy · Remember · true_false

What are the three parts of a JWT?

Medium-Easy · Remember · open_ended

What is a CDN and how does it reduce latency?

Medium-Easy · Understand · open_ended

What is the purpose of the OPTIONS HTTP method?

Medium-Easy · Understand · open_ended

What is DNS TTL and what are the tradeoffs of low vs high TTL?

Medium-Easy · Understand · open_ended

What is the difference between 400, 401, 403, and 404 status codes?

Medium-Easy · Remember · open_ended

Arrange these layers from closest to hardware (lowest) to closest to the user (highest): Transport, Application, Network, Physical

Medium-Easy · Remember · ordering

What is the difference between HTTP/1.1, HTTP/2, and HTTP/3?

Medium · Apply · open_ended

What is head-of-line blocking?

Medium · Apply · open_ended

What is the purpose of HTTP headers like Cache-Control, ETag, and Last-Modified?

Medium · Apply · open_ended

What is perfect forward secrecy in TLS?

Medium · Apply · open_ended

What is the difference between OAuth2 Authorization Code flow and Client Credentials flow?

Medium · Apply · open_ended

What is SSL stripping and how does HSTS prevent it?

Medium · Apply · open_ended

What is gRPC and when would you choose it over REST?

Medium · Apply · open_ended

Explain how HTTP caching with Cache-Control: no-cache differs from Cache-Control: no-store.

Medium · Analyze · open_ended

What is Server-Sent Events (SSE) and when would you use it instead of WebSockets?

Medium · Apply · open_ended

What is TCP's congestion control and why is it needed?

Medium · Apply · open_ended

What is Rate Limiting and how would you implement it?

Medium · Apply · open_ended

What happens when you type a URL into a browser and press Enter?

Medium-Hard · Analyze · open_ended

Java Core

Programming Languages 20 questions

What is the output of: String a = "hello"; String b = "hello"; System.out.println(a == b);

Hard · ·

Which collection provides O(1) average-case time for get(), put(), and containsKey()?

Hard · ·

What happens when you call stream() operations without a terminal operation?

Hard · ·

Which keyword ensures a field is NOT serialized when using Java object serialization?

Hard · ·

What is the primary difference between synchronized methods and volatile fields?

Hard · ·

What does the 'final' keyword mean when applied to a class, a method, and a variable respectively?

Hard · ·

Which of these correctly implements a checked exception?

Hard · ·

What is the output of: List<Integer> list = Arrays.asList(1, 2, 3); list.add(4);

Hard · ·

In Java generics, what does 'List<? extends Number>' allow you to do with the list?

Hard · ·

What is the role of Young Generation in JVM garbage collection?

Hard · ·

What does the final keyword mean when applied to a method?

Medium-Easy · · Multiple Choice

Which Java feature allows you to process collections with functional-style operations?

Medium-Easy · · Multiple Choice

What is the difference between == and .equals() in Java?

Medium · · Multiple Choice

What happens when you call HashMap.put() with an existing key?

Medium · · Multiple Choice

What is the time complexity of ArrayList.add(0, element)?

Medium · · Multiple Choice

What is the difference between checked and unchecked exceptions?

Medium · · Multiple Choice

What is the output of: System.out.println(10 + 20 + "Hello" + 10 + 20)?

Medium · · Multiple Choice

Which collection should you use for thread-safe key-value operations?

Medium-Hard · · Multiple Choice

What is the purpose of the volatile keyword in Java?

Medium-Hard · · Multiple Choice

What is the purpose of the transient keyword?

Medium-Hard · · Multiple Choice

DSA Coding Patterns

Algorithms 13 questions

Content Delivery Networks (CDN)

System Design 20 questions

What does a CDN cache HIT mean?

Easy · Remember · Multiple Choice

Which Cache-Control directive tells shared caches (CDN) to cache for 1 hour, but browser should revalidate?

Medium-Easy · Understand · Multiple Choice

Push CDN pre-loads content to edge nodes before any user requests it.

Easy · Remember · true_false

What is origin shield and why is it important for high-traffic sites?

Medium-Easy · Understand · open_ended

What is content versioning and why is it better than CDN purging for static assets?

Medium · Apply · open_ended

A new product is launching at midnight with 1M users expected. How do you use CDN to prepare?

Medium · Apply · open_ended

How does the Vary header affect CDN caching?

Medium-Hard · Analyze · open_ended

Design a CDN caching strategy for an e-commerce product catalog with real-time pricing.

Medium-Hard · Analyze · open_ended

What is the difference between CDN-level DDoS protection and application-level rate limiting?

Medium-Hard · Analyze · open_ended

How do you cache authenticated API responses in a CDN?

Hard · Evaluate · open_ended

What is a Surrogate Key (Cache Tag) and which CDNs support it?

Medium · Understand · open_ended

True or False: Cloudflare Workers can modify the response from origin before sending to user.

Medium-Easy · Understand · true_false

Design a CDN architecture for a live video streaming platform.

Hard · Create · open_ended

How does Anycast routing help CDN route users to the nearest edge node?

Medium · Understand · open_ended

What HTTP status code does a CDN return for a conditional request when content hasn't changed?

Medium-Easy · Remember · Multiple Choice

How does Netflix Open Connect CDN differ from public CDN providers?

Medium-Hard · Analyze · open_ended

What is a cache poisoning attack on a CDN and how do you prevent it?

Hard · Evaluate · open_ended

Calculate the CDN cache hit ratio needed to save $1M/year if origin bandwidth costs $0.10/GB and CDN bandwidth costs $0.01/GB at 10PB/month.

Medium-Hard · Apply · open_ended

True or False: Using a CDN always improves performance for all types of content.

Medium-Easy · Understand · true_false

What is the primary advantage of Content Delivery Networks (CDN)?

Medium · · Multiple Choice

Rate Limiting & Throttling

System Design 20 questions

What HTTP status code should a rate limiter return when a limit is exceeded?

Easy · Remember · Multiple Choice

Which rate limiting algorithm allows a burst of requests followed by a sustained rate?

Medium-Easy · Understand · Multiple Choice

The leaky bucket algorithm smooths output regardless of input burst rate.

Easy · Remember · true_false

Explain the boundary burst problem with fixed window rate limiting.

Medium-Easy · Understand · open_ended

Implement a token bucket rate limiter in Redis that allows 10 RPS with burst of 50.

Medium · Apply · open_ended

How do you implement distributed rate limiting across 10 API server instances?

Medium-Hard · Analyze · open_ended

What is the sliding window counter approximation and what is its error bound?

Medium-Hard · Analyze · open_ended

Design rate limiting for a payment API that processes financial transactions.

Hard · Create · open_ended

What are the trade-offs between rate limiting at the CDN edge vs at the application?

Medium-Hard · Analyze · open_ended

True or False: Rate limiting and circuit breaking serve the same purpose.

Medium-Easy · Understand · true_false

A user hits the rate limit. What should the API response include?

Medium-Easy · Apply · open_ended

How do you implement rate limiting that doesn't have Redis as a single point of failure?

Hard · Evaluate · open_ended

Explain the token bucket implementation in AWS API Gateway.

Medium · Understand · open_ended

Design a rate limiter for a SaaS API with 3 tiers: Free (100/day), Pro (10k/day), Enterprise (unlimited).

Hard · Create · open_ended

What is adaptive rate limiting and when would you use it?

Medium-Hard · Analyze · open_ended

How does rate limiting interact with retry logic in API clients?

Medium-Hard · Analyze · open_ended

What is the primary advantage of Rate Limiting & Throttling?

Medium · · Multiple Choice

When should you NOT use Rate Limiting & Throttling?

Medium · · Multiple Choice

What is the time complexity of the core operation in Rate Limiting & Throttling?

Medium · · Multiple Choice

How does Rate Limiting & Throttling handle failures?

Medium · · Multiple Choice

Authentication & Authorization

System Design 20 questions

What is the difference between authentication and authorization?

Easy · Remember · Multiple Choice

A JWT access token should be stored in localStorage for a web application.

Medium-Easy · Understand · true_false

Which password hashing algorithm is recommended for storing user passwords?

Easy · Remember · Multiple Choice

Explain the OAuth 2.0 authorization code flow step by step.

Medium · Apply · open_ended

How do you revoke a JWT token that hasn't expired yet?

Medium · Apply · open_ended

Design an authentication system for 50 microservices.

Medium-Hard · Create · open_ended

What is PKCE in OAuth 2.0 and why is it required for public clients?

Medium-Hard · Analyze · open_ended

Compare RBAC and ABAC. When would you use each?

Medium-Hard · Analyze · open_ended

How does mTLS provide authentication for service-to-service communication?

Medium-Hard · Analyze · open_ended

What is zero-trust architecture and how does it differ from perimeter-based security?

Medium-Hard · Analyze · open_ended

True or False: OAuth 2.0 access tokens should be stored in browser cookies.

Medium-Easy · Understand · true_false

Design a multi-tenant authorization system for a SaaS application.

Hard · Create · open_ended

How do you implement single sign-on (SSO) for 5 web applications?

Medium-Hard · Create · open_ended

What is a confused deputy attack in authorization?

Medium-Hard · Analyze · open_ended

How do you securely implement 'remember me' / persistent login?

Medium · Apply · open_ended

What is OpenID Connect (OIDC) and how does it extend OAuth 2.0?

Medium · Understand · open_ended

Implement password reset flow securely.

Medium · Apply · open_ended

How do you propagate user identity across microservices?

Medium-Hard · Analyze · open_ended

What is the primary advantage of Authentication & Authorization?

Medium · · Multiple Choice

When should you NOT use Authentication & Authorization?

Medium · · Multiple Choice

Monitoring & Observability

System Design 20 questions

What are Google's Four Golden Signals?

Easy · Remember · Multiple Choice

What does SLO stand for and what is it used for?

Easy · Remember · Multiple Choice

Prometheus uses a push model to receive metrics from services.

Medium-Easy · Remember · true_false

Explain the difference between a trace, a span, and a trace ID.

Medium-Easy · Understand · open_ended

What is the error budget for a service with a 99.9% SLO over a 30-day period?

Medium-Easy · Apply · open_ended

Design an observability strategy for a microservices e-commerce platform with 30 services.

Medium-Hard · Create · open_ended

What is high cardinality in metrics and why is it a problem for Prometheus?

Medium · Analyze · open_ended

Compare Prometheus and Datadog for production monitoring.

Medium · Analyze · open_ended

How do you implement distributed tracing without modifying every service's code?

Medium-Hard · Analyze · open_ended

What is a Prometheus Counter vs Gauge vs Histogram?

Medium-Easy · Understand · open_ended

True or False: SLA should be set equal to your internal SLO.

Medium-Easy · Understand · true_false

Design alerting for a payment API with 99.95% SLO using error budget burn rate.

Hard · Create · open_ended

What is MTTD and MTTR? How do you minimize each?

Medium · Apply · open_ended

How do you correlate logs, metrics, and traces for a single request?

Medium-Hard · Analyze · open_ended

What is synthetic monitoring and how does it complement real-user monitoring?

Medium · Understand · open_ended

What is log aggregation and why is it necessary in a microservices environment?

Medium-Easy · Understand · open_ended

Design an on-call rotation and incident response process for a 6-engineer team.

Medium-Hard · Create · open_ended

What is the primary advantage of Monitoring & Observability?

Medium · · Multiple Choice

When should you NOT use Monitoring & Observability?

Medium · · Multiple Choice

What is the time complexity of the core operation in Monitoring & Observability?

Medium · · Multiple Choice

Networking Fundamentals

System Design 20 questions

What is the main advantage of HTTP/2 over HTTP/1.1?

Easy · Remember · Multiple Choice

Why does DNS primarily use UDP instead of TCP?

Medium-Easy · Understand · Multiple Choice

WebSocket connections work over standard HTTP ports (80/443).

Easy · Remember · true_false

Explain what happens at each step when you type 'https://google.com' in a browser.

Medium · Apply · open_ended

What is head-of-line blocking and how does HTTP/2 address it?

Medium · Analyze · open_ended

When would you choose WebSocket over SSE for a real-time application?

Medium · Apply · open_ended

Compare gRPC and REST for an internal microservice API. Which would you choose?

Medium-Hard · Analyze · open_ended

Explain TLS certificate chain validation.

Medium-Hard · Analyze · open_ended

How does QUIC (HTTP/3) improve on TCP+TLS?

Medium-Hard · Analyze · open_ended

True or False: HTTP/3 uses TCP as its transport protocol.

Easy · Remember · true_false

Design a protocol for a real-time multiplayer game.

Hard · Create · open_ended

What is the difference between a CNAME and an A record in DNS?

Medium-Easy · Understand · open_ended

Explain how long polling works and what its limitations are.

Medium · Understand · open_ended

How do you handle WebSocket connections across multiple server instances?

Medium-Hard · Analyze · open_ended

What is HPACK header compression in HTTP/2 and why is it important?

Medium · Understand · open_ended

What is TCP congestion control and how does it affect application performance?

Medium-Hard · Analyze · open_ended

What is the primary advantage of Networking Fundamentals?

Medium · · Multiple Choice

When should you NOT use Networking Fundamentals?

Medium · · Multiple Choice

What is the time complexity of the core operation in Networking Fundamentals?

Medium · · Multiple Choice

How does Networking Fundamentals handle failures?

Medium · · Multiple Choice

Data Storage & Processing

System Design 20 questions

What is the main difference between a data lake and a data warehouse?

Easy · Remember · Multiple Choice

Why is Parquet preferred over CSV for analytics workloads?

Medium-Easy · Understand · Multiple Choice

Apache Flink processes data as micro-batches, like Spark Streaming.

Medium-Easy · Understand · true_false

What is the difference between ETL and ELT?

Medium-Easy · Understand · open_ended

Design a data pipeline to process 1 billion events per day from user activity on a mobile app.

Medium-Hard · Create · open_ended

What is a watermark in stream processing and why is it needed?

Medium · Understand · open_ended

Explain the Lambda architecture and its main criticism.

Medium · Analyze · open_ended

What is Change Data Capture (CDC) and why is it used?

Medium · Understand · open_ended

Design a real-time recommendation engine that updates recommendations as users browse.

Hard · Create · open_ended

What is data skew in Spark and how do you fix it?

Medium-Hard · Analyze · open_ended

True or False: Apache Spark can only process batch data, not real-time streams.

Medium-Easy · Understand · true_false

What is a star schema and how does it differ from OLTP schema design?

Medium · Analyze · open_ended

How do you ensure exactly-once processing in a stream processing pipeline?

Hard · Evaluate · open_ended

What is Parquet and what are its key benefits for data analytics?

Medium-Easy · Understand · Multiple Choice

Design a system to track real-time inventory levels across 10,000 warehouses.

Hard · Create · open_ended

Explain the concept of event time vs processing time in stream processing.

Medium · Understand · open_ended

What is dbt and how does it fit into the modern data stack?

Medium · Understand · open_ended

What is the primary advantage of Data Storage & Processing?

Medium · · Multiple Choice

When should you NOT use Data Storage & Processing?

Medium · · Multiple Choice

What is the time complexity of the core operation in Data Storage & Processing?

Medium · · Multiple Choice

Design: Rate Limiter

System Design Cases 22 questions

Which HTTP status code indicates a rate limit has been exceeded?

Hard · ·

What is the main disadvantage of a fixed window counter rate limiter?

Hard · ·

Why must the sliding window check-and-increment be done atomically in Redis?

Hard · ·

Your rate limiter Redis cluster goes down during peak traffic. What should happen?

Hard · ·

Which algorithm allows bursting up to bucket capacity while maintaining an average rate?

Hard · ·

How do you rate limit a distributed denial-of-service (DDoS) attack from 10,000 different IP addresses?

Hard · ·

A sliding window log stores every request timestamp. For 100 req/min limit with 10M users, how much Redis memory is needed?

Hard · ·

An API has a limit of 1000 requests/hour. A user sends 999 requests in the first minute. What should happen for the remaining 59 minutes?

Hard · ·

How would you implement different rate limits for free vs paid users?

Hard · ·

What Redis command makes a rate limit counter expire automatically after the window?

Hard · ·

How do you rate limit an API endpoint that is called from a mobile app where users share the same NAT IP?

Hard · ·

How would you design a rate limiter that limits by cost rather than by count (e.g., expensive ML inference costs 10 units, simple lookup costs 1)?

Hard · ·

Which header tells a client when their rate limit window resets?

Hard · ·

You need to rate limit across 5 Redis shards. A user's requests may hit different shards. How do you ensure consistent counting?

Hard · ·

How does the leaky bucket algorithm differ from token bucket, and when would you choose it?

Hard · ·

Where should a rate limiter be implemented in the request pipeline?

Hard · ·

An attacker makes exactly 99 requests per minute (limit is 100) from 1000 different user accounts. How do you detect and block this?

Hard · ·

What are the trade-offs between implementing rate limiting at the application level vs at a reverse proxy (like NGINX)?

Hard · ·

What is the 'sliding window counter' algorithm's approximation error rate?

Hard · ·

How do you test that your rate limiter is working correctly in production without impacting users?

Hard · ·

Design a rate limiter for a GraphQL API where a single request can include multiple queries.

Hard · ·

What Redis data structure is used for implementing sliding window log rate limiting?

Hard · ·

Design: Web Crawler

System Design Cases 22 questions

Why is BFS (Breadth-First Search) preferred over DFS for web crawling?

Hard · ·

What is the purpose of a Bloom filter in a web crawler?

Hard · ·

A website generates infinite unique URLs like /products?page=1, /products?page=2 ... /products?page=1000000. How do you handle this?

Hard · ·

What does robots.txt's 'Crawl-delay: 10' directive mean?

Hard · ·

How do you crawl JavaScript-rendered Single Page Applications (SPAs)?

Hard · ·

A fetcher node crashes after popping a URL from the queue but before completing the crawl. How do you prevent URL loss?

Hard · ·

How does SimHash detect near-duplicate web pages?

Hard · ·

What is the 'politeness' policy in web crawling?

Hard · ·

You crawl a page at URL A which has identical content to URL B (a mirror site). How do you avoid indexing duplicates?

Hard · ·

How should a crawler handle a 404 Not Found response?

Hard · ·

How would you prioritize which URLs to crawl first with a limited crawl budget?

Hard · ·

What is the false positive rate of a Bloom filter configured with 10 bits per element and 7 hash functions?

Hard · ·

How do you handle a website that requires JavaScript and login to access content?

Hard · ·

Why is URL normalization important for deduplication?

Hard · ·

Which partitioning strategy for the URL frontier prevents a single fast-to-crawl domain from monopolizing crawlers?

Hard · ·

How would you design the crawler to handle DNS lookups efficiently at 400 pages/second?

Hard · ·

What is the difference between crawl depth and crawl breadth? How do you balance them?

Hard · ·

What User-Agent header should a well-behaved crawler send?

Hard · ·

Your crawler generates 400,000 duplicate URLs per second (from link extraction). How do you efficiently deduplicate this volume?

Hard · ·

How would you design a recrawl scheduler that decides when to recrawl each page?

Hard · ·

How does a web crawler handle redirect chains (301, 302)?

Hard · ·

How would you scale the crawler from 400 pages/sec to 4,000 pages/sec?

Hard · ·

Design: Notification System

System Design Cases 22 questions

What is the difference between FCM and APNS?

Hard · ·

What happens when you try to send a push notification to an invalid/expired device token?

Hard · ·

How do you implement 'quiet hours' — not sending notifications between 10pm and 8am in user's local time?

Hard · ·

Your email notification service sends 2 million emails/day. SendGrid has a 4-hour outage. How do you handle this?

Hard · ·

What legal requirement mandates that marketing emails include an unsubscribe link?

Hard · ·

You need to send a promotional notification to 50 million users at 9am in their local timezone. How do you architect this?

Hard · ·

How do you prevent notification fatigue — users getting too many notifications and turning them off?

Hard · ·

What is a Dead Letter Queue (DLQ) in a notification system?

Hard · ·

A user has 5 devices (phone, tablet, 2 computers, smart TV). How do you manage notifications across all of them?

Hard · ·

How do you design idempotent notification delivery to prevent duplicate sends?

Hard · ·

A notification system sends 1,000 notifications/sec. Each notification requires one database read for user preferences. How do you avoid overloading the database?

Hard · ·

How do you handle email bounces and complaints to protect your email sending reputation?

Hard · ·

Design the notification system's template versioning — how do you update a template without breaking in-flight notifications?

Hard · ·

What is the purpose of a tracking pixel in email notifications?

Hard · ·

Your notification system needs to support A/B testing different push notification copy. How do you implement this?

Hard · ·

What is 'send time optimization' in notification systems?

Hard · ·

How do you handle a scenario where FCM rate limits your push notifications?

Hard · ·

How would you design notification preferences for a complex hierarchy: global mute → category mute → channel mute?

Hard · ·

What is the recommended way to handle a user who uninstalls your app but still has their device token in your database?

Hard · ·

How do you guarantee an OTP (one-time password) SMS is delivered within 30 seconds?

Hard · ·

What is the difference between transactional and marketing notifications? Why does it matter architecturally?

Hard · ·

What is 'notification deduplication window' and why is it important?

Hard · ·

Design: E-Commerce System (Amazon)

System Design Cases 22 questions

Why is Redis preferred for shopping cart storage over a relational database?

Hard · ·

A product has 10 units in stock. 100 users all click 'Buy' simultaneously. How do you prevent overselling?

Hard · ·

What is an idempotency key in payment processing?

Hard · ·

Why should raw credit card numbers never be stored in your e-commerce database?

Hard · ·

During Amazon Prime Day, your checkout service gets 10,000 orders/sec (normally 100/sec). How do you handle this?

Hard · ·

How do you handle the case where a user's payment succeeds but the order confirmation email fails to send?

Hard · ·

What data structure is best for Elasticsearch product faceted search (filters by brand, price range, category)?

Hard · ·

How do you keep Elasticsearch product index in sync with the DynamoDB product catalog?

Hard · ·

How would you design the order state machine for an e-commerce system?

Hard · ·

How do you shard the orders database to support efficient queries by both user_id and order_id?

Hard · ·

How do you handle cart merge when a guest user logs in to an existing account?

Hard · ·

How would you design a dynamic pricing system like Amazon's, where prices change multiple times per day?

Hard · ·

What is the 'saga pattern' and when is it used in e-commerce?

Hard · ·

A seller fraudulently lists 1,000,000 units of an iPhone at $1. How do you detect and prevent this?

Hard · ·

How do you implement product recommendations ('Customers who bought X also bought Y')?

Hard · ·

What approach prevents a user from seeing stale inventory counts in the product listing?

Hard · ·

How do you handle a product return and refund flow?

Hard · ·

How would you design a seller portal for inventory management at scale (millions of sellers)?

Hard · ·

What is the purpose of storing the price in the cart (price snapshot) at add time?

Hard · ·

How do you design a global e-commerce system where inventory is shared between multiple geographic fulfillment centers?

Hard · ·

How do you calculate and display shipping estimates accurately?

Hard · ·

What happens if the inventory reservation succeeds but the database write for the order record fails?

Hard · ·

Design: Video Streaming Platform (YouTube/Netflix)

System Design Cases 22 questions

Why is video transcoding necessary before streaming?

Hard · ·

What is HLS (HTTP Live Streaming)?

Hard · ·

Why are CDN cache TTLs set to very long (1 year) for video segments?

Hard · ·

A creator uploads a 2-hour 4K video. How do you transcode it in under 5 minutes?

Hard · ·

How does adaptive bitrate streaming decide which quality to serve?

Hard · ·

A viral video suddenly gets 10 million concurrent viewers. How does your CDN handle this?

Hard · ·

Why does YouTube use view count approximations (e.g., 1.2M views, not 1,234,567)?

Hard · ·

How do you implement 'resume from where you left off' for video playback?

Hard · ·

What is the purpose of a 'master playlist' in HLS?

Hard · ·

How do you detect and remove videos that violate copyright (like YouTube's Content ID)?

Hard · ·

How would you design the recommendation system to avoid the 'rabbit hole' effect (showing increasingly extreme content)?

Hard · ·

What is 'pre-fetching' in video streaming and why does it matter?

Hard · ·

How do you handle video thumbnail generation at scale?

Hard · ·

Why is progressive download (HTTP byte-range) inferior to HLS/DASH for streaming?

Hard · ·

A transcoding job for a 3-hour movie takes 45 minutes. How do you parallelize it?

Hard · ·

How would you design the analytics pipeline to show creators 'audience retention' — which second of their video viewers drop off?

Hard · ·

How do you handle a creator deleting a video that is currently being watched by 100,000 users?

Hard · ·

What metric best indicates whether your video streaming quality is good?

Hard · ·

How would you design automatic subtitle/caption generation for every uploaded video?

Hard · ·

How would you design a video search system that understands what's in the video (not just title/tags)?

Hard · ·

What is 'time-to-first-frame' and why is it critical for video platforms?

Hard · ·

How do you implement 'chapters' in YouTube videos (click to jump to specific sections)?

Hard · ·

Design: Search Autocomplete (Google)

System Design Cases 22 questions

What data structure is primarily used for efficient prefix-based autocomplete?

Hard · ·

Why is SQL LIKE 'app%' insufficient for autocomplete at Google scale?

Hard · ·

What is the 'top-K cache at each node' optimization in a trie?

Hard · ·

How do you update the trie when query frequencies change, without causing serving errors?

Hard · ·

Why should autocomplete requests be debounced on the client side?

Hard · ·

How do you detect and boost trending queries in autocomplete?

Hard · ·

How do you handle race conditions when a user types quickly and multiple autocomplete requests are in-flight?

Hard · ·

How would you implement personalized autocomplete without violating user privacy?

Hard · ·

What caching layer can serve 80% of autocomplete traffic without hitting the application server?

Hard · ·

How do you support autocomplete in Chinese, which uses thousands of unique characters?

Hard · ·

How would you design autocomplete for voice search (spoken query autocomplete)?

Hard · ·

What is the time complexity of finding top-5 suggestions for a given prefix in an optimized trie with top-K caching?

Hard · ·

A user searches for inappropriate content and it starts showing up as an autocomplete suggestion. How do you handle this?

Hard · ·

What is the trade-off between trie depth limit and suggestion quality?

Hard · ·

What is an alternative to trie for autocomplete that Redis supports natively?

Hard · ·

How do you handle the autocomplete system when a major news event causes a new query ('earthquake 2024') to need immediate autocomplete support?

Hard · ·

How would you design autocomplete for a domain-specific search (e.g., medical queries) vs general web search?

Hard · ·

How frequently should the trie be updated from new query frequency data?

Hard · ·

How do you estimate the memory needed to store a trie for the top 1 million English search queries?

Hard · ·

How would you design a spell-correction feature that works alongside autocomplete?

Hard · ·

What is 'query normalization' in the context of building autocomplete frequency data?

Hard · ·

How would you scale autocomplete to 3 million requests per second (10x Google's current scale)?

Hard · ·

Design: Distributed Key-Value Store (Redis/DynamoDB)

System Design Cases 22 questions

What does the CAP theorem state?

Hard · ·

What is the advantage of consistent hashing over modulo hashing for data distribution?

Hard · ·

For N=3 replicas, W=2 writes, R=2 reads: is strong consistency achieved?

Hard · ·

Two clients simultaneously write different values to the same key on two different nodes (network partition). How do you resolve this conflict?

Hard · ·

What is the purpose of virtual nodes (vnodes) in consistent hashing?

Hard · ·

Explain the LSM-tree write path and why it's faster than B-tree for write-heavy workloads.

Hard · ·

What is a Bloom filter used for in an LSM-tree based KV store?

Hard · ·

A node fails and recovers after 2 hours. How do you ensure it has consistent data?

Hard · ·

What is 'eventual consistency' in a distributed KV store?

Hard · ·

How does the gossip protocol help detect node failures in a distributed KV store?

Hard · ·

What is 'hinted handoff' and what problem does it solve?

Hard · ·

How do you implement TTL expiration for 1 billion keys without scanning all of them every second?

Hard · ·

What are CRDTs and when should a KV store use them instead of last-write-wins?

Hard · ·

What is the purpose of a Write-Ahead Log (WAL) in a KV store?

Hard · ·

Your KV store cluster needs to add 10 new nodes to increase capacity. How do you do this without downtime?

Hard · ·

When would you choose a KV store over a relational database? Give three specific scenarios.

Hard · ·

What problem does Merkle tree anti-entropy solve in a distributed KV store?

Hard · ·

A client reads a key and gets an old value because it hit a stale replica. How do you detect and fix this?

Hard · ·

What is the difference between a cache (like Redis) and a persistent KV store (like DynamoDB)? When do you use each?

Hard · ·

In the Raft consensus algorithm used by etcd, what is a 'leader election'?

Hard · ·

Design a geo-distributed KV store where users in Europe must see EU data, and US users see US data (data residency requirements).

Hard · ·

How do you handle a 'hot key' problem where one key (e.g., a celebrity's profile) gets 1 million reads per second?

Hard · ·

Design: Ride-Sharing Service (Uber/Lyft)

System Design Cases 22 questions

Why is Euclidean (straight-line) distance insufficient for ETA calculation in a ride-sharing app?

Hard · ·

Why must neighboring geohash cells also be queried when searching for nearby drivers?

Hard · ·

A driver's phone GPS has a 30-second outage. What happens to ongoing trip tracking?

Hard · ·

What Redis data structure is used to store driver locations by geographic cell?

Hard · ·

How does surge pricing work and how do you ensure it's fair to riders?

Hard · ·

The system matches 10 drivers to the same rider request due to a bug. How do you prevent this?

Hard · ·

How do you handle a rider requesting a ride in a very dense area (airport) with 100 simultaneous requests?

Hard · ·

How do you scale the location service to handle 500,000 driver updates per second?

Hard · ·

What communication protocol is used to push driver location updates to the rider app in real time?

Hard · ·

How do you detect and prevent GPS spoofing (a driver faking their location)?

Hard · ·

How does the app show an accurate ETA for driver arrival that updates in real time?

Hard · ·

A driver rejects a ride offer. What happens next?

Hard · ·

How do you implement 'share my trip' safety feature that lets a rider share live location with a contact?

Hard · ·

How would you design the ML system for proactive driver positioning (predicting where demand will be)?

Hard · ·

What geospatial precision (geohash length) should be used for finding drivers within 2km?

Hard · ·

How do you handle a trip that goes through a tunnel with no GPS signal?

Hard · ·

What is the difference between H3 and Geohash for geospatial indexing? When would you use each?

Hard · ·

How does the system ensure a driver is charged the correct distance even if their GPS has gaps?

Hard · ·

How would you design a pool/shared ride matching system where two riders going the same direction share a car?

Hard · ·

How do you build the driver rating system to prevent gaming?

Hard · ·

What database is most appropriate for storing driver location history for audit and analytics purposes?

Hard · ·

A major event (concert) ends and 50,000 people simultaneously request rides. How does the system handle this?

Hard · ·

Design: Social Media Platform (Instagram)

System Design Cases 22 questions

Why are multiple image size variants (thumbnail, medium, large) generated for each uploaded photo?

Hard · ·

How does Instagram handle the 'celebrity problem' where Selena Gomez (400M followers) posts a photo?

Hard · ·

How are Instagram Stories automatically deleted after 24 hours?

Hard · ·

A photo uploaded by a user is found to violate content policy 1 hour after posting. How do you handle this?

Hard · ·

How do you implement the 'story ring' — showing circles of friends who have active stories?

Hard · ·

How is the like count for a photo stored and retrieved at 49,000 likes/sec?

Hard · ·

How do you detect and prevent upload of child sexual abuse material (CSAM)?

Hard · ·

How would you design the 'close friends' feature where stories are shared with a select group?

Hard · ·

How do you store the follower graph for 2 billion users with an average of 200 follows each?

Hard · ·

How would you design the Instagram Explore page recommendation system?

Hard · ·

What is a perceptual hash (pHash) used for in image upload processing?

Hard · ·

A user with 10M followers posts a photo. How does it appear in followers' feeds?

Hard · ·

Why does Instagram use Cassandra for storing media metadata instead of MySQL?

Hard · ·

How do you implement 'suggested users to follow' based on social graph connections?

Hard · ·

What is the purpose of cursor-based pagination in Instagram's feed vs offset pagination?

Hard · ·

How do you handle video upload and playback at scale (Reels)?

Hard · ·

How would you design the 'tagged in a photo' feature and make it searchable?

Hard · ·

How does Instagram ensure images load quickly for users in slow network regions?

Hard · ·

A user deletes their Instagram account. What needs to happen to their data?

Hard · ·

How would you design a visual search feature ('search by image')?

Hard · ·

What technique prevents the same user from liking a photo multiple times?

Hard · ·

How would you design the hashtag trending system for Instagram?

Hard · ·

Design: Payment System (Stripe/PayPal)

System Design Cases 22 questions

What is an idempotency key in payment processing?

Hard · ·

Why should monetary amounts be stored as integers (cents) rather than floats?

Hard · ·

What is double-entry bookkeeping and why is it used in payment systems?

Hard · ·

The payment gateway times out after 10 seconds. You don't know if the charge succeeded. What do you do?

Hard · ·

What does PCI DSS require regarding storage of credit card numbers?

Hard · ·

How do you design webhook delivery to guarantee at-least-once delivery to merchants?

Hard · ·

A merchant has a chargeback rate of 2%. What action should the payment system take?

Hard · ·

Your payment processing system needs to handle a payment gateway outage. How do you design failover?

Hard · ·

Explain how a refund is processed end-to-end, including ledger entries.

Hard · ·

What is a payment 'authorization' vs 'capture'?

Hard · ·

How do you handle a situation where your internal ledger shows a different balance than the bank?

Hard · ·

What is HMAC-SHA256 signature verification used for in webhook delivery?

Hard · ·

How would you design a real-time fraud detection system that operates in <50ms?

Hard · ·

Two concurrent requests with the same idempotency key arrive simultaneously. How do you handle this?

Hard · ·

A merchant wants to implement a subscription billing system. How do you design this?

Hard · ·

How do you support multiple currencies in a payment system?

Hard · ·

What is a chargeback?

Hard · ·

How would you design instant payouts (money in merchant's bank within 30 seconds)?

Hard · ·

How would you design a marketplace payment system (like Airbnb) where payment flows through a platform to sellers?

Hard · ·

What is 3D Secure (3DS) authentication used for?

Hard · ·

What is the difference between a payment gateway and a payment processor?

Hard · ·

How do you implement payment retries safely when a customer's card is declined?

Hard · ·

Design: File Storage System (Google Drive/Dropbox)

System Design Cases 22 questions

Why is chunked upload better than single-file upload for large files?

Hard · ·

What hash function is used for block-level deduplication fingerprinting?

Hard · ·

User A edits a file on their laptop while offline. User B edits the same file online. When A reconnects, how do you handle the conflict?

Hard · ·

What is 'delta sync' and why does it matter?

Hard · ·

How does block-level deduplication work when the same file is uploaded by 1000 users?

Hard · ·

How do you implement real-time collaborative editing (multiple users editing same doc simultaneously) like Google Docs?

Hard · ·

How do you handle permissions when a folder is shared with 'view' access but contains a subfolder with 'edit' access for a different user?

Hard · ·

How do you implement chunk garbage collection safely?

Hard · ·

What is content-defined chunking (CDC) and how does it improve deduplication?

Hard · ·

A user accidentally deletes a folder with 10,000 files. How do you implement 'restore from trash'?

Hard · ·

How do you design the sync service to handle a user with 10 devices?

Hard · ·

How are large file downloads made efficient and resumable?

Hard · ·

How do you implement enterprise file retention / legal hold (e-discovery)?

Hard · ·

What is the purpose of storing a content hash (SHA-256) for the entire file separately from chunk hashes?

Hard · ·

What strategy does Dropbox use for conflict resolution when two users edit the same file simultaneously?

Hard · ·

How do you implement file sharing via a public link (anyone with link can view)?

Hard · ·

How would you design cross-region replication for file storage to ensure durability?

Hard · ·

What is tiered storage and why does it matter for a file storage service?

Hard · ·

How do you handle a user uploading 10,000 small files (1KB each) simultaneously?

Hard · ·

How do you implement versioning with a retention limit (e.g., keep only last 30 versions)?

Hard · ·

Why is the file sync service better implemented with WebSocket notifications rather than polling?

Hard · ·

How do you implement data loss prevention (DLP) — detecting when sensitive data (credit cards, SSNs) is uploaded?

Hard · ·

Design: Distributed Task Scheduler (Cron at Scale)

System Design Cases 22 questions

Why is a single-server cron scheduler not suitable for production at scale?

Hard · ·

What is the purpose of leader election in a distributed task scheduler?

Hard · ·

A worker picks up a task and starts executing. The worker crashes mid-execution. What happens?

Hard · ·

What is the 'thundering herd' problem in a task scheduler?

Hard · ·

How do you calculate the next_run_at for a cron expression after a successful execution?

Hard · ·

What Redis command is used to implement a distributed lock for exactly-once task execution?

Hard · ·

You have 1 million tasks due in the next second (month-end batch processing). How do you handle this?

Hard · ·

How do you implement a dead letter queue (DLQ) for tasks that exhaust all retries?

Hard · ·

What is the difference between 'at-least-once' and 'exactly-once' task execution?

Hard · ·

How would you design task dependency — Task B runs only after Task A completes successfully?

Hard · ·

Why must the database index on tasks include both next_run_at AND status?

Hard · ·

A task is supposed to run every minute, but due to a 5-minute outage, 5 executions were missed. What should happen on recovery?

Hard · ·

What types of task execution does a scheduler need to support (HTTP callback, etc.)?

Hard · ·

What happens if the ZooKeeper cluster used for leader election goes down?

Hard · ·

How do you implement a 'paused' state for a recurring task that should not execute during system maintenance?

Hard · ·

How do you design the scheduler to guarantee task execution within 1 second of scheduled time at scale?

Hard · ·

What is 'jitter' in the context of retry strategies?

Hard · ·

A task has max_execution_time of 5 minutes but the external service it calls hangs indefinitely. What happens?

Hard · ·

How would you implement task deduplication — ensuring a task that should run once per day doesn't accidentally run twice?

Hard · ·

A recurring task has been running every minute for a year. It has 525,600 execution log entries. How do you manage this data growth?

Hard · ·

How would you design a multi-tenant scheduler where thousands of different teams use the same infrastructure?

Hard · ·

Why should a task scheduler use atomic database operations (UPDATE with WHERE clause) when claiming tasks?

Hard · ·

TypeScript

Programming Languages 32 questions

What is the difference between type and interface in TypeScript?

Medium-Easy · Understand · open_ended

What does Partial<T> do?

Easy · Remember · Multiple Choice

Implement MyPartial<T> from scratch using mapped types.

Medium-Hard · Analyze · open_ended

What is a discriminated union? Give an example.

Medium · Apply · open_ended

What does the infer keyword do in a conditional type?

Medium-Hard · Analyze · open_ended

What is the difference between unknown and any?

Medium · Apply · open_ended

What does keyof T produce?

Medium-Easy · Understand · Multiple Choice

What is a type predicate and when do you use it?

Medium · Apply · open_ended

Implement DeepReadonly<T> — makes all nested properties readonly.

Hard · Evaluate · open_ended

What is never in TypeScript and when does it appear?

Medium · Apply · open_ended

What does enabling strictNullChecks do?

Medium-Easy · Understand · open_ended

What is the difference between Omit<T, K> and Exclude<T, K>?

Medium · Analyze · open_ended

Implement Awaited<T> — unwrap a Promise type recursively.

Hard · Evaluate · open_ended

What is structural typing? How does it differ from nominal typing?

Medium-Easy · Understand · open_ended

What is a mapped type? Write an example.

Medium-Hard · Analyze · open_ended

What does as const do?

Medium-Easy · Understand · open_ended

What is declaration merging?

Medium · Apply · open_ended

What does ReturnType<typeof fn> evaluate to if fn is () => Promise<User[]>?

Medium · Apply · Multiple Choice

Implement a Result<T, E> type for error handling without exceptions.

Medium-Hard · Analyze · open_ended

What is a conditional type? Write the syntax.

Medium · Apply · open_ended

What happens to TypeScript types at runtime?

Easy · Remember · Multiple Choice

What is an ambient declaration?

Medium · Apply · open_ended

What is a template literal type? Give an example.

Medium-Hard · Analyze · open_ended

Implement Extract<T, U> using conditional types.

Medium-Hard · Analyze · open_ended

What is the excess property checking rule?

Medium · Apply · open_ended

What does Parameters<T> return?

Medium-Easy · Understand · Multiple Choice

What is a branded type and why is it useful?

Medium-Hard · Analyze · open_ended

What is the satisfies operator in TypeScript?

Medium-Hard · Analyze · open_ended

How do you enforce exhaustive switch statements with TypeScript?

Medium-Hard · Analyze · open_ended

What is the difference between interface extending interface and type intersecting type?

Medium-Hard · Analyze · open_ended

What is covariance vs contravariance in TypeScript?

Hard · Evaluate · open_ended

What is the difference between type narrowing with typeof vs instanceof?

Medium · Apply · open_ended

Node.js

Backend 31 questions

What are the 6 phases of the Node.js event loop in order?

Medium-Easy · Understand · open_ended

What is the execution order? ```javascript setTimeout(() => console.log('A'), 0); setImmediate(() => console.log('B')); process.nextTick(() => console.log('C')); Promise.resolve().then(() => console.log('D')); ```

Medium-Hard · Analyze · predict_output

What is backpressure in Node.js streams?

Medium · Apply · open_ended

What is the difference between process.nextTick and setImmediate?

Medium · Apply · open_ended

What is the difference between cluster and worker_threads?

Medium · Apply · open_ended

What are the 4 types of Node.js streams?

Easy · Remember · Multiple Choice

What is middleware in Express and what is its function signature?

Medium-Easy · Understand · open_ended

Implement a rate limiter middleware using an in-memory counter.

Medium-Hard · Analyze · open_ended

What is prototype pollution in Node.js and how do you prevent it?

Medium-Hard · Analyze · open_ended

What is graceful shutdown in Node.js?

Medium · Apply · open_ended

What is the difference between CommonJS require() and ESM import?

Medium-Easy · Understand · open_ended

How do you prevent blocking the Node.js event loop?

Medium · Apply · open_ended

What is the purpose of the Node.js cluster module?

Medium-Easy · Understand · open_ended

Implement a promisify function that converts Node.js-style callbacks to Promises.

Medium-Hard · Analyze · open_ended

What is the SIGTERM signal and how should a Node.js app handle it?

Medium · Apply · open_ended

What are the three parts of a JWT token?

Easy · Remember · open_ended

What is the Node.js libuv thread pool and when is it used?

Medium-Hard · Analyze · open_ended

What is the difference between Fastify and Express?

Medium · Apply · open_ended

How does Node.js handle concurrent connections if it's single-threaded?

Medium · Apply · open_ended

What is the difference between child_process and worker_threads?

Medium · Analyze · open_ended

Implement a middleware that logs request duration.

Medium · Apply · open_ended

What is Redis and why is it used with Node.js?

Medium-Easy · Understand · open_ended

What happens when you call next(err) in Express middleware?

Medium-Easy · Understand · open_ended

What is PM2 and what does it provide over running node app.js directly?

Medium-Easy · Understand · open_ended

What is the buffer pool in Node.js streams and why does it matter?

Medium-Hard · Analyze · open_ended

Implement a simple EventEmitter from scratch in Node.js style.

Medium-Hard · Analyze · open_ended

What is the difference between http and https modules in Node.js?

Easy · Remember · open_ended

What is SQL injection and how do you prevent it in Node.js?

Medium · Apply · open_ended

How would you debug a memory leak in a Node.js production application?

Medium-Hard · Analyze · open_ended

What is the purpose of the 'helmet' package in Express?

Medium-Easy · Understand · open_ended

What is CORS and how do you handle it in Express?

Medium-Easy · Understand · open_ended

Python

Programming Languages 32 questions

What is the output? ```python def f(x=[]): x.append(1) return x print(f()) print(f()) ```

Medium · Apply · predict_output

What is the GIL and why does it matter for Python concurrency?

Medium · Apply · open_ended

What does `functools.wraps` do and why is it important in decorators?

Medium-Easy · Understand · open_ended

What is the difference between a generator and a list comprehension?

Medium-Easy · Understand · open_ended

Implement a decorator that caches function results (memoization) without using functools.lru_cache.

Medium-Hard · Analyze · open_ended

What is Python's MRO (Method Resolution Order) and how does Python compute it?

Medium-Hard · Analyze · open_ended

What is the output? ```python x = [1, 2, 3] y = x y.append(4) print(x) ```

Easy · Remember · predict_output

When would you choose asyncio over threading in Python?

Medium · Apply · open_ended

What does `yield from` do in a generator?

Medium · Apply · open_ended

What is the difference between `__str__` and `__repr__`?

Medium-Easy · Understand · open_ended

Which method is called when you do `len(obj)`?

Easy · Remember · Multiple Choice

What is the difference between `deepcopy` and `copy`?

Medium-Easy · Understand · open_ended

What is a Python Protocol and how does it differ from an abstract base class (ABC)?

Medium-Hard · Analyze · open_ended

What is `__slots__` and what are its tradeoffs?

Medium · Apply · open_ended

Implement a context manager using `contextlib.contextmanager` that measures execution time.

Medium · Apply · open_ended

What is the difference between `is` and `==` in Python?

Easy · Remember · open_ended

What is the output? ```python funcs = [lambda: i for i in range(3)] print([f() for f in funcs]) ```

Medium-Hard · Analyze · predict_output

How does `asyncio.gather` differ from `asyncio.wait`?

Medium · Apply · open_ended

What does `@property` do and when should you use it?

Medium-Easy · Understand · open_ended

What is the difference between `*args` and `**kwargs`?

Easy · Remember · open_ended

Explain how Python's garbage collection works.

Medium · Apply · open_ended

What is the difference between a class method and a static method?

Medium-Easy · Understand · open_ended

What does `if __name__ == '__main__':` do?

Easy · Remember · open_ended

What is a descriptor in Python?

Hard · Evaluate · open_ended

How would you make a class iterable?

Medium-Easy · Understand · open_ended

What is the purpose of `__init_subclass__`?

Hard · Evaluate · open_ended

True or False: Python lists are implemented as dynamic arrays.

Easy · Remember · true_false

What is `collections.OrderedDict` and is it still relevant in Python 3.7+?

Medium-Easy · Understand · open_ended

What is the output? ```python a = (1, [2, 3], 4) a[1].append(5) print(a) ```

Medium · Apply · predict_output

Explain Python's `super()` and when you would use it.

Medium · Apply · open_ended

What are Python's built-in exceptions hierarchy top-level classes?

Medium-Easy · Remember · open_ended

Arrange these in the order Python's name lookup follows them: Local → Global → Built-in → Enclosing

Medium-Easy · Understand · ordering

Git & DevOps

Software Engineering 29 questions

What is the difference between `git merge` and `git rebase`?

Medium · Apply · open_ended

What does `git reset --hard HEAD~1` do?

Medium-Easy · Understand · open_ended

What is a Docker layer and how does layer caching work?

Medium-Easy · Understand · open_ended

What is the difference between `git revert` and `git reset`?

Medium-Easy · Understand · open_ended

What does CI/CD stand for and what is its purpose?

Easy · Remember · open_ended

What is a multi-stage Docker build and why is it useful?

Medium · Apply · open_ended

What is the purpose of `git stash`?

Easy · Remember · open_ended

What is the difference between `git pull` and `git fetch`?

Medium-Easy · Understand · open_ended

What is a Dockerfile `ENTRYPOINT` vs `CMD`?

Medium · Apply · open_ended

Explain the difference between Blue-Green and Rolling deployment strategies.

Medium · Apply · open_ended

What is `git bisect` and when would you use it?

Medium · Apply · open_ended

What is trunk-based development?

Medium-Easy · Understand · open_ended

What is `docker-compose.yml` used for?

Easy · Remember · open_ended

What is a Git tag and how does it differ from a branch?

Medium-Easy · Understand · open_ended

True or False: You should always use the latest tag when pulling Docker images in production.

Easy · Remember · true_false

What does `git cherry-pick` do?

Medium-Easy · Apply · open_ended

What is a GitHub Actions secret and how do you use it?

Medium-Easy · Apply · open_ended

What is the difference between COPY and ADD in a Dockerfile?

Medium-Easy · Understand · open_ended

What is a canary deployment?

Medium-Easy · Understand · open_ended

What does `git reflog` show?

Medium-Easy · Understand · open_ended

What is Infrastructure as Code (IaC) and why is it important?

Medium-Easy · Understand · open_ended

What is a CI/CD artifact and why should you build once, deploy many?

Medium · Apply · open_ended

What is `git reset HEAD~1` without `--hard`?

Medium-Easy · Understand · open_ended

What is the purpose of `.gitignore`?

Easy · Remember · open_ended

What is a Docker health check and why is it important in CI/CD?

Medium-Easy · Apply · open_ended

What is the difference between `git push --force` and `git push --force-with-lease`?

Medium · Apply · open_ended

What is a Kubernetes readiness probe vs a liveness probe?

Medium · Apply · open_ended

Arrange these Git commands in the order of a typical feature branch workflow: push, commit, checkout -b, pull request, add, merge

Medium-Easy · Apply · ordering

What is a `.dockerignore` file?

Easy · Remember · open_ended

Software Design Patterns

Software Engineering 15 questions

Which SOLID principle does Factory support?

Medium-Easy · Understand · Multiple Choice

Decorator vs inheritance?

Medium · Analyze · open_ended

When should you NOT use Singleton?

Medium · Apply · open_ended

What is CQRS?

Medium-Hard · Understand · open_ended

Identify the anti-pattern: class ReportManager handles auth, data fetching, PDF generation, and email.

Medium · Analyze · open_ended

What is the key structural difference between Decorator and Proxy patterns?

Medium · Analyze · Multiple Choice

Which scenario is the Command pattern BEST suited for?

Medium-Easy · Apply · Multiple Choice

In Clean Architecture, which layer is at the innermost core and has ZERO dependencies on outer layers?

Medium-Easy · Understand · Multiple Choice

A developer builds an OrderService that directly instantiates MySQLDatabase, SMTPEmailer, and StripePayment inside its methods. Which anti-pattern does this represent?

Medium-Easy · Analyze · Multiple Choice

What is the key difference between Simple Factory and Abstract Factory?

Medium · Analyze · Multiple Choice

What is the primary advantage of Software Design Patterns?

Medium · · Multiple Choice

When should you NOT use Software Design Patterns?

Medium · · Multiple Choice

What is the time complexity of the core operation in Software Design Patterns?

Medium · · Multiple Choice

How does Software Design Patterns handle failures?

Medium · · Multiple Choice

Which company popularized the use of Software Design Patterns?

Medium · · Multiple Choice

Back-of-Envelope Estimation

System Design 20 questions

What is 2^30 in human-readable form?

Easy · Remember · Multiple Choice

How many seconds are in a day (used in QPS estimation)?

Easy · Remember · Multiple Choice

An app has 100M DAU and each user makes 10 requests per day. What is the average QPS?

Medium-Easy · Apply · Multiple Choice

Peak QPS is typically what multiple of average QPS for consumer apps?

Easy · Remember · Multiple Choice

Write QPS is 1,000 and each record is 500 bytes. How much storage is generated per day?

Medium-Easy · Apply · Multiple Choice

A 3-way replicated database has 100 TB of raw data with 50 TB of indexes. What is the total disk needed?

Medium · Apply · Multiple Choice

Read QPS is 80,000 and each response is 2 KB. What is egress bandwidth?

Medium-Easy · Apply · Multiple Choice

How many app servers do you need for 50,000 peak QPS if each handles 2,000 req/s with 30% headroom?

Medium · Apply · Multiple Choice

What is the approximate throughput of a single Redis instance?

Easy · Remember · Multiple Choice

A cache stores the hot 20% of 100M objects, each 1 KB. How much RAM is needed (with 20% overhead)?

Medium · Apply · Multiple Choice

Twitter has 300M DAU, 1 tweet/user/day. What is peak write QPS? (3× peak multiplier)

Medium · Apply · Multiple Choice

Why is Uber's location write QPS dramatically higher than Twitter's tweet write QPS?

Medium-Hard · Analyze · Multiple Choice

YouTube uploads 500 hours of video per minute. Roughly how many CPU cores are needed for transcoding (5 quality levels, 3× real-time encode)?

Hard · Evaluate · Multiple Choice

What is the latency difference between an L1 cache hit and a spinning disk seek?

Medium-Easy · Understand · Multiple Choice

What storage tier should hold data older than 1 year in a system with a 3-year retention requirement?

Medium · Apply · Multiple Choice

Your system has 10K write QPS and 200K read QPS. Which architecture decision does this directly inform?

Medium-Hard · Analyze · Multiple Choice

What is the critical difference between designing for average QPS versus peak QPS?

Medium-Easy · Understand · Multiple Choice

A social graph has 500M users, each with an average of 500 connections. How many rows are in the edge table?

Medium · Apply · Multiple Choice

Why does egress bandwidth typically cost more than ingress bandwidth in cloud systems?

Medium · Understand · Multiple Choice

Uber has 5M active drivers sending GPS every 4 seconds. Which technology is most appropriate as a write buffer before the location store?

Medium-Hard · Evaluate · Multiple Choice

Apache Kafka

Distributed Systems 20 questions

What is the maximum number of consumers in a consumer group that can actively consume from a topic with 6 partitions?

Medium-Easy · Understand · Multiple Choice

A producer sends a message with acks=all to a topic with replication.factor=3 and min.insync.replicas=2. Two brokers fail simultaneously. What happens?

Medium-Hard · Apply · Multiple Choice

Which Kafka configuration ensures a consumer reads only messages from committed transactions?

Medium · Remember · Multiple Choice

Explain what the ISR (In-Sync Replicas) set represents and why it matters for durability.

Medium · Explain · open_ended

What happens to ordering guarantees when a Kafka producer has max.in.flight.requests.per.connection=5 and retries > 0 but enable.idempotence=false?

Medium-Hard · Analyze · Multiple Choice

What is consumer group rebalancing and name two events that trigger it?

Medium-Easy · Remember · open_ended

Which producer configuration is required when enable.idempotence=true?

Medium · Remember · Multiple Choice

A topic has replication.factor=3. The leader broker for a partition crashes. Under what condition can Kafka elect a new leader without data loss?

Medium-Hard · Analyze · open_ended

What is the role of the __consumer_offsets topic in Kafka?

Medium-Easy · Remember · Multiple Choice

Describe the difference between at-least-once, at-most-once, and exactly-once delivery semantics in Kafka.

Medium-Hard · Evaluate · open_ended

What is a Kafka partition?

Medium-Easy · · Multiple Choice

What guarantees does Kafka provide for message ordering?

Medium · · Multiple Choice

What is a consumer group in Kafka?

Medium · · Multiple Choice

What happens when a Kafka consumer crashes?

Medium · · Multiple Choice

What is the difference between acks=0, acks=1, and acks=all?

Medium-Hard · · Multiple Choice

What is Kafka's retention policy?

Medium · · Multiple Choice

What is the role of ZooKeeper in Kafka?

Medium · · Multiple Choice

How does Kafka achieve high throughput?

Medium-Hard · · Multiple Choice

What is a dead letter queue (DLQ) in Kafka?

Medium · · Multiple Choice

What is exactly-once semantics in Kafka?

Hard · · Multiple Choice

AWS Cloud Services

Cloud Computing 15 questions

Which AWS feature provides automatic failover for RDS within the same region when the primary DB instance fails?

Medium-Easy · Remember · Multiple Choice

An S3 presigned URL is generated server-side. Which of the following is true about its security?

Medium · Understand · Multiple Choice

What is a Lambda cold start, and which configuration reduces it most effectively for latency-sensitive workloads?

Medium · Apply · open_ended

You have a DynamoDB table with userId as partition key. You need to query orders by status across all users. What do you add?

Medium · Apply · Multiple Choice

What is the difference between a Security Group and a Network ACL (NACL) in a VPC?

Medium · Analyze · open_ended

Which SQS queue type guarantees exactly-once processing and strict message ordering?

Medium-Easy · Remember · Multiple Choice

What is the purpose of a NAT Gateway and where must it be placed?

Medium-Easy · Understand · open_ended

In AWS IAM, what is an IAM Role and how does it differ from an IAM User?

Medium-Easy · Understand · open_ended

An application processes images uploaded to S3. Which architecture is most cost-effective and scalable?

Medium-Hard · Evaluate · Multiple Choice

What is the purpose of a DynamoDB GSI's projection and how does it affect cost?

Medium-Hard · Analyze · open_ended

What is the primary advantage of AWS Cloud Services?

Medium · · Multiple Choice

When should you NOT use AWS Cloud Services?

Medium · · Multiple Choice

What is the time complexity of the core operation in AWS Cloud Services?

Medium · · Multiple Choice

How does AWS Cloud Services handle failures?

Medium · · Multiple Choice

Which company popularized the use of AWS Cloud Services?

Medium · · Multiple Choice

Kubernetes & Docker

DevOps & Containers 15 questions

What is the key difference between a Docker image and a Docker container?

Easy · Remember · Multiple Choice

In a Dockerfile, why should you COPY package.json and run npm install BEFORE copying the rest of the source code?

Medium-Easy · Understand · open_ended

Which Docker networking mode allows a container to share the host machine's network stack directly, without NAT?

Medium-Easy · Remember · Multiple Choice

What is the purpose of the 'depends_on' key with 'condition: service_healthy' in Docker Compose?

Medium · Apply · open_ended

Which Kubernetes control plane component is responsible for scheduling pods onto nodes?

Medium-Easy · Remember · Multiple Choice

Explain the difference between a Kubernetes Deployment's 'maxSurge' and 'maxUnavailable' rolling update parameters.

Medium · Understand · open_ended

What is the difference between a ClusterIP and a NodePort Service in Kubernetes?

Medium-Easy · Understand · Multiple Choice

Why should you run container processes as a non-root user in production Dockerfiles?

Medium · Apply · open_ended

What does 'kubectl rollout undo deployment/myapp' do?

Medium-Easy · Apply · Multiple Choice

What is the role of an Ingress controller in Kubernetes, and how does it differ from an Ingress resource?

Medium-Hard · Analyze · open_ended

What is the primary advantage of Kubernetes & Docker?

Medium · · Multiple Choice

When should you NOT use Kubernetes & Docker?

Medium · · Multiple Choice

What is the time complexity of the core operation in Kubernetes & Docker?

Medium · · Multiple Choice

How does Kubernetes & Docker handle failures?

Medium · · Multiple Choice

Which company popularized the use of Kubernetes & Docker?

Medium · · Multiple Choice

JavaScript & TypeScript

Programming Languages 20 questions

What will the following code log? ```js console.log(typeof null); ```

Easy · Remember · multiple_choice

What is the output of: `console.log(0.1 + 0.2 === 0.3)`?

Medium-Easy · Understand · multiple_choice

Which of the following creates a SHALLOW copy of an object?

Medium-Easy · Understand · multiple_choice

What does the `in` operator check for in JavaScript?

Medium-Easy · Understand · multiple_choice

In TypeScript, what does the `never` type represent?

Medium · Understand · multiple_choice

What is the output order of this code? ```js console.log('A'); setTimeout(() => console.log('B'), 0); Promise.resolve().then(() => console.log('C')); console.log('D'); ```

Medium · Analyze · multiple_choice

What does `Array.prototype.reduce()` return when called on an empty array without an initial value?

Medium-Easy · Remember · multiple_choice

What is the difference between `==` and `===` in JavaScript?

Easy · Understand · short_answer

Which TypeScript utility type makes all properties of T optional?

Easy · Remember · multiple_choice

What is a WeakMap and when should you use it?

Medium · Analyze · short_answer

What is the output of: typeof null?

Medium-Easy · · Multiple Choice

What is closure in JavaScript?

Medium · · Multiple Choice

What is the event loop in Node.js?

Medium · · Multiple Choice

What is the difference between let, const, and var?

Medium-Easy · · Multiple Choice

What does Promise.all() do?

Medium · · Multiple Choice

What is the purpose of TypeScript's 'unknown' type?

Medium-Hard · · Multiple Choice

What is the difference between map() and forEach()?

Medium-Easy · · Multiple Choice

What is debouncing?

Medium · · Multiple Choice

What does Object.freeze() do?

Medium · · Multiple Choice

What is tree-shaking?

Medium · · Multiple Choice

React & Next.js

Frontend 15 questions

HTML & CSS

Frontend 15 questions

Which HTML element should you use for the primary navigation of a website?

Easy · Remember · multiple_choice

What is the total width of an element with: width: 200px, padding: 20px, border: 5px, box-sizing: content-box?

Medium-Easy · Apply · multiple_choice

Which property controls how flex items are distributed along the MAIN axis?

Easy · Remember · multiple_choice

What does the alt attribute on an image do when left empty (alt='')?

Medium-Easy · Understand · multiple_choice

Which CSS selector has the HIGHEST specificity?

Medium-Easy · Analyze · multiple_choice

What is the purpose of aria-live='polite' on an element?

Medium-Easy · Understand · multiple_choice

Which approach correctly implements a mobile-first responsive design?

Medium-Easy · Apply · multiple_choice

What is the minimum color contrast ratio required for normal text under WCAG 2.1 Level AA?

Medium-Easy · Remember · multiple_choice

Which CSS property is safe to animate for smooth 60fps performance?

Medium-Easy · Understand · multiple_choice

What does the :focus-visible pseudo-class do differently from :focus?

Medium · Analyze · short_answer

What is the primary advantage of HTML & CSS?

Medium · · Multiple Choice

When should you NOT use HTML & CSS?

Medium · · Multiple Choice

What is the time complexity of the core operation in HTML & CSS?

Medium · · Multiple Choice

How does HTML & CSS handle failures?

Medium · · Multiple Choice

Which company popularized the use of HTML & CSS?

Medium · · Multiple Choice

Spring Boot

Programming Languages 15 questions

NoSQL Databases

Databases 15 questions

Which NoSQL database type is best suited for storing a social network graph where you need to traverse friend-of-friend relationships?

Medium-Easy · Application · Multiple Choice

In the CAP theorem, which two properties does MongoDB prioritize?

Medium-Easy · Knowledge · Multiple Choice

What is the correct order of stages in a MongoDB aggregation pipeline to optimize performance?

Medium · Application · Multiple Choice

In DynamoDB single-table design, what is the main reason to store multiple entity types in one table?

Medium · Understanding · Multiple Choice

Which Redis command would you use to implement an atomic 'check-and-set' distributed lock?

Medium · Application · Multiple Choice

What is the ESR rule in MongoDB compound index design?

Medium · Knowledge · Multiple Choice

What happens to data written to a Cassandra node during a network partition in an AP configuration?

Medium-Hard · Analysis · Multiple Choice

Which embedding pattern should you use when a blog post can have millions of comments?

Medium · Application · Multiple Choice

What is the difference between a DynamoDB GSI and LSI?

Medium · Understanding · Multiple Choice

What is eventual consistency in the context of a distributed NoSQL database?

Medium-Easy · Understanding · Multiple Choice

What is the primary advantage of NoSQL Databases?

Medium · · Multiple Choice

When should you NOT use NoSQL Databases?

Medium · · Multiple Choice

What is the time complexity of the core operation in NoSQL Databases?

Medium · · Multiple Choice

How does NoSQL Databases handle failures?

Medium · · Multiple Choice

Which company popularized the use of NoSQL Databases?

Medium · · Multiple Choice

RDBMS & SQL

Databases 15 questions

Which JOIN type returns all rows from the left table and matched rows from the right table, filling NULLs where there is no match?

Easy · Understand · Multiple Choice

What is the difference between RANK() and DENSE_RANK() window functions when there are ties?

Medium-Easy · Understand · Multiple Choice

What type of index should you use for a column that is only ever queried with exact equality checks (e.g., WHERE user_id = 42)?

Medium-Easy · Apply · Multiple Choice

Which ACID property guarantees that a committed transaction's data survives a system crash?

Easy · Understand · Multiple Choice

At which isolation level can 'phantom reads' occur — where a transaction re-runs a query and finds new rows inserted by another committed transaction?

Medium · Analyze · Multiple Choice

A table has columns: order_id (PK), customer_id, customer_name, product_id, product_name, quantity. Which normal form violation does this represent?

Medium · Analyze · Multiple Choice

In PostgreSQL, what is the advantage of JSONB over the JSON data type?

Medium-Easy · Understand · Multiple Choice

A query runs slowly. EXPLAIN ANALYZE shows a Sequential Scan on a 10-million-row table for WHERE email = 'alice@example.com'. What is the best fix?

Medium-Easy · Apply · Multiple Choice

What does the LAG() window function return?

Medium-Easy · Apply · Multiple Choice

Which SQL clause filters groups AFTER aggregation, and what is the equivalent clause that filters rows BEFORE aggregation?

Easy · Understand · Multiple Choice

What is the primary advantage of RDBMS & SQL?

Medium · · Multiple Choice

When should you NOT use RDBMS & SQL?

Medium · · Multiple Choice

What is the time complexity of the core operation in RDBMS & SQL?

Medium · · Multiple Choice

How does RDBMS & SQL handle failures?

Medium · · Multiple Choice

Which company popularized the use of RDBMS & SQL?

Medium · · Multiple Choice

Ready to ace your next interview?

Practice with adaptive quizzes, timed interviews, code playground, and detailed explanations — all free, no signup required.