Zomato Placement Papers 2024
Practice Zomato placement papers 2024 with coding questions, DSA problems, and complete solutions.
Practice Zomato coding questions with detailed solutions. Previous year DSA problems, system design questions, and behavioral questions from Zomato placement papers with step-by-step explanations.
This comprehensive collection contains Zomato coding questions from previous year placement papers with detailed solutions. Practice these problems to master Zomato’s coding section covering DSA, system design, and behavioral questions.
| Parameter | Details |
|---|---|
| Total Problems | 2-3 DSA problems |
| Time Allocated | 90-120 minutes |
| Difficulty | Medium to Hard |
| Languages Allowed | Java, C++, Python, Go |
| Platform | HackerRank or Zomato’s internal tool |
| Additional | Debugging questions |
Q1: Maximum Sum Subarray (Kadane’s Algorithm)
Problem: Find the contiguous subarray with the largest sum.
Example: Input: [-2, 1, -3, 4, -1, 2, 1, -5, 4], Output: 6 (subarray [4, -1, 2, 1])
Solution:
def max_subarray_sum(arr): max_sum = float('-inf') current_sum = 0 for num in arr: current_sum += num if current_sum > max_sum: max_sum = current_sum if current_sum < 0: current_sum = 0 return max_sumExplanation: Use Kadane’s algorithm - maintain current sum and reset to 0 if negative. Time: O(n), Space: O(1)
Answer: 6
Q2: Shortest Path in Graph (Dijkstra’s Algorithm)
Problem: Find shortest path from source to destination in a weighted graph.
Example: Graph with nodes A, B, C, D and edges (A→B: 1), (A→C: 4), (B→C: 2), (C→D: 1), (B→D: 5). Shortest path from A to D: A→B→C→D (cost: 4)
Solution:
#include <vector>#include <queue>#include <climits>
int dijkstra(vector<vector<pair<int, int>>>& graph, int src, int dest) { int n = graph.size(); vector<int> dist(n, INT_MAX); priority_queue<pair<int, int>, vector<pair<int, int>>, greater<pair<int, int>>> pq;
dist[src] = 0; pq.push({0, src});
while (!pq.empty()) { int u = pq.top().second; int d = pq.top().first; pq.pop();
if (u == dest) return d; if (d > dist[u]) continue;
for (auto& edge : graph[u]) { int v = edge.first; int w = edge.second; if (dist[u] + w < dist[v]) { dist[v] = dist[u] + w; pq.push({dist[v], v}); } } } return dist[dest];}Explanation: Use priority queue to always process node with minimum distance. Time: O((V+E)logV), Space: O(V)
Answer: 4
Q3: Coin Change Problem
Problem: Find minimum number of coins to make given amount.
Example: coins = [1, 2, 5], amount = 11. Output: 3 (5 + 5 + 1)
Solution:
int coinChange(vector<int>& coins, int amount) { vector<int> dp(amount + 1, amount + 1); dp[0] = 0; for (int i = 1; i <= amount; i++) { for (int coin : coins) { if (coin <= i) { dp[i] = min(dp[i], dp[i - coin] + 1); } } } return dp[amount] > amount ? -1 : dp[amount];}Explanation: DP approach - for each amount, try all coins and take minimum. Time: O(amount × coins), Space: O(amount)
Answer: 3
Q4: Binary Tree Level Order Traversal
Problem: Traverse binary tree level by level.
Example: Tree [3,9,20,null,null,15,7] → [[3], [9,20], [15,7]]
Solution:
def levelOrder(root): if not root: return [] result = [] queue = [root] while queue: level = [] size = len(queue) for _ in range(size): node = queue.pop(0) level.append(node.val) if node.left: queue.append(node.left) if node.right: queue.append(node.right) result.append(level) return resultExplanation: Use BFS with queue, process each level. Time: O(n), Space: O(n)
Answer: [[3], [9,20], [15,7]]
Q5: Two Sum Problem
Problem: Given array and target, find indices of two numbers that sum to target.
Example: nums = [2,7,11,15], target = 9 → [0,1]
Solution:
def twoSum(nums, target): hash_map = {} for i, num in enumerate(nums): complement = target - num if complement in hash_map: return [hash_map[complement], i] hash_map[num] = i return []Explanation: Use hash map to store seen numbers. Time: O(n), Space: O(n)
Answer: [0, 1]
Q6: Longest Palindromic Substring
Problem: Find longest palindrome substring.
Example: “babad” → “bab” or “aba”
Solution:
def longestPalindrome(s): def expand(l, r): while l >= 0 and r < len(s) and s[l] == s[r]: l -= 1 r += 1 return s[l+1:r]
result = "" for i in range(len(s)): odd = expand(i, i) even = expand(i, i+1) result = max(result, odd, even, key=len) return resultExplanation: Expand around center for odd/even length palindromes. Time: O(n²), Space: O(1)
Answer: “bab” or “aba”
Q7: Merge Intervals
Problem: Merge all overlapping intervals.
Example: [[1,3],[2,6],[8,10],[15,18]] → [[1,6],[8,10],[15,18]]
Solution:
def merge(intervals): intervals.sort(key=lambda x: x[0]) merged = [] for interval in intervals: if not merged or merged[-1][1] < interval[0]: merged.append(interval) else: merged[-1][1] = max(merged[-1][1], interval[1]) return mergedExplanation: Sort by start, merge if overlapping. Time: O(n log n), Space: O(n)
Answer: [[1,6],[8,10],[15,18]]
Q8: Valid Parentheses
Problem: Check if string has valid parentheses matching.
Example: ”()[]” → true, ”([)]” → false
Solution:
def isValid(s): stack = [] mapping = {')': '(', '}': '{', ']': '['} for char in s: if char in mapping: if not stack or stack.pop() != mapping[char]: return False else: stack.append(char) return not stackExplanation: Use stack to match opening/closing brackets. Time: O(n), Space: O(n)
Answer: true for ”()[]”, false for ”([)]”
Q9: Design Food Delivery Tracking System
Problem: Design system to track order status and delivery location in real-time.
Requirements:
Solution:
Key Components:
Answer: Microservices architecture with WebSocket for real-time updates
Q10: Design Restaurant Recommendation Engine
Problem: Recommend personalized restaurants based on user preferences and history.
Requirements:
Solution:
Key Components:
Answer: Hybrid recommendation system with collaborative and content-based filtering
Q11: Design Order Management System
Problem: Handle order creation, processing, and fulfillment at scale.
Requirements:
Solution:
Answer: Event-driven microservices with Saga pattern for transactions
Q12: LRU Cache Implementation
Problem: Design a cache that supports get and put operations with O(1) time complexity.
Requirements:
get(key): Return value if key exists, else -1put(key, value): Insert or update valueSolution (Python):
from collections import OrderedDict
class LRUCache: def __init__(self, capacity): self.cache = OrderedDict() self.capacity = capacity
def get(self, key): if key not in self.cache: return -1 self.cache.move_to_end(key) return self.cache[key]
def put(self, key, value): if key in self.cache: self.cache.move_to_end(key) self.cache[key] = value if len(self.cache) > self.capacity: self.cache.popitem(last=False)Time Complexity: O(1) for both operations
Space Complexity: O(capacity)
Q13: Top K Frequent Elements
Problem: Given an array and integer k, return k most frequent elements.
Example: nums = [1,1,1,2,2,3], k = 2 → [1,2]
Solution (Python):
from collections import Counterimport heapq
def topKFrequent(nums, k): count = Counter(nums) return heapq.nlargest(k, count.keys(), key=count.get)Time Complexity: O(n log k)
Space Complexity: O(n)
Q14: Product of Array Except Self
Problem: Return array where output[i] is product of all elements except nums[i]. Cannot use division.
Example: nums = [1,2,3,4] → [24,12,8,6]
Solution (Python):
def productExceptSelf(nums): n = len(nums) result = [1] * n
# Left pass for i in range(1, n): result[i] = result[i-1] * nums[i-1]
# Right pass right = 1 for i in range(n-1, -1, -1): result[i] *= right right *= nums[i]
return resultTime Complexity: O(n)
Space Complexity: O(1) excluding output array
Q12: Customer Focus Question
Problem: Behavioral question testing customer focus value.
Answer Format (STAR):
Example: Fixed critical bug affecting order placement, reduced error rate by 90%, received positive user feedback
Q13: Ownership Question
Problem: Behavioral question testing ownership value.
Answer Format (STAR):
Example: Led delivery tracking feature, coordinated team, delivered on time, improved user satisfaction
Q14: Innovation Question
Problem: Behavioral question testing innovation value.
Answer Format (STAR):
Example: Designed caching strategy reducing API latency by 70%, improved user experience
Zomato Placement Papers 2024
Practice Zomato placement papers 2024 with coding questions, DSA problems, and complete solutions.
Zomato Placement Papers 2025
Access latest Zomato placement papers 2025 with current year coding questions and updated patterns.
Complete Zomato Guide
Return to complete Zomato placement papers guide with eligibility, process, and all question types.
Ready to practice Zomato coding questions? Focus on DSA fundamentals, system design, and Zomato values. Practice with Zomato placement papers and solve problems in Java, C++, Python, or Go.
Pro Tip: Practice medium to hard difficulty problems on LeetCode and HackerRank. Focus on optimal solutions and clear explanations. Use Zomato placement papers for realistic practice. Watch YouTube tutorials (Striver, Take U Forward) for detailed explanations of complex problems.