Atlassian Interview Questions
- DSA
- LLD
- HLD
Q1: Employee Directory Hierarchy – Lowest Common Ancestor (LCA)
In a large company like Atlassian, employees are organized into groups and subgroups (e.g., “Frontend → Engineering → Technology”). Every employee belongs to one subgroup. Given two employees, the task is to find the closest parent group (Lowest Common Ancestor) they share in the hierarchy. The structure is like a tree, and the LCA represents the smallest common node between both employees’ paths.
For concurrent updates, you can implement Read-Write locks to ensure thread safety during modifications.
Example:
If Alice belongs to “Frontend → Engineering” and Lisa belongs to “Backend → Engineering”, their lowest common ancestor group is “Engineering”.
Q2: Robot Delivery Routes – Graph Traversal
In a robotic factory, delivery robots follow specific one-way paths between rooms. Each path is represented as a directed edge from a source node to a destination. You must identify all starting locations (no incoming edges) and compute every reachable destination from each. This is a graph traversal problem that can be solved using DFS or BFS to explore all reachable paths.
Example:
Given paths = [[“A”,”B”], [“A”,”C”], [“C”,”G”], [“G”,”H”], [“G”,”I”]],
starting from A, robots can reach H and I. Hence, { “A”: [“H”, “I”] }.
Q3: Network Service Latency – Dijkstra’s Algorithm
You’re managing a network of services with different connection latencies between them. For multiple queries, each asking the minimum latency from Service X to Y, you must find the shortest weighted path. Since edge weights vary, Dijkstra’s Algorithm is ideal — it ensures minimal travel time by exploring shortest distances first using a priority queue (min-heap).
Example:
If Service A → B = 2ms, B → C = 3ms, A → C = 10ms,
then the shortest path from A to C is A → B → C = 5ms.
Q4: Snake Game Implementation
Design the classic snake game where a snake moves across a 2D grid, grows every few moves, and dies if it collides with itself. The snake starts with a length of 3 and increases by one every 5 moves. Use a Deque to store snake positions (head at back, tail at front) and a HashSet for quick collision checks. Implement movement in four directions and detect game-over scenarios efficiently.
Example:
Snake starts at (2,2), moves RIGHT → RIGHT → DOWN → LEFT → UP.
If it revisits (2,2), the game ends due to self-collision.
Q5: Content Popularity Tracker
You need to design a system that tracks how popular various pieces of content are in real-time. Each piece of content can have its popularity increased or decreased, and the system should return the most popular one instantly. To achieve this efficiently, use a HashMap (content → score) combined with a TreeMap (score → set of contentIds) to maintain sorted order.
Example:
If increasePopularity(“Post1”) twice and increasePopularity(“Post2”) once,
then mostPopular() returns “Post1”.
Q6: Stock Price Fluctuation / Commodity Prices
In stock tracking systems, price updates may arrive out of order, but the user always wants to know the current, maximum, or minimum price instantly. You can use a HashMap to store timestamp → price and a TreeMap to track all price values in sorted order. The latest timestamp gives the current price, and TreeMap methods like firstKey() and lastKey() give the min/max efficiently.
Example:
If input = {(1,100), (3,120), (2,90)},
then max = 120, min = 90, current = 120.
Q7: Word Wrap Problem
Given a string and a maximum line length, the goal is to wrap words into lines so that each line’s total length doesn’t exceed maxLen. Words should not be split in the middle, and lines are separated using ‘-‘. This problem teaches greedy algorithms and string manipulation.
Example:
Input: “Data Structures and Algorithms”, maxLen = 10
Output: “Data-Stru-ctures-and-Algo-rithms”
Q8: Text Justification
You are to format text so that every line has exactly the same width, distributing spaces evenly between words. This is a popular interview problem used to test string manipulation and space balancing logic. Use greedy packing for words, then calculate how many spaces must go between each.
Example:
Input: words = [“This”, “is”, “AI”, “driven”], maxWidth = 12
Output: “This is AI”, “driven “
Q9: Robot Parts Assembly
A factory produces robots, each requiring a specific combination of parts. Given available parts and robot requirements, determine which robots can be built. Represent each part set as a HashSet and use subset checking to verify feasibility.
Example:
Available parts = {A, B, C, D}
Robot1 needs {A, B}, Robot2 needs {A, E} → Only Robot1 can be assembled.
Q10: Cinema Scheduling
A cinema operates between 10 AM to 11 PM. Given movie durations and existing bookings, check if a new movie can be scheduled without overlap. Each movie has a start and end time. Sort all movies by start time and verify using interval comparison logic.
Example:
Existing: (10–12), (12:30–3), (3:30–6).
New movie (6–8) → ✅ possible; (11–1) → ❌ invalid (beyond closing time).
Q11: Tennis Court Booking
You’re managing tennis court bookings with fixed maintenance windows. Given multiple booking requests (start, end times), determine how many courts are needed to accommodate all players without conflicts. Use a min-heap to track current end times (similar to “Meeting Rooms II”).
Example:
Bookings = [(9,10), (9:30,11), (10,11)] → Requires 2 courts.
Q12: Collections Size Calculator
Given a collection of lists, sets, or maps (possibly nested), calculate the size of each collection and return the top N by size. You can use recursion to count nested structures.
Example:
Input: [[“A”, “B”], [“C”, “D”, “E”], [“F”]]
Output: Top 2 → [[“C”, “D”, “E”], [“A”, “B”]]
Q13: N-ary Tree LCA
In an organizational or folder hierarchy with multiple children per node, find the lowest common ancestor (LCA) of two nodes. Unlike binary trees, each node may have many children, so DFS traversal is needed for all paths until a common ancestor is found.
Example:
Tree: CEO → [HR, Engg → [Frontend, Backend]]
LCA of Frontend & Backend → Engg
Q14: Voting System
Implement a voting system where people vote for candidates. You must maintain live vote counts and return the current leader efficiently. Use a HashMap for vote counts and a priority structure for ranking.
Example:
Votes = [“A”, “B”, “A”, “C”, “A”, “B”] → Leader = A
Q15: Rate Limiter
Design an API rate limiter that allows only a certain number of requests per user per time window (like 100 requests/min). Use a Queue or Sliding Window to record timestamps of recent requests. Drop or delay requests exceeding the limit.
Example:
If a user sends 5 requests in 2 seconds and limit is 3/sec → Last 2 requests are blocked.
Q16: Merge Intervals
Given a list of intervals where each interval represents a start and end time, your task is to merge all overlapping intervals into a minimal number of non-overlapping ones. This is a classic sorting-based problem that appears frequently in scheduling and time allocation applications. Sort all intervals by their start time, then merge overlapping ones while iterating.
Example:
Input: [(1,3), (2,6), (8,10), (9,11)]
Output: [(1,6), (8,11)] — because (1,3) and (2,6) overlap, as do (8,10) and (9,11).
Q17: Meeting Rooms II
You need to determine the minimum number of meeting rooms required for a set of meetings with given start and end times. Each meeting must have a separate room if its time overlaps with another. Use a min-heap to track the earliest ending meeting and assign new rooms when necessary.
Example:
Input: [(0,30), (5,10), (15,20)]
Output: 2 — first meeting overlaps with the second, so two rooms are needed.
Q18: Longest Substring Without Repeating Characters
Find the length of the longest substring in a given string that doesn’t contain repeating characters. Use the sliding window technique with a HashSet to store current characters and move the left boundary whenever duplicates appear.
Example:
Input: “abcabcbb”
Output: 3 (substring “abc” is the longest without repeats).
Q19: Minimum Window Substring
Given two strings, s and t, find the smallest window in s that contains all the characters of t. This is solved using the sliding window technique with two pointers and frequency counts.
Example:
Input: s = “ADOBECODEBANC”, t = “ABC”
Output: “BANC” — smallest window that contains all characters A, B, and C.
Q20: Valid Parentheses
Determine whether a string containing only parentheses ()[]{} is valid. The parentheses must close in the correct order. Use a stack to track open brackets and ensure every closing one matches the last opened.
Example:
Input: “{[()]}” → Valid
Input: “([)]” → Invalid (mismatched order).
Q21: Trapping Rain Water
Given an array representing elevation heights, calculate how much rainwater can be trapped between the bars. Use two pointers to track the left and right maximums as you move inward, calculating water volume dynamically.
Example:
Input: [0,1,0,2,1,0,1,3,2,1,2,1]
Output: 6 — total trapped units of water.
Q22: Product of Array Except Self
For a given array, return a new array where each element is the product of all numbers except the one at that index. You cannot use division. Use prefix and suffix products to achieve O(n) time and O(1) extra space.
Example:
Input: [1,2,3,4]
Output: [24,12,8,6].
Q23: Maximum Subarray (Kadane’s Algorithm)
Find the contiguous subarray with the largest sum in an integer array. Use Kadane’s Algorithm, which dynamically tracks the maximum subarray ending at each index by comparing the current number with the running sum.
Example:
Input: [-2,1,-3,4,-1,2,1,-5,4]
Output: 6 — subarray [4,-1,2,1].
Q24: Container With Most Water
You are given heights of vertical lines on an x-axis. Find two lines that together form a container holding the most water. Use a two-pointer approach starting from both ends, moving inward while tracking the maximum area.
Example:
Input: [1,8,6,2,5,4,8,3,7]
Output: 49 — formed by lines at indices 1 and 8.
Q25: 3Sum Problem
Find all unique triplets in an array that sum to zero. Sort the array and use two pointers to find pairs for each fixed element. Skip duplicates to ensure unique triplets.
Example:
Input: [-1,0,1,2,-1,-4]
Output: [[-1,-1,2], [-1,0,1]].
Q26: Coin Change
Given coin denominations and a total amount, find the minimum number of coins needed to make that amount. Use Dynamic Programming to build the minimum count for all sub-amounts.
Example:
Input: coins = [1,2,5], amount = 11
Output: 3 — (5 + 5 + 1).
Q27: Longest Increasing Subsequence
Find the length of the longest strictly increasing subsequence in an array. Use Dynamic Programming (DP) to compute LIS ending at each element, or apply binary search for O(n log n).
Example:
Input: [10,9,2,5,3,7,101,18]
Output: 4 — LIS is [2,3,7,101].
Q28: House Robber Problem
You are a thief with houses in a row, each containing some money. Adjacent houses cannot be robbed on the same night. Use Dynamic Programming to decide between robbing or skipping each house.
Example:
Input: [2,7,9,3,1]
Output: 12 — Rob houses with 2, 9, and 1.
Q29: Jump Game
Given an array where each element represents your maximum jump length from that position, determine if you can reach the last index. Use greedy traversal to track the farthest reachable position.
Example:
Input: [2,3,1,1,4] → True
Input: [3,2,1,0,4] → False.
Q30: Partition Equal Subset Sum
Check if an array can be divided into two subsets with equal sum. This is a variation of the 0/1 Knapsack problem, using DP to check if half of the total sum can be formed.
Example:
Input: [1,5,11,5] → True (subsets [11] and [1,5,5]).
Q31: Unique Paths
Find the number of unique paths from the top-left corner to the bottom-right corner of an m x n grid, moving only right or down. Use DP or combinatorics.
Example:
Input: m = 3, n = 7
Output: 28 possible paths.
Q32: Edit Distance
Find the minimum number of operations (insert, delete, replace) required to convert one string into another. Use Dynamic Programming to compare prefixes of both strings and build results iteratively.
Example:
Input: “horse” → “ros”
Output: 3 (replace h→r, remove r, remove e).
Q33: Best Time to Buy and Sell Stock
Given daily stock prices, find the maximum profit achievable from one buy and one sell. Use a single-pass approach to track the minimum price so far and current profit.
Example:
Input: [7,1,5,3,6,4]
Output: 5 (buy at 1, sell at 6).
Q34: Decode Ways
Given a numeric string where ‘A’=1 to ‘Z’=26, find how many ways it can be decoded. Use DP to count valid decodings by considering one or two digits at a time.
Example:
Input: “226”
Output: 3 — (“BZ”, “VF”, “BBF”).
Q35: Word Break
Check if a given string can be segmented into dictionary words. Use DP where each position checks if any previous substring is valid.
Example:
Input: “leetcode”, dict = [“leet”,”code”] → True.
Q36: LRU Cache
Design a cache with limited capacity that removes the least recently used item when full. Combine a HashMap for O(1) lookups with a Doubly Linked List for usage tracking.
Example:
If capacity = 2 → put(1,1), put(2,2), get(1), put(3,3) → evicts key 2.
Q37: LFU Cache
Similar to LRU, but removes the least frequently used item when the cache is full. Track usage count in a frequency map.
Example:
put(1,1), put(2,2), get(1), put(3,3) → evicts key 2 (least used).
Q38: Implement Trie (Prefix Tree)
Design a Trie for inserting, searching, and prefix checking words efficiently. Each node contains children and an end-of-word marker.
Example:
Insert “car”, “cat”. Search “car” → true; startsWith(“ca”) → true.
Q39: Add and Search Words (Wildcard Support)
Extend Trie to support ‘.’ wildcard character that matches any single letter. Implement recursive search for wildcard handling.
Example:
Insert “bad”, “dad”, “mad” → search(“.ad”) → true.
Q40: Median of Data Stream
Design a structure that continuously inserts numbers and returns the median efficiently. Use two heaps (max-heap for lower half, min-heap for upper half).
Example:
Insert [1,2,3] → Median = 2; Insert [1,2,3,4] → Median = (2+3)/2 = 2.5.
Q41: Top K Frequent Elements
Return the k most frequent elements from an array. Use a frequency map and a heap to extract top K efficiently.
Example:
Input: [1,1,1,2,2,3], k=2 → [1,2].
Q42: Kth Largest Element in an Array
Find the Kth largest element in an unsorted array using a min-heap or QuickSelect algorithm.
Example:
Input: [3,2,1,5,6,4], k=2 → 5.
Q43: Sliding Window Maximum
Find the maximum element in every window of size k in an array. Use a monotonic deque to maintain candidates in descending order.
Example:
Input: [1,3,-1,-3,5,3,6,7], k=3 → [3,3,5,5,6,7].
Q44: Binary Search in Rotated Array
Perform binary search on a sorted array that has been rotated at some pivot. Adjust the logic to decide which side is sorted.
Example:
Input: [4,5,6,7,0,1,2], target=0 → index 4.
Q45: Find Peak Element
Find an element greater than its neighbors using a modified binary search approach. There may be multiple peaks.
Example:
Input: [1,2,3,1] → Peak = index 2.
Q46: Course Schedule
Determine if you can finish all courses given prerequisites. This is a Topological Sort problem detecting cycles in a directed graph.
Example:
Input: [[1,0]] → True; [[1,0],[0,1]] → False (cycle).
Q47: Word Ladder
Transform one word into another by changing one letter at a time, using only words in a dictionary. Use BFS for shortest path.
Example:
Input: “hit” → “cog”, dict = [“hot”,”dot”,”dog”,”lot”,”log”,”cog”]
Output: 5 steps (hit→hot→dot→dog→cog).
Q48: Number of Islands
Given a 2D grid of ‘1’s (land) and ‘0’s (water), count the number of islands (connected lands). Use DFS/BFS to mark visited cells.
Example:
Input: 11110,11010,11000,00000
Output: 1.
Q49: Clone Graph
Given a reference to a node in a graph, return a deep copy of the graph. Use DFS or BFS with a visited map to avoid cycles.
Example:
Node1 → Node2 → Node3 (cycle back to 1) → cloned graph maintains same structure.
Q50: Serialize and Deserialize Binary Tree
Convert a binary tree into a string and back again. Use preorder traversal for serialization and reconstruct recursively for deserialization.
Example:
Tree: [1,2,3,null,null,4,5]
Serialized: “1,2,#,#,3,4,#,#,5,#,#”
Deserialized: reconstructs original tree.
Q1. Customer Support Agent Rating System
Design a system where customers can rate support agents on a scale of 1–5 stars. Each agent should have an average rating that updates dynamically as new ratings are submitted. The system should support features like sorting agents by average rating, exporting reports, and handling ties based on timestamp or total ratings. Using classes like Agent, Rating, and RatingSystem encourages modularity and testability.
Example:
If Agent A has ratings [5, 4, 3] and Agent B has [4, 4, 4], both have an average rating of 4, but Agent A may be ranked higher based on total count.
Q2. Middleware Router
Design a simple web router that maps URLs (routes) to results. The router should allow adding routes and retrieving responses based on incoming paths. As the system grows, you’ll extend it to handle wildcards (*) and path parameters (:id), ensuring route matching in order. Internally, you can use a Trie (prefix tree) for efficient path resolution.
Example:
router.addRoute(“/users/123/profile”, “User Profile”)
router.callRoute(“/users/123/profile”) → “User Profile”
Q3. Key-Value Store with Wildcards
Build a key-value storage system where keys represent paths (like /elonmusk/is/shit) and support wildcard searches. The get() method should match wildcards like * to return relevant entries. Using a Trie or hierarchical dictionary can efficiently resolve such queries. Exception handling ensures invalid or ambiguous paths are addressed gracefully.
Example:
put(“/elonmusk/is/shit”, “yes”)
get(“/elonmusk/is/*”) → “yes”
Q4. Cost Explorer for Subscriptions
Design a system to calculate and forecast subscription costs for various plans like BASIC, STANDARD, and PREMIUM. It should support features such as monthly billing, yearly projections, and prorated adjustments during plan upgrades or cancellations. Use the Strategy Pattern to calculate different pricing structures flexibly and extend for trial periods.
Example:
User on BASIC ($9.99/month) → yearly cost = $119.88.
Upgrading mid-year to PREMIUM adjusts future months accordingly.
Q5. Game of Snake (Detailed OOP)
Design the classic Snake Game using an object-oriented approach. The system should include classes for Position, Snake, GameBoard, and Direction. The snake moves within a 2D grid, grows on consuming food, and ends when it collides with itself or the wall. Maintain the body as a deque, and track occupied positions in a set for quick collision detection.
Example:
Start at (2,2) → move RIGHT → RIGHT → eat food → grows to length 4.
Q6. Content Popularity Tracker
Extend the popularity tracking system with advanced operations like maintaining the most popular items across multiple categories, exporting reports, and tracking historical trends. Use HashMap for real-time tracking and TreeMap for ranking. Updates should be thread-safe if real-time updates are frequent.
Example:
increasePopularity(“ArticleA”) → 5; increasePopularity(“ArticleB”) → 7;
mostPopular() → “ArticleB”.
Q7. Tennis Court Booking System
Design a booking system for tennis courts that handles player reservations, maintenance windows, and court availability. Each court can have multiple bookings throughout the day, but overlapping bookings are not allowed. Implement classes for Court, Booking, and Scheduler, using a min-heap or timeline logic to allocate courts efficiently.
Example:
Booking 1: 9–10 AM, Booking 2: 9:30–10:30 AM → need 2 courts.
Q8. Employee Directory System
Create a system that maintains an organization’s hierarchical structure of departments and employees. It should allow CRUD operations for both entities and support queries like “find manager of employee” or “get team members under a specific lead.” Internally, a tree-like or graph-based data model represents relationships.
Example:
CEO → Engineering → Backend → Alice.
Query for Alice’s manager returns “Backend Lead.”
Q9. Commodity Price Tracker
Develop a tracker for real-time commodity prices like gold or crude oil. Prices may change frequently, and users should be able to query the current, highest, and lowest values instantly. Use HashMap for timestamp-price mapping and TreeMap for sorted price queries.
Example:
Updates: (1, 2000), (2, 1980), (3, 2050) → max = 2050, min = 1980.
Q10. Movie Theater Management System
Design a system that manages multiple movie screens, showtimes, and reservations. The system should prevent double-bookings, calculate occupancy rates, and handle customer seat selections dynamically. Use classes like Screen, Show, and Booking.
Example:
Screen 1 shows “Inception” 10–12; booking seats [A1, A2] marks them unavailable for others.
Q11. Robot Factory System
Design a system that manages robot parts and their assemblies. Each robot requires a predefined list of parts, and the system should determine which robots can be built given current inventory. Use object composition to represent robots and available components.
Example:
Parts: [Arm, Leg, CPU];
Robot “Alpha” needs [Arm, Leg, CPU] → ✅ can be assembled.
Q12. Parking Lot System
Create a parking management system supporting multiple levels and different vehicle types (car, bike, truck). It should allocate the nearest available slot and calculate charges based on vehicle type and duration.
Example:
Car enters at 10:00, exits at 12:00 (₹20/hr) → total ₹40.
Q13. Library Management System
Design a system for managing books, members, borrowings, and returns. Include features like fine calculation for late returns and book search by title, author, or genre. Use classes for Book, Member, and Transaction.
Example:
Book “1984” borrowed on Jan 1, returned on Jan 10 (5-day limit) → fine for 5 extra days.
Q14. Hotel Booking System
Implement a hotel reservation system handling room availability, bookings, check-ins, and check-outs. It should calculate prices based on room type and season, and prevent overlapping reservations.
Example:
Deluxe Room booked from 1–3 March → cannot rebook until after checkout on 3 March.
Q15. Elevator System
Design an elevator control system managing multiple elevators across floors. The scheduler decides which elevator serves each request efficiently. It should optimize for minimal waiting time and direction consistency.
Example:
Request at floor 3 going up → assign elevator nearest and moving upward.
Q16. File System
Design a file system supporting directory creation, file addition, deletion, and hierarchical traversal. Implement permission controls and metadata tracking. A tree-based structure with nodes representing directories/files works best.
Example:
Create /root/docs/report.txt → retrieving /root/docs lists report.txt.
Q17. Splitwise / Expense Sharing System
Build a system where users can share group expenses and calculate how much each person owes or is owed. Maintain transactions and settle balances efficiently using a ledger.
Example:
A paid ₹300 for a group of 3 → B and C owe ₹100 each.
Q18. Tic-Tac-Toe Game
Create a simple 3×3 Tic-Tac-Toe game that allows two players to take turns. Implement board representation, move validation, and win detection logic.
Example:
Player X wins with diagonal [0,0] → [1,1] → [2,2].
Q19. Chess Game
Design a Chess game with full movement rules for each piece. Represent the board as an 8×8 matrix and create classes for pieces (Pawn, Rook, Knight, etc.) that follow polymorphic move logic.
Example:
Knight moves in “L” shape, Bishop moves diagonally, King one step any direction.
Q20. Calendar / Meeting Scheduler
Build a meeting scheduler that detects overlapping meetings and suggests available time slots. It should support multiple users, recurring events, and time zones.
Example:
Meetings: (10–11), (10:30–12) → conflict detected; suggest 12–1.
Q21. Online Shopping Cart
Design a shopping cart system that supports adding/removing products, applying discounts, and proceeding to checkout. Each cart belongs to a customer session and must persist state temporarily.
Example:
Add [Shoes ₹2000, Shirt ₹1000], Apply 10% coupon → Total ₹2700.
Q22. Cache System (LRU/LFU)
Implement a caching mechanism to store key-value pairs with capacity limits. Use LRU (Least Recently Used) or LFU (Least Frequently Used) eviction policy based on usage history.
Example:
Capacity=2 → put(1,1), put(2,2), get(1), put(3,3) → evicts key 2.
Q23. Logger Framework
Create a logging framework that supports different levels (INFO, ERROR, DEBUG) and outputs (console, file). Allow filtering messages by severity and configuring appenders dynamically.
Example:
Logger.log(INFO, “Process started”) → prints to console.
Q24. Notification System
Build a notification system that sends messages through multiple channels — email, SMS, and push notifications. Use a Strategy Pattern for message delivery and ensure retry mechanisms for failures.
Example:
Notification: “Payment received” → sent via email and push simultaneously.
Q25. Task Scheduler
Implement a system that schedules and executes tasks based on priority or time. Use a priority queue for efficient execution order. It should also handle delayed or periodic jobs.
Example:
Tasks = [(printA, 2s), (printB, 1s)] → executes printB before printA.
Q26. URL Shortener
Design a system like bit.ly that converts long URLs into short codes. Ensure uniqueness, fast lookups, and collision avoidance. Use hashing and base62 encoding.
Example:
Input: www.example.com/article → Output: bit.ly/Ab12Xy.
Q27. Chat System
Build a one-to-one and group chat system. Support sending, receiving, and storing messages with timestamps. Implement message queues for scalability.
Example:
A → B: “Hey!” → Stored in chat history and marked as “seen”.
Q28. Payment Gateway
Create a payment processing system to handle transactions, refunds, and validations securely. It should integrate with multiple banks and support rollback on failure.
Example:
User pays ₹500 → Transaction success → Receives receipt ID.
Q29. Recommendation Engine
Design a system that recommends products based on user preferences, ratings, or behavior. Implement collaborative or content-based filtering logic.
Example:
User watches “Inception” → Recommendation: “Interstellar”, “Tenet”.
Q30. Search Autocomplete
Develop an autocomplete feature for search queries using a Trie structure. The system should suggest words as the user types.
Example:
Input: “pro” → Suggestions: “project”, “problem”, “progress”.
Q31. Auction System
Design an auction platform that manages bids, bidders, and items. The system must update the highest bid in real time and close auctions on time.
Example:
Item = “Laptop” → Bids = ₹5000, ₹6000 → Winner = ₹6000.
Q32. Traffic Signal System
Design a signal controller for multiple intersections. Each light cycles through states (Green, Yellow, Red) with synchronized timing logic.
Example:
Intersection 1: Green → Intersection 2: Red → Coordination ensures smooth traffic.
Q33. ATM Machine
Simulate ATM behavior with operations like withdraw, deposit, and balance inquiry. The system should verify PIN, manage cash denominations, and handle insufficient funds gracefully.
Example:
Withdraw ₹1500 → Dispense ₹1000+₹500 notes → Update balance.
Q34. Vending Machine
Build a vending machine that allows item selection, payment processing, and dispensing. Include inventory tracking and refund logic. Use the State Pattern to handle operational states.
Example:
Insert ₹50 → Select “Soda ₹40” → Dispense item → Return ₹10.
Q35. Snake and Ladder Game
Create the classic Snake and Ladder game using a board representation. The system should manage player turns, dice rolls, and snake/ladder jumps.
Example:
Roll = 4 → Moves from 2 → 6 → Ladder to 15 → Continue.
Q1. Tag Management System
Design a cross-product tagging service that lets users add, remove, and update tags on content across different products (e.g., Jira, Confluence, Bitbucket). The system should provide APIs to list content by tag, compute popular tags, and present dashboards with aggregated metrics. Key challenges include multi-tenant data modeling, permission checks, high read throughput for tag lookups, eventual consistency for analytics, and caching hot tags. Use event-driven ingestion to build popularity counts and a denormalized read model for fast queries.
Example:
A user tags a Confluence doc with #security; the tag service stores the relation, updates a popularity cache, and /tags/security/content returns the doc almost instantly.
Q2. Web Scraping System (Image URL Extractor)
Design a scalable web crawler that extracts image URLs from a set of input websites. The system accepts crawl jobs, orchestrates distributed workers, respects robots.txt, and de-duplicates URLs. Core components include a job API, a scheduler/queue, worker pool, URL frontier with politeness rules, and a results store. For scale you shard domains across workers, use rate limiting per host, and stream results to an indexer. Also implement job monitoring and incremental crawls to avoid reprocessing unchanged pages.
Example:
POST /jobs with [“example.com”] spawns workers which fetch pages, extract <img> src, dedupe URLs, and the job result lists unique image links.
Q3. Facebook-Style Friend Count Feature
Add a real-time friend-count metric to content pages that shows the number of friends who reacted or are connected. The design must scale to billions of users and millions of updates. Use a write path that logs relationship changes/events, an offline batch job or stream processor to maintain per-user friend counts, and a read cache (CDN/edge cache) for low-latency reads. Consider denormalization (materialized counters), consistent hashing for sharding, and eventual consistency trade-offs for freshness versus cost.
Example:
When Alice and Bob become friends, a background event increments Alice’s friend-count shard; user feeds show updated counts shortly after.
Q4. Collaborative Document Editor (Google Docs Clone)
Design a collaborative editor allowing many users to concurrently edit a document. Key problems include low-latency updates, conflict resolution, and ordering of edits. Use Operational Transformation (OT) or Conflict-free Replicated Data Types (CRDTs) to merge concurrent changes. Components include an edit server (WebSocket or WebRTC), change logs, persistence layer, and a presence/leader election system for coordination. For scale, partition documents, use causal ordering, and snapshot versions to reduce replay costs.
Example:
Two users insert text at similar positions; OT transforms one operation to preserve both changes, keeping the document consistent for both users.
Q5. Twitter-Style Hashtag and Trending System
Design a system to track hashtags, serve search queries, and compute trending topics in near real-time. The solution should ingest a high-volume event stream (posts), normalize hashtags, and update counters that feed a trending ranker. Use approximate data structures (Count-Min Sketch, HyperLogLog) for memory efficiency, and windowed aggregations for recency-aware trends. Provide APIs to query trends, historical popularity, and filter by geography or topic. Address hot-spot mitigation by sharding and caching.
Example:
When thousands of posts mention #bigmatch, stream processors increment time-windowed counters and the trending API surfaces it in “Top 10 Today”.
Q6. Color Picker Sharing App (End-to-End Design)
Build a web app where users pick a color swatch and share it with friends. Core flows: choose color, create a shareable link, and view others’ picks. Backend stores color metadata and viewer stats; frontend allows real-time previews. For scale, use a CDN for static assets, a short URL service for sharing, and caching for popular swatches. Add analytics for popular palettes and optional authentication for personalized collections. Security concerns include preventing abusive link generation and rate-limiting share actions.
Example:
User picks #FF5733, clicks “Share”, and receives a short link that opens a preview page with metadata and creator info.
Q7. Hierarchical Data Storage System
Design a system for storing hierarchical (tree) data with support for multiple roots, children, and terminal/leaf indicators. Operations include adding children, listing descendants, and moving subtrees. Data modeling can be adjacency lists, nested sets, or materialized paths depending on performance needs. For read-heavy systems, precompute ancestor lists or caches; for write-heavy, choose adjacency with indexes. Support pagination for deep listings and permission checks for node access.
Example:
Store taxonomy where /products/electronics/phones returns children and marks leaf nodes like /products/electronics/phones/feature-phone as terminal.
Q8. Popular Content Feed (Confluence-style Popular Feed)
Create a popular feed that ranks content by engagement signals (views, likes, comments) and recency. The design uses an ingestion pipeline to capture events, a scoring function combining weighted signals and time decay, and an aggregation service to compute per-product and global leaderboards. For latency, precompute top-K lists and cache them; for personalization, intersect global signals with user preferences. Ensure the system can detect and mitigate spammy amplification.
Example:
A doc with many comments and recent views gets a higher score and appears on top of the popular widget for users in the same workspace.
Q9. Music Streaming — Scaling & Consistent Hashing
Design a music streaming service focusing on distribution, storage, and user requests. Key challenges include serving audio with low latency, handling popularity spikes, and distributing load geographically. Use CDNs for static audio delivery, consistent hashing for storing metadata and personalized recommendations, and stream processors for analytics. Consider replication strategies for hot songs, prefetching for low-latency playback, and backpressure for ingestion systems.
Example:
When a new hit is released, cache the first few minutes closer to users while gradually warming regional edge caches for full-track delivery.
Q10. Crossword Hints — Server vs Device Trade-offs
Design a hint system for crossword puzzles where hints may be fetched from the server or preloaded on the device. Server-side hints allow content control and dynamic updates; device-side caching reduces latency and supports offline play. Solve trade-offs by using ahead-of-time caching for likely puzzles, encrypted local storage, and server fallback for new hint types. Consider bandwidth constraints, hint personalization, and A/B testing of hint styles.
Example:
App preloads hints for five puzzles a user frequently opens; when an unfamiliar puzzle is opened, the app requests hints from the server.
Q11. Large XML Processing — Streaming Design
Design a system to process huge XML files that cannot fit into memory. Use streaming parsers (SAX/StAX) to parse elements incrementally, transform or extract data into a database, and maintain backpressure with queues. For heavy workloads, shard processing by splitting by top-level elements or using a map-reduce style pipeline. Ensure idempotency and checkpointing so if a worker fails, processing resumes from the last safe point.
Example:
A 200GB XML feed is processed by streaming workers that extract each <record> and write normalized rows into a partitioned database.
Q12. Smart Engine Budgeting — Capacity Estimation Service
Design a budgeting and capacity planning engine that estimates compute and storage needs based on usage patterns, seasonality, and projected growth. Components include a historical metrics store, forecasting models (moving averages, ARIMA), and a cost calculator using current pricing. Offer APIs for scenario simulation (e.g., 2x user growth), and recommend resource reservations. Ensure multi-tenant isolation and incorporate safety buffers.
Example:
Forecasting suggests 30% traffic surge in Q4; the engine recommends reserving additional cache capacity and scaling worker instances.
Q13. Social Media Scaling — Regional Expansion
Plan the architecture to expand a social media service from a single region to global scale. Consider data sovereignty, latency, and consistency models. Use multiple regional clusters, geo-replication, global load balancers, and edge caching. For cross-region writes, choose conflict resolution strategies; for user-local reads, prefer regional replicas. Also plan for rate limiting and incremental rollout.
Example:
User data resides in region A; a European user is routed to a local replica for reads, while writes are proxied and reconciled asynchronously to the master store.
Q14. Consistency Models — Strong vs Eventual
Design and compare systems where different components require differing consistency guarantees. Strong consistency ensures read-after-write semantics but has higher latency and coordination; eventual consistency offers higher availability and lower latency but can return stale reads. The design must choose models per use-case (e.g., payments use strong consistency; analytics use eventual), and provide techniques like read-repair, vector clocks, and conflict resolution for eventual systems.
Example:
Bank transfers use strong consistency to avoid double-spending; an activity feed uses eventual consistency where slight delays are acceptable.
Q15. Failed Request Recovery — Multi-Server Reconciliation
Design a system to detect and recover from failed requests across many servers. Use reliable logging, unique request IDs, and periodic reconciliation jobs that compare server logs with a canonical state. For missing items, requeue requests or replay idempotent operations. Instrumentation should detect anomalies and provide alerts. Ensure replay is safe (idempotent) and maintain ordering guarantees where required.
Example:
If server cluster A logged a successful batch write but the canonical DB lacks it, the reconciler replays the idempotent request to restore consistency.
Q16. Rate Limiter Design (Token Bucket / Sliding Window)
Design a distributed rate limiter offering per-user and per-API limits. Implement token-bucket for burst tolerance and sliding-window counters for smoother limits. For distributed deployment, use a centralized store (Redis) for atomic increments or approximate structures for high scale. Support multiple policies, quotas, and dynamic rule updates. Provide metrics and throttling responses that include retry-after headers.
Example:
User allowed 1000 requests/min; token bucket refills tokens periodically, permitting short bursts without violating the long-term rate.
Q17. URL Shortener at Scale
Design a stable, collision-resistant URL shortener. Use base62 encoding of sequential or hashed IDs, or distributed ID generators (Snowflake) for horizontal scaling. Implement redirect service, analytics, and link expiration. Use a cache for hot redirects and backup storage for persistence. Address abuse by rate-limiting link creation and scanning for malicious targets.
Example:
Long URL stored with ID 1254321 → base62 encoded to Ab12X; redirect service queries cache/db and issues HTTP 301 to the original URL.
Q18. News Feed System — Fan-out Strategies
Design a news/feed system that delivers posts to followers. Two main strategies: fan-out-on-write (push) writes to each follower’s feed at post time (fast reads, expensive writes), or fan-out-on-read (pull) computes feed at read time (cheap writes, expensive reads). Hybrid approaches use thresholds (high-follower users are pushed). Use queues, background workers, and caching for performance. Consider personalization and freshness.
Example:
A celebrity posts — system fans-out to millions asynchronously to precompute their followers’ feeds; a small user’s post may be computed at read time.
Q19. Notification Service (Push, Email, SMS)
Design a notification system supporting multiple channels with varying SLAs. The service should accept events, route them through a notification router, apply user preferences, and deliver via channel-specific adapters. Implement retries, exponential backoff, and dead-letter queues for persistent failures. Use batching for email, push gateways for mobile, and SMS providers with fallback providers.
Example:
Event “order shipped” triggers email + push; email adapter batches messages hourly while push is sent immediately with retries on transient failures.
Q20. Search Autocomplete System
Build an autocomplete service for search suggestions using tries or prefix indexes and a ranking layer that uses popularity and personalization. For scale, precompute top-k suggestions per prefix and store them in memory or an SSD-backed key-value store. Support typo tolerance, fuzzy matching, and TTL-based caching for trending suggestions. Incrementally update rankings with streaming metrics.
Example:
User types “jav” → service returns [“java”, “javascript”, “javadoc”] ranked by recent query popularity.
Q21. Web Crawler — Distributed, Polite, Deduped
Design a distributed web crawler with components for URL frontier, politeness scheduler, fetcher workers, parser, and deduplication. Use domain-based sharding to preserve politeness and a URL fingerprinting system to avoid duplicate fetches. Store snapshots and extracted metadata in a search index. Implement backoff for failing hosts and central monitoring for crawl health.
Example:
Crawl job for example.com queues URLs in the domain shard, workers fetch pages at regulated intervals and store unique images into the index.
Q22. Video Streaming — CDN & Adaptive Bitrate
Design a video streaming platform using a CDN for distribution and adaptive bitrate (ABR) streaming for smooth playback. Transcode videos into multiple bitrates, store manifests (HLS/DASH), and place segments in edge caches. The player monitors bandwidth and switches bitrates. Use origin servers for cache misses and analytics pipelines to monitor QoE and adjust caching policies.
Example:
User with slow connection initially plays 360p; as bandwidth increases, the player switches to 720p seamlessly using segmented manifests.
Q23. Ride Sharing Matching & Geospatial Indexing
Design a ride-sharing system that matches riders with drivers in real-time. Use geospatial indexes (R-trees, quadtrees, or geohash buckets) to locate nearby drivers and a matching algorithm that accounts for ETA, surge pricing, and driver preferences. Implement real-time telemetry, driver state machines, and fallback strategies for scarce driver density. Plan capacity for peak times and maintain fairness.
Example:
Rider requests a ride; the system finds the nearest available driver within a 3 km geohash bucket and offers the ride, updating both parties’ states.
Q24. Food Delivery — Order Management & Tracking
Design a food delivery system that handles restaurant menus, orders, driver dispatch, and real-time tracking. Key flows include order placement, kitchen notification, driver assignment, and ETA updates. Use event-driven queues for asynchronous steps, optimize route allocation for drivers, and provide resilient retry mechanisms for failed deliveries. Include pricing, commissions, and refunds systems.
Example:
User places order → kitchen confirms → dispatcher assigns nearest driver → real-time map shows driver approach.
Q25. E-commerce Platform — Inventory & Checkout
Build an e-commerce backend supporting product catalogs, inventory, shopping carts, and checkout. Must handle inventory reservations during checkout to avoid overselling, support promotions, and integrate with payment gateways. Use CQRS to separate read-heavy product catalogs from write-heavy ordering flows, and eventual consistency for non-critical views. Implement idempotent order submission and reconciliation for payment failures.
Example:
Two users attempt to purchase the last item; the system reserves stock per checkout attempt and ensures only one order completes.
Q26. Distributed Cache — Replication and Consistent Hashing
Design a distributed cache (like memcached or Redis cluster) with consistent hashing for key distribution and replication for fault tolerance. Support cache invalidation, TTLs, and client libraries that handle node topology changes. Consider read/write quorums and replication lag. Provide metrics and auto-rebalancing when nodes are added or removed.
Example:
A key maps to shard node A; when node A fails, consistent hashing routes keys to node B until recovery, minimizing remapped keys.
Q27. Message Queue System (Kafka-like)
Design a distributed message queue with partitioning, replication, ordered delivery semantics within partitions, and retention policies. Core components: producers, brokers, partition leader election, consumers with offset tracking, and a durable storage layer. Support ordering, high throughput, and consumer groups for parallel processing. Implement optimistic replication and leader failover to ensure availability.
Example:
Producer writes to topic orders partitioned by order_id; consumer group processes partitions in parallel while maintaining per-partition ordering.
Q1. Tell me about a time your first impression was incorrect
Interviewers want to see your self-awareness, openness, and ability to challenge assumptions. They assess whether you can admit mistakes in judgment and how you adjust once you have more information. Show humility and curiosity — it’s not about being wrong, but how you course-correct.
Example:
You assumed a quiet teammate wasn’t engaged, but later realized they were deeply analytical and presented strong solutions. You changed your approach and began involving them earlier in discussions.
Q2. Time you had a different point of view from a teammate
They test your ability to respectfully disagree, support your reasoning, and reach alignment. Explain how you listened, debated based on data, and reached consensus without hurting collaboration.
Example:
You and a designer disagreed on UI complexity — you preferred simplicity, they wanted visual flair. You ran a quick A/B test and decided based on results rather than opinion.
Q3. Time you gave someone constructive feedback
This question examines your communication and empathy. It’s about how you share feedback that helps others improve, not hurt morale. Focus on being specific, respectful, and actionable.
Example:
You noticed a teammate’s code lacked comments. You privately shared examples of clear documentation, encouraged consistent commenting, and later praised them when improvement was visible.
Q4. Time you told your manager work wouldn’t ship on time
They look for accountability and honesty under pressure. Explain how you raised the issue early, offered alternative timelines, or reduced scope responsibly.
Example:
While building an API, you discovered performance issues. Instead of hiding delays, you informed your manager, prioritized a partial release, and documented improvements for the next sprint.
Q5. Business situation where you couldn’t be completely honest
This explores ethical balance and confidentiality handling. Sometimes you cannot reveal sensitive data but must maintain transparency.
Example:
You were aware of an upcoming organizational restructure but couldn’t share details. You reassured the team about ongoing projects and morale without breaking confidentiality.
Q6. Example of receiving criticism
Shows how you react to feedback — defensively or constructively. Reflect on learning, not hurt.
Example:
A reviewer said your documentation was hard to follow. You thanked them, rewrote sections with better examples, and later received praise for clarity.
Q7. Time you made an unpopular decision
Tests leadership and conviction. Sometimes the right choice isn’t popular but necessary for project success.
Example:
You removed a flashy but unstable feature to meet release deadlines. Although some team members disagreed, the stable release earned customer appreciation.
Q8. Time you screwed something up at work
They want ownership, accountability, and lessons learned. Focus on what you did afterward.
Example:
You accidentally deployed a staging config to production. You immediately owned it, rolled back changes, documented the incident, and created a checklist to avoid future mistakes.
Q9. Time you balanced competing priorities
Demonstrates prioritization and decision-making under pressure. Show trade-offs between speed, quality, or scope.
Example:
You balanced fixing bugs with building new features. You convinced stakeholders to spend one sprint stabilizing core functionality before resuming new development.
Q10. Project where passion was the driving force
They’re checking what motivates you beyond tasks — your personal connection to work.
Example:
You built a mentoring portal for new engineers because you struggled onboarding early in your career. The project became a company-wide success.
Q11. Time you built something from beginning to end
Tests ownership, vision, and ability to execute full lifecycle projects — from idea to deployment.
Example:
You designed, coded, tested, and deployed a performance monitoring tool yourself, documenting and iterating after early feedback.
Q12. Example of pushing to understand why someone made a decision
Shows intellectual curiosity and empathy for others’ perspectives.
Example:
You questioned why a PM delayed a release. After discussion, you realized it aligned with a partner launch date — improving overall product visibility.
Q13. Time you made a decision without all information
Tests judgment under ambiguity. Explain how you mitigated risk, validated quickly, and adjusted later.
Example:
A server issue occurred, and logs were incomplete. You chose to restart a service to prevent outages, then later analyzed data to confirm root cause.
Q14. Time scope changed mid-project
Checks adaptability. Explain how you reprioritized and kept morale intact.
Example:
Midway through development, stakeholders added new API endpoints. You adjusted sprint goals, delegated tasks efficiently, and delivered MVP on time.
Q15. Time you had to stop working on a project before completion
Tests maturity — knowing when to pivot.
Example:
A chatbot project you led was paused when user adoption was low. You documented learnings and reused components in a new helpdesk assistant that succeeded.
Q16. Time you overcommitted yourself or your team
Assesses self-awareness and boundary management.
Example:
You agreed to multiple sprint goals, realizing mid-cycle it risked burnout. You reprioritized deliverables and learned to buffer for unexpected tasks.