Zomato interview questions & answers

20 real Zomato interview questions with full model answers — Technical, Behavioral, Product & growth, Coding. Drawn from the same verified bank ChannelPulse drills from (98 Zomato questions in total).

BehavioralMediumZomatoMobile Engineer

1. What challenges did you face while building a feature, and how did you solve them?

Model answer

  1. Situation — On a restaurant-discovery feature, we wanted to show nearby restaurants and refresh the list as the customer moved around. The feature crossed several boundaries: location permissions and device settings, network availability, backend ranking, and a UI that needed to remain responsive on a wide range of Android devices. A technically correct result could still feel broken if the app prompted for location too early or showed an empty screen during a slow request.
  2. Task — I owned the Android implementation and was responsible for making the experience useful when location was denied, unavailable, or slow, while keeping the feature performant and respecting user privacy.
  3. Action
  • I worked with product and design to define permission behavior before implementation. We requested location only after the user entered the nearby experience, explained the value first, and preserved a manual location-search path when permission was denied.
  • I modeled the screen as explicit states—loading, content, empty, permission denied, and recoverable error—instead of relying on a single loading flag. That prevented a network failure from being mistaken for “no restaurants nearby.”
  • I kept location acquisition and API calls off the main thread, debounced map movement, and cancelled superseded requests. This avoided rendering stale results when a user moved the map quickly.
  • I added request identifiers and location bounds to responses so the UI could ignore results for an older viewport. I also used a short-lived cache for repeat views, with a clear refresh path rather than presenting cached data as live.
  • I tested permission changes through Android settings, poor connectivity, and different screen sizes. I shared the edge cases with backend and QA early so that API behavior and test coverage matched the customer flow.
  1. Result — The feature shipped without blocking the non-location discovery path, and we saw fewer empty-screen failures in the rollout cohort. The implementation also gave support and analytics clearer distinctions between denied permission, unavailable location, and genuine zero-result searches. I learned to treat permissions, network uncertainty, and UI state as part of the feature design—not cleanup work after the happy path.
BehavioralMediumZomatoMobile Engineer

2. What was the toughest feature you built?

Model answer

  1. Situation — The toughest feature I built was a live order-tracking experience for a food-delivery app. Customers needed to understand whether their order was being prepared, picked up, or approaching, while restaurant and delivery-partner updates could arrive late, out of order, or not at all. The feature mattered because uncertainty during a delayed order drove support contacts and reduced customer trust.
  2. Task — I owned the Android experience, including the order-state UI and its integration with backend updates. The main constraint was to make tracking feel current without draining battery or letting inconsistent events send the customer backwards in the journey.
  3. Action
  • I first mapped the order lifecycle with product, backend, and operations teams. We agreed on a small set of customer-facing states and explicitly defined transitions for cancellations, reassignment, and delayed updates.
  • I treated server state as authoritative. The app applied updates only when their order version was newer, and fetched a fresh snapshot after reconnecting instead of assuming it had received every event.
  • I used a push update path for timely changes and a bounded polling fallback while the tracking screen was active. I stopped polling when the screen was backgrounded and used backoff during network failures to limit battery and server load.
  • I separated the state reducer from the UI so duplicate or out-of-order events could be tested deterministically. I added tests for reconnects, missing updates, and transitions such as courier reassignment.
  • I worked with design to show an honest fallback when live location was unavailable rather than displaying a stale marker as current. I also added analytics for time spent in each state and tracking errors.
  1. Result — We launched incrementally and monitored crash-free sessions, tracking freshness, and order-related support contacts. In the first few weeks, the share of sessions with a stale tracking state fell by about 30%, and support contacts about delivery progress declined by roughly 10% in the rollout cohort. The biggest lesson for me was that live features are primarily a correctness and recovery problem; animation and map polish only help once the underlying state is trustworthy.
BehavioralMediumZomatoMobile Engineer

3. Why did you choose a particular architecture for your project?

Model answer

  1. Situation — On a food-discovery Android app, our restaurant feed was becoming difficult to change: UI code, network calls, and filtering logic were concentrated in a few large classes. A team of five engineers worked on the app, and feed changes were frequent, so regressions and slow reviews were starting to affect delivery.
  2. Task — I owned proposing an architecture that made the feed easier to test and extend without adding unnecessary abstraction or slowing down the user experience.
  3. Action
  • I first mapped the responsibilities and dependencies in the existing flow. The key problem was that the UI directly depended on networking and data-format details, which made both UI tests and API changes harder.
  • I proposed a feature-oriented structure with a presentation layer using ViewModels, a domain layer for core use cases, and a data layer for repositories and API/cache implementations. I kept the boundaries pragmatic: I did not create an interface for every class, only where we needed a meaningful substitution or test seam.
  • I made the ViewModel expose observable UI state, so rendering and loading/error states were explicit. The repository owned the decision to use cached restaurant data while a refresh was in progress.
  • I introduced the pattern on the feed feature first, then documented the conventions and reviewed an example with the team before expanding it. That let us validate the design without forcing a risky rewrite of the whole app.
  • I also kept RecyclerView concerns at the presentation boundary: stable item IDs and diff-based updates, while the domain layer remained independent of Android views.
  1. Result — The team could test feed behavior without launching the UI or making real network calls, and new feed changes became easier to review because responsibilities were clearer. In that project, we reduced the typical feed change from several files with tangled responsibilities to a small, predictable set of changes, and cut regressions found in QA over the next release cycle. I learned to choose architecture based on the problems a team actually has, and to prove a pattern on one feature before applying it broadly.
BehavioralMediumZomatoMobile EngineerTechnical Interview 1

4. What is your favorite project that you have worked on?

Model answer

  1. Situation — My favorite project was improving the order-tracking experience in a food-delivery app. Customers were opening the screen repeatedly because the order status could feel stale, especially during the handoff from restaurant preparation to delivery. I was the mobile engineer responsible for making that experience clearer and more resilient, while coordinating with backend and design teams.
  2. Task — I wanted customers to understand what was happening without relying on constant manual refreshes. The constraint was that mobile clients could not assume a continuous network connection or perfectly ordered status updates.
  3. Action
  • I mapped the order states with product and backend partners, then agreed on a small, explicit state model for accepted, preparing, picked up, and delivered. That helped us avoid presenting ambiguous backend transitions as definite promises.
  • I proposed updating the screen from server events when available, with a refresh fallback when the app resumed or connectivity returned. I treated the server as the source of truth rather than trying to infer delivery progress locally.
  • I added handling for delayed and out-of-order updates so an older event could not move the UI backwards. I also designed clear loading, stale-data, and retry states instead of leaving the customer with a spinner.
  • I worked with design to make the next expected step prominent and to keep the screen useful with accessibility labels and without relying only on color.
  • I helped QA build test cases for dropped connections, backgrounding the app, and rapid state changes, then used pilot feedback to fix confusing wording before a broader rollout.
  1. Result — The rollout reduced repeated manual refreshes and improved customer feedback about tracking clarity; in the pilot, we also saw fewer support contacts asking for basic order-status updates. I valued the project because it combined mobile reliability with a very tangible customer problem. It taught me that a trustworthy, explicit status is better than a flashy live interface that can’t explain uncertainty.
CodingEasyZomatoSoftware Engineer

5. Isomorphic Strings (LeetCode)

Model answer

The task

Determine whether two strings have the same length and whether their characters can be matched one-to-one so that each position in one string corresponds to the same position in the other.

Key idea

Maintain mappings in both directions. A character in the first string must always map to the same character in the second, and two different characters cannot map to the same character.

Approach

  1. Return False if the strings have different lengths.
  2. Create a mapping from the first string to the second.
  3. Create a reverse mapping from the second string to the first.
  4. Scan corresponding characters together.
  5. If either mapping conflicts with the current pair, return False; otherwise, record the pair.
  6. If every pair is consistent, return True.
class Solution:
    def isIsomorphic(self, s: str, t: str) -> bool:
        if len(s) != len(t):
            return False

        forward = {}
        reverse = {}

        for left, right in zip(s, t):
            if left in forward and forward[left] != right:
                return False
            if right in reverse and reverse[right] != left:
                return False

            forward[left] = right
            reverse[right] = left

        return True

Complexity:

  • Time: O(n), where n is the string length; each position is checked once.
  • Space: O(k), where k is the number of distinct characters stored in the mappings.

Common follow-ups

  • What if the mapping only needs to preserve characters in one direction? Use just one mapping; this does not enforce a one-to-one correspondence.
  • What if the strings are streamed? Process corresponding characters as they arrive, retaining the two mappings.
  • Can the extra space be bounded for a fixed alphabet? Yes; use arrays instead of dictionaries when the character set has a known, small range.
CodingEasyZomatoSoftware Engineer

6. Move Zeroes (LeetCode)

Model answer

The task

Rearrange an integer array in place so all zeroes come after the nonzero values. Keep the nonzero values in their original relative order.

Key idea

Use a write pointer to mark where the next nonzero value belongs. Scan the array once, swapping each nonzero value into that position; this keeps the nonzero values stable and uses constant extra space.

Approach

  1. Set write to the first available position for a nonzero value.
  2. Scan each index from left to right.
  3. When a nonzero value is found, swap it with the value at write.
  4. Advance write after each nonzero value.
  5. Once the scan ends, all remaining positions contain zeroes.
from typing import List

class Solution:
    def moveZeroes(self, nums: List[int]) -> None:
        # The next nonzero value belongs at index write.
        write = 0

        for read in range(len(nums)):
            if nums[read] != 0:
                nums[write], nums[read] = nums[read], nums[write]
                write += 1

Complexity:

  • Time: O(n), where n is the array length; each value is examined once.
  • Space: O(1), since rearrangement is done in place.

Common follow-ups

  • What if relative order does not matter? Partitioning zeroes and nonzeroes can be done with two pointers, potentially with fewer assignments.
  • Can you reduce unnecessary writes? Swap only when read != write; this avoids self-swaps.
  • What if the input is a linked list? Relink nonzero nodes in their original order, then append the zero-valued nodes.
CodingMediumZomatoSoftware Engineer

7. Number of Islands (LeetCode)

Model answer

The task

Given a grid of land and water, count the groups of connected land cells. Cells connect horizontally or vertically, not diagonally.

Key idea

Each group is one island. Scan the grid, and whenever an unvisited land cell is found, count a new island and explore its entire connected region. Mark cells as visited when adding them to the search queue so no cell is processed more than once.

Approach

  1. Return 0 if the grid is empty.
  2. Scan every cell in the grid.
  3. When a land cell is found, increment the island count and start a breadth-first search from it.
  4. During the search, mark each discovered land cell as water and add its in-bounds land neighbors to the queue.
  5. Return the island count after the scan is complete.
from collections import deque
from typing import List

class Solution:
    def numIslands(self, grid: List[List[str]]) -> int:
        if not grid or not grid[0]:
            return 0

        rows, cols = len(grid), len(grid[0])
        islands = 0

        for row in range(rows):
            for col in range(cols):
                if grid[row][col] != "1":
                    continue

                islands += 1
                grid[row][col] = "0"
                queue = deque([(row, col)])

                while queue:
                    current_row, current_col = queue.popleft()

                    for dr, dc in ((1, 0), (-1, 0), (0, 1), (0, -1)):
                        next_row = current_row + dr
                        next_col = current_col + dc

                        if (
                            0 <= next_row < rows
                            and 0 <= next_col < cols
                            and grid[next_row][next_col] == "1"
                        ):
                            # Mark when enqueuing to avoid duplicate work.
                            grid[next_row][next_col] = "0"
                            queue.append((next_row, next_col))

        return islands

Complexity: Time: O(rows * cols), since each cell is examined at most a constant number of times.

Complexity: Space: O(rows * cols) in the worst case for the BFS queue.

Common follow-ups

  • Preserve the input grid? Track visited cells in a separate set instead of changing land cells to water.
  • Use depth-first search instead? Recursively or iteratively explore the four neighbors; iterative DFS avoids recursion-depth concerns.
  • Count diagonally connected land as part of the same island? Include the four diagonal directions in the neighbor list.
CodingMediumZomatoSoftware Engineer

8. Snakes and Ladders (LeetCode)

Model answer

The task

Given a numbered board with snakes and ladders, find the fewest die rolls needed to reach the final square from square 1. A move may teleport once if its landing square has a snake or ladder.

Key idea

Treat each square as a graph node and each possible die roll as an edge. Breadth-first search finds the shortest path because every roll has equal cost; convert each square number to its board coordinates to check for a teleport.

Approach

  1. Start BFS from square 1 with zero rolls.
  2. For each square, try every die result from 1 through 6, stopping at the final square.
  3. Map the resulting square number to its row and column, accounting for alternating row directions.
  4. Apply at most one snake or ladder, then enqueue the destination if it has not been visited.
  5. Return the roll count when the final square is reached; if BFS runs out of squares, return -1.
from collections import deque
from typing import List

class Solution:
    def snakesAndLadders(self, board: List[List[int]]) -> int:
        n = len(board)
        final = n * n

        def coordinates(square: int) -> tuple[int, int]:
            # Rows are numbered from the bottom, alternating direction.
            row_from_bottom, offset = divmod(square - 1, n)
            row = n - 1 - row_from_bottom
            col = offset if row_from_bottom % 2 == 0 else n - 1 - offset
            return row, col

        queue = deque([(1, 0)])  # (square, rolls)
        visited = {1}

        while queue:
            square, rolls = queue.popleft()

            for landing in range(square + 1, min(square + 6, final) + 1):
                row, col = coordinates(landing)
                destination = board[row][col]

                # A landing square causes at most one teleport.
                if destination != -1:
                    landing = destination

                if landing == final:
                    return rolls + 1

                if landing not in visited:
                    visited.add(landing)
                    queue.append((landing, rolls + 1))

        return -1

Complexity:

  • Time: O(n²), since each square is processed at most once with up to six die outcomes.
  • Space: O(n²) for the BFS queue and visited set.

Common follow-ups

  • What if the die has a different number of faces? Replace 6 with the number of faces.
  • What if moves have different costs? Use Dijkstra’s algorithm instead of BFS.
  • What if teleports can chain? Follow them until reaching a normal square, while detecting teleport cycles.
CodingMediumZomatoSoftware Engineer

9. Combination Sum (LeetCode)

Model answer

The task

Given positive candidate values and a target, find every distinct combination that sums to the target. A candidate may be used multiple times, but combinations that differ only in order should appear once.

Key idea

Build each combination in nondecreasing candidate order. After choosing a value, recurse from its same index so it can be reused; this ordering prevents permutations from being generated.

Approach

  1. Sort the candidates to process them in ascending order and enable early stopping.
  2. Use backtracking with the current start index, remaining sum, and chosen values.
  3. When the remaining sum is zero, save a copy of the chosen values.
  4. Otherwise, try each candidate from the start index onward.
  5. Stop trying larger candidates once one exceeds the remaining sum.
from typing import List

class Solution:
    def combinationSum(
        self, candidates: List[int], target: int
    ) -> List[List[int]]:
        candidates.sort()
        results: List[List[int]] = []
        current: List[int] = []

        def search(start: int, remaining: int) -> None:
            if remaining == 0:
                results.append(current.copy())
                return

            for index in range(start, len(candidates)):
                value = candidates[index]

                # Later values are no smaller, so none can fit either.
                if value > remaining:
                    break

                current.append(value)
                # Keep index unchanged to allow reusing this candidate.
                search(index, remaining - value)
                current.pop()

        search(0, target)
        return results

Complexity:

  • Time: O(N^d + R·d) as a loose worst-case bound, where N is the number of candidates, d = target / smallest candidate, and R is the number of results. The search explores candidate sequences up to depth d.
  • Space: O(d) auxiliary space for the recursion and current combination, excluding the returned results.

Common follow-ups

  • How would you avoid duplicate combinations if the input can contain repeated values? Deduplicate the sorted candidates before searching.
  • How would you find just one combination? Return immediately when a successful path is found.
  • What if each candidate can be used at most once? Recurse with index + 1 instead of index.
  • How can you handle a very large target? Use dynamic programming or memoization if the goal is counting or checking existence rather than listing every combination.
CodingMediumZomatoSoftware Engineer

10. Course Schedule (LeetCode)

Model answer

The task

Given a number of courses and prerequisite pairs, decide whether it’s possible to complete every course. A prerequisite pair means one course must be taken before another.

Key idea

Represent courses as a directed graph, with an edge from each prerequisite to the course that depends on it. A cycle means the courses in that cycle depend on one another, so not all courses can be completed.

Use Kahn’s topological-sort algorithm: repeatedly take courses with no remaining prerequisites and remove their outgoing edges.

Approach

  1. Create an adjacency list and count each course’s prerequisites (its indegree).
  2. Add every course with indegree zero to a queue.
  3. Remove courses from the queue, counting each as completed.
  4. Decrease the indegree of each dependent course; enqueue it when its indegree reaches zero.
  5. Return whether the number completed equals the total number of courses.
from collections import deque
from typing import List

class Solution:
    def canFinish(
        self, numCourses: int, prerequisites: List[List[int]]
    ) -> bool:
        # Edges point from prerequisite to the course that depends on it.
        graph = [[] for _ in range(numCourses)]
        indegree = [0] * numCourses

        for course, prerequisite in prerequisites:
            graph[prerequisite].append(course)
            indegree[course] += 1

        # Begin with courses that have no prerequisites.
        ready = deque(
            course
            for course in range(numCourses)
            if indegree[course] == 0
        )

        completed = 0

        while ready:
            course = ready.popleft()
            completed += 1

            for dependent in graph[course]:
                indegree[dependent] -= 1
                if indegree[dependent] == 0:
                    ready.append(dependent)

        return completed == numCourses

Complexity:

  • Time: O(V + E), where V is the number of courses and E is the number of prerequisite pairs.
  • Space: O(V + E) for the graph, indegrees, and queue.

Common follow-ups

  • How can you return a valid course order? Record courses as they are removed from the queue; return the order if it includes every course.
  • How can DFS detect a cycle? Track nodes as unvisited, visiting, or finished; reaching a visiting node reveals a cycle.
  • What if there are no courses? The algorithm returns True, since zero courses can all be completed.
Product & growthMediumZomatoMobile Engineer

11. What are some real-world use cases for custom views?

Model answer

Clarify & scope

I’d use a custom view when a Zomato experience needs a visual or interaction pattern that standard widgets cannot deliver cleanly. The goal is not to make every screen bespoke; it is to make important, reusable interactions clearer and more consistent.

User segments & pain points

I’d prioritize diners who make quick decisions on small screens, especially while comparing restaurants or tracking an order. They need key information—such as price, rating, delivery progress, and availability—to be easy to scan and interact with.

Goals & success metrics

The product goal is to reduce friction in the task the component supports. I’d measure task completion and time to complete, then use interaction errors or abandonment as guardrails. For example, a status component should improve order-status comprehension without increasing accessibility issues or rendering time.

Solutions

  • Order tracking timeline: A reusable component can show stages such as confirmed, preparing, and on the way, with a clear current state and accessible text labels.
  • Restaurant rating or offer indicator: A compact custom component can combine a visual rating, offer badge, or delivery estimate while preserving consistent layout across restaurant cards.
  • Food customization control: A specialized selector can make choices such as spice level or add-ons easier to understand than a generic list of toggles.

Recommendation: I’d start with the order-tracking timeline if research shows customers have trouble understanding delivery progress. It has a clear user outcome and can be reused across order surfaces. I’d first check whether standard Android or Compose components can meet the need; a custom implementation is justified only if it meaningfully improves clarity or interaction.

Prioritization & trade-offs

I’d rank candidates by user impact, reuse, and implementation effort. A custom view can improve fidelity and reuse, but it also adds ownership costs: measurement, drawing, accessibility semantics, state handling, and testing. I’d keep business logic outside the component so it remains reusable and straightforward to validate.

MVP, measurement & rollout

I’d ship the smallest version for one order-tracking surface, test it with assistive technology and a range of screen sizes, and compare task completion and comprehension against the existing UI. After monitoring crashes, rendering performance, and user feedback, I’d expand it to other surfaces if the result is positive.

Product & growthMediumZomatoMobile EngineerProfile Selection

12. What feature would you add to the Zomato app?

Model answer

Clarify & scope

I’d add a Dietary Confidence feature to Zomato: help people identify dishes that fit their dietary needs and understand what is known—or not known—about their ingredients. I’d start with delivery menus in a few high-volume cities rather than trying to solve ingredient transparency for every restaurant at once.

User segments & pain points

I’d focus first on people with serious allergies, then include users avoiding ingredients for religious, ethical, or lifestyle reasons. Menu labels like “healthy” or “veg” don’t answer practical questions such as whether a dish contains peanuts, dairy, or egg. Missing information can make a customer abandon the order—or make a risky choice.

Goals & success metrics

My North Star would be the completed-order rate among customers who set dietary preferences. I’d track menu-to-cart conversion, preference-filter usage, and customer-reported confidence. Guardrails would include allergy-related complaints, cancellations, restaurant burden, and the rate of incorrect or unverified ingredient claims.

Solutions

  1. Let customers set ingredient exclusions and dietary preferences once, then filter menus and flag matching dishes.
  2. Show ingredient and allergen details supplied or confirmed by restaurants, with a clear “not confirmed” state when information is missing.
  3. Offer a lightweight restaurant workflow to review ingredient tags and confirm substitutions before a customer places an order.

Recommendation: Start with the second and third ideas, plus basic preference filters. I would never imply that a dish is safe when its information is unverified. Clear uncertainty is more trustworthy than a confident but unsupported label.

Prioritization & trade-offs

I’d prioritize verified information and a small set of high-impact filters over broad personalization. Coverage will be limited initially, but incorrect allergen information has a much higher downside than an incomplete catalog. The restaurant workflow should be quick and optional, with incentives to complete profiles.

MVP, measurement & rollout

Pilot with a small set of restaurants that can verify ingredients. Compare the experience with a control group, measuring conversion and confidence alongside complaint and correction rates. Expand only when verification quality is strong; if errors rise, pause expansion and fix the data workflow before adding more coverage.

System designMediumZomatoSoftware EngineerInterview

13. Design a database schema for a tourist application like Yelp, then suggest modifications and optimizations.

Model answer

1. Requirements & scale

Functional requirements

  • Let tourists find businesses by name, category, location, and filters such as price or opening hours.
  • Show business details, photos, ratings, and reviews; let signed-in users write reviews and upload photos.
  • Let business owners claim and manage their listings.

Non-functional requirements

  • Search and business pages should be highly available and fast: p95 under 300 ms for search, under 200 ms for cached details.
  • Review writes must be durable, abuse-resistant, and attributable to a user. Search and aggregate ratings can be eventually consistent.
  • Support geospatial queries, regional scaling, and moderation without making the read path depend on slow background work.

Estimates: Assume 20 million monthly active users and 2 million daily active users. At 10 searches per active user per day, that is 20 million searches/day, about 230 average QPS; at a 10x peak, about 2,300 QPS. If 100,000 reviews/day average 2 KB each, raw review text is about 73 GB/year; indexes, replicas, and metadata may take 3–5x that. At 20,000 photo uploads/day averaging 2 MB, object storage grows about 40 GB/day, or 15 TB/year before replication and lifecycle policies.

2. High-level architecture

flowchart TD
  subgraph Client[Client]
    A[Mobile app]
    B[Web app]
  end
  subgraph Edge[Edge CDN]
    C[CDN and WAF]
  end
  subgraph LB[Load Balancer]
    D[Regional API gateway]
  end
  subgraph Services[API / Services]
    E[Search service]
    F[Business service]
    G[Review service]
    H[Media service]
    I[Moderation service]
  end
  subgraph Cache[Cache]
    J[Redis details and hot queries]
  end
  subgraph Stores[Datastores]
    K[PostgreSQL primary and replicas]
    L[OpenSearch geo index]
    M[Object storage photos]
  end
  subgraph Queue[Message Queue]
    N[Kafka events]
  end
  subgraph Workers[Workers]
    O[Index and rating workers]
    P[Photo and moderation workers]
  end
  A -->|HTTPS requests| C
  B -->|HTTPS requests| C
  C -->|cached assets and API traffic| D
  D -->|search query| E
  D -->|business read| F
  D -->|review write| G
  D -->|signed upload request| H
  E -->|geo and text query| L
  E -->|hot results| J
  F -->|details lookup| J
  F -->|authoritative read| K
  G -->|transactional write| K
  G -->|review event| N
  H -->|upload URL| M
  M -->|upload event| N
  N -->|review and listing events| O
  N -->|photo events| P
  O -->|refresh documents and aggregates| L
  O -->|update rating summary| K
  P -->|scan and moderate media| M
  P -->|moderation status| K
Diagram

3. API design

  • GET /v1/search?lat=&lng=&q=&category=&radius=&cursor= — nearby text/category search with filters and cursor pagination.
  • GET /v1/businesses/{id} — details, rating summary, and opening hours.
  • GET /v1/businesses/{id}/reviews?cursor= — paginated reviews, sorted by relevance or recency.
  • POST /v1/businesses/{id}/reviews — create a review; require an idempotency key.
  • POST /v1/businesses/{id}/photos/upload-url — issue a short-lived signed upload URL.
  • PUT /v1/owner/businesses/{id} — owner updates, guarded by authorization and version checks.

4. Data model & storage

  • PostgreSQL is the source of truth. users(user_id, ...), businesses(business_id, name, location, category, owner_id, status, ...), reviews(review_id, business_id, user_id, rating, text, status, created_at), and review_votes(review_id, user_id, value) use foreign keys and unique constraints where appropriate.
  • Keep rating_sum and rating_count as derived business fields, updated asynchronously or transactionally with a review write depending on the consistency requirement. Do not calculate every rating by scanning all reviews.
  • Partition reviews by hash of business_id or time once volume warrants it; index (business_id, created_at) and enforce one review per user/business if that is the product rule.
  • OpenSearch stores denormalized, geospatial business documents for text, category, distance, and filter queries. Redis caches popular business details and query results with short TTLs. Object storage holds image originals and resized variants; the database stores their keys and moderation status.

5. Deep dive

The core design choice is separating transactional data from discovery search. PostgreSQL owns listing and review truth; OpenSearch is a derived index optimized for nearby search. A review is committed before it is indexed, so a successful write is durable even if the search index is briefly behind.

sequenceDiagram
  participant U as User
  participant API as Review API
  participant DB as PostgreSQL
  participant Q as Kafka
  participant W as Index worker
  participant S as OpenSearch
  U->>API: POST review with idempotency key
  API->>DB: Validate and commit review plus outbox event
  DB-->>API: Commit succeeds
  API-->>U: 201 Created
  DB->>Q: Publish outbox event
  Q->>W: Deliver review event
  W->>DB: Read current review and aggregate
  W->>S: Update business search document
Diagram

Use a transactional outbox so a database commit cannot succeed while its event is silently lost. Consumers are idempotent because delivery may be repeated. If indexing is delayed, the business page can show the new review from PostgreSQL while search catches up. For hot businesses, cache invalidation should be event-driven, with TTL as a fallback. Review moderation can initially mark content pending; asynchronous checks publish only approved content to public views.

6. Scale, bottlenecks & trade-offs

  • Add PostgreSQL read replicas for business-page and review reads; keep writes on the primary. Partition/shard only after measuring hotspots, since cross-shard owner operations and aggregates become harder.
  • Replicate OpenSearch across availability zones and rebuild it from the database/event log. Use geo-cell or region-aware routing at larger scale; avoid one global index becoming a latency and failure bottleneck.
  • CDN-cache public images and static assets. Use Redis for frequently read listings, but keep TTLs short and tolerate stale search results rather than blocking on cache consistency.
  • Choose strong consistency for review creation and ownership changes; eventual consistency is acceptable for search ranking and rating summaries. This favors availability and fast reads without risking lost writes.
  • Apply rate limits, spam detection, permissions, and audit logs to reviews and owner edits. On search-index failure, return a controlled error or a limited cached result; never expose unmoderated content as approved.
System designMediumZomatoSoftware EngineerInterview

14. Design a text editor with basic functionality.

Model answer

1. Requirements & scale

Functional requirements

  • Create, rename, open, edit, and delete text documents; support basic formatting, search, and undo/redo in the client.
  • Save automatically, show save status, and let a user access documents across devices.
  • Preserve recent versions so users can recover from accidental edits. Keep real-time multi-user editing out of the initial scope; design the save protocol so collaboration can be added later.

Non-functional requirements

  • Editing must feel immediate, including while offline; a network failure must not discard the local buffer.
  • Saves should be durable and idempotent. Detect conflicting edits from multiple devices rather than silently overwriting newer content.
  • Target p95 document open under 500 ms for typical documents and autosave acknowledgement under 1 second on a healthy connection.

Estimates: Assume 10 million monthly active users and 2 million daily users, each editing five documents/day: 10 million save sessions/day, roughly 116 average requests/sec and 1,200 peak requests/sec at 10x. If each save stores a 20 KB snapshot, that is 200 GB/day before compression; retaining every snapshot is wasteful. Keep a current document plus periodic snapshots and compact edit history. Assuming 100 KB average live document size and 50 million documents, current content is about 5 TB before replicas and indexes.

2. High-level architecture

flowchart TD
  subgraph Client[Client]
    A[Browser editor]
    B[Mobile editor]
    C[Local buffer and queue]
  end
  subgraph Edge[Edge CDN]
    D[CDN and WAF]
  end
  subgraph LB[Load Balancer]
    E[API gateway]
  end
  subgraph Services[API / Services]
    F[Document service]
    G[Save and version service]
    H[Search service]
    I[Identity service]
  end
  subgraph Cache[Cache]
    J[Redis metadata cache]
  end
  subgraph Stores[Datastores]
    K[PostgreSQL metadata and revisions]
    L[Object storage snapshots]
    M[Search index]
  end
  subgraph Queue[Message Queue]
    N[Kafka change events]
  end
  subgraph Workers[Workers]
    O[Snapshot and compaction worker]
    P[Search and retention worker]
  end
  A -->|HTTPS and edits| D
  B -->|HTTPS and edits| D
  A -->|local edits| C
  B -->|local edits| C
  D -->|API traffic| E
  E -->|open and list| F
  E -->|conditional save| G
  E -->|document search| H
  E -->|authentication| I
  F -->|metadata cache| J
  F -->|document metadata| K
  G -->|revision transaction| K
  G -->|change event| N
  H -->|query index| M
  N -->|committed changes| O
  N -->|document metadata changes| P
  O -->|write compact snapshot| L
  O -->|snapshot reference| K
  P -->|refresh search index| M
  P -->|expire old revisions| K
Diagram

3. API design

  • POST /v1/documents — create a document and return its ID and initial version.
  • GET /v1/documents/{id} — return metadata, content or snapshot URL, and current version.
  • PATCH /v1/documents/{id} — save content or edits with If-Match: {version} and an idempotency key.
  • GET /v1/documents/{id}/revisions?cursor= — list recoverable versions.
  • POST /v1/documents/{id}/restore — restore a chosen revision as a new current version.
  • GET /v1/documents?query=&cursor= — list or search the user’s documents.

4. Data model & storage

  • PostgreSQL stores documents(doc_id, owner_id, title, current_version, content_ref, updated_at, deleted_at) and revisions(doc_id, version, content_ref, editor_id, created_at, checksum). Primary access paths are doc_id and (owner_id, updated_at); use row-level authorization and optimistic version checks.
  • Store small current documents inline if that simplifies reads; for larger documents and retained snapshots, use object storage with compressed content and immutable keys. Keep metadata and checksums in SQL. Set a maximum document size and return a clear error before accepting an oversized save.
  • Redis can cache metadata and permissions briefly; avoid caching mutable content as authoritative. A search index supports title/content search, updated asynchronously. Kafka carries committed change events to search, snapshot, and retention workers.
  • Partition metadata by doc_id when needed. A user's document list can become a hotspot, so paginate by (updated_at, doc_id) rather than offset pagination.

5. Deep dive

The critical behavior is autosave without lost updates. The editor keeps an immediate local buffer and batches changes after a short idle period (for example, 500–1,000 ms), on blur, and before navigating away. It sends the expected server version with each save. The service commits a new revision only if that version is still current; otherwise it returns 409 Conflict and the client can offer reload, compare, or recovery. This is safer than last-write-wins for a basic editor.

sequenceDiagram
  participant E as Editor
  participant API as Save API
  participant DB as PostgreSQL
  participant Q as Kafka
  participant W as Snapshot worker
  participant O as Object storage
  E->>E: Apply keystroke to local buffer
  E->>API: PATCH content, expected version 12
  API->>DB: Compare version and write revision 13
  DB-->>API: Commit revision 13
  API-->>E: 200 OK, version 13
  DB->>Q: Publish committed change event
  Q->>W: Deliver event
  W->>O: Write compressed snapshot if due
  W->>DB: Store snapshot reference
Diagram

Use a transaction to update the document version and insert its revision together. An outbox event in that transaction ensures background work is not lost. Retry-safe idempotency keys prevent a network retry from creating duplicate revisions. If the client is offline, it continues editing locally and queues saves; reconnecting submits against the last known version. A conflict should preserve both local and server content rather than silently discard either. Periodic snapshots plus compacted edit history bound recovery cost and storage growth.

6. Scale, bottlenecks & trade-offs

  • Scale stateless API instances horizontally; use PostgreSQL replicas for document lists and metadata reads, while routing saves to the primary. Keep transactions short and apply per-user/document rate limits.
  • Object storage handles large immutable snapshots cheaply and durably. A worker outage delays compaction or search updates but does not block editing; keep recent revisions in SQL until snapshots are confirmed.
  • Use versioned writes for strong correctness. This makes conflicting edits visible but requires a user decision; for the initial single-user product, that is preferable to complex silent merge behavior.
  • If collaboration becomes a requirement, add a session service and operational transformation or a CRDT, with ordered updates and presence handled separately. Do not introduce that complexity for basic editing; its consistency model and conflict semantics are substantially different.
  • Replicate databases and object storage across zones, back up metadata, and test restore workflows. On search failure, document open/edit still works. On database failure, preserve the local buffer and show unsaved status rather than claiming the save succeeded.
TechnicalEasyZomatoMobile Engineer

15. What are custom views, and when should you create them?

Model answer

A custom view is a UI component whose drawing, layout, or interaction behavior I implement because standard Android widgets do not meet the product or design requirements. I can create one by extending View for a drawable component, or ViewGroup when I need to measure and arrange child views. With Jetpack Compose, the equivalent is often a reusable composable; I would choose based on the app’s UI stack.

I’d create a custom view when:

  1. The visual form is specialized — for example, a rating meter, a map marker, or a compact delivery-status timeline.
  2. The interaction is specialized — such as a gesture-driven control or a chart with custom touch handling.
  3. The component must be reused consistently across screens and standard widgets would require brittle workarounds.
  4. The platform provides no suitable widget, or combining existing widgets would make performance or accessibility difficult to manage.

Before building one, I’d check whether a standard widget or Compose component can meet the need. A custom view adds responsibility for measurement, drawing, state restoration, accessibility, and testing. I’d also avoid putting business logic or network calls inside it: the view should render state and emit user actions, while the screen or view model owns application behavior.

In short, I create a custom view when it provides a clear improvement in usability, consistency, or performance that standard components cannot deliver cleanly.

TechnicalEasyZomatoMobile EngineerTechnical Interview 2

16. What is the difference between a class and a struct?

Model answer

In Swift, the key distinction is value semantics versus reference semantics.

  • Struct: A value type. Assignment or passing it to a function creates an independent value, so changes to one copy do not affect another. Structs do not support inheritance. They are a good default for models such as coordinates or immutable menu-item data.
  • Class: A reference type. Assignment copies the reference, so multiple variables can point to the same instance and observe its mutations. Classes support inheritance and identity checks with ===.
  • Mutability: A let struct value cannot have its properties changed; a let class reference cannot be reassigned, but the referenced instance may still be mutable if its properties allow it.
  • Memory nuance: A struct is not guaranteed to live on the stack, and a class is not simply “a pointer on the stack.” Storage depends on where values are held and compiler optimizations. Classes are reference-counted; a struct that contains a class reference can still share referenced state.
struct Address { var city: String }
var first = Address(city: "Mumbai")
var second = first
second.city = "Pune"
// first.city remains "Mumbai"

class Cart { var itemCount = 0 }
let a = Cart()
let b = a
b.itemCount += 1
// a.itemCount is now 1; a and b refer to the same instance
TechnicalEasyZomatoMobile Engineer

17. What is a Retrofit Converter Factory?

Model answer

A Retrofit Converter.Factory tells Retrofit how to turn an HTTP ResponseBody into a Kotlin/Java type, and how to turn a request value into a RequestBody.

flowchart LR
    A[HTTP response body] --> B[Converter Factory]
    B --> C[App model]
    D[Request model] --> E[Converter Factory]
    E --> F[HTTP request body]
Diagram
  • You register factories on Retrofit.Builder, for example MoshiConverterFactory.create() or GsonConverterFactory.create().
  • Retrofit asks the registered factories, in order, for a converter that supports the requested type. The first matching factory is used, so ordering matters when factories can handle overlapping types.
  • A factory can provide a response converter, a request converter, or both. For example, a JSON converter maps response JSON to a data class and serializes a data class for a request.
  • Use a custom factory when the API uses a format or mapping that existing converters do not handle. It should handle supported types explicitly and return null for types it does not support.
  • It is separate from an OkHttp interceptor: converters handle body serialization, while interceptors handle request/response behavior such as headers, logging, or retries.
TechnicalEasyZomatoMobile Engineer

18. What are Retrofit interceptors?

Model answer

Retrofit is an HTTP client abstraction; interceptors are provided by its underlying OkHttp client. They inspect or modify requests and responses as they pass through the network stack.

  1. Application interceptors run once for a logical call. They are useful for common headers, request logging, and response handling.
  2. Network interceptors run at the network exchange level. They can inspect the actual network request and response, but have more restrictions and may run differently around redirects or retries.
  3. An interceptor receives a request, can create a modified request, and passes it onward with chain.proceed(request). It can also inspect the returned response.
  4. Common uses include authentication headers, correlation IDs, caching directives, and debug logging. I would avoid logging credentials or sensitive personal data.
  5. Interceptors are not a substitute for per-endpoint parameters when a value belongs to one specific API call. For that, Retrofit’s @Header or @HeaderMap is clearer.
flowchart LR
    A[Retrofit service call] --> B[OkHttp application interceptor]
    B --> C[OkHttp network interceptor]
    C --> D[HTTP server]
    D --> C
    C --> B
    B --> A
Diagram
TechnicalEasyZomatoMobile Engineer

19. How does a Kotlin class differ from a data class?

Model answer

A regular Kotlin class is a general-purpose class. A data class is intended to represent a value—typically a model whose properties define its data—and the compiler generates useful methods from its primary-constructor properties.

data class Restaurant(val id: String, val name: String)

class RestaurantScreen(val restaurant: Restaurant)
  • Generated for a data class: equals(), hashCode(), toString(), componentN() functions for destructuring, and copy().
  • Properties matter: Only properties declared as val or var in the primary constructor participate in those generated methods. Properties declared in the class body do not.
  • Restrictions: A data class must have at least one primary-constructor parameter, and those parameters must be val or var. It cannot be abstract, open, sealed, or inner.
  • Inheritance: A data class can implement interfaces and extend an allowed class, but it cannot be declared open; data classes are final by default.

For example, Restaurant("1", "Dosa Place") compares equal to another instance with the same constructor properties. A regular class uses reference equality unless it overrides equals() and hashCode().

TechnicalEasyZomatoMobile EngineerTechnical Interview 2

20. What is the difference between call by value and call by reference?

Model answer

Call by value passes a copy of an argument's value to a function. Assigning to the parameter does not change the caller's variable. Mutating a copied value also does not change the caller's value.

Call by reference gives the function access to the caller's variable itself. The function can change that variable, and the caller observes the change.

Swift arguments are passed by value. For a class instance, the copied value is a reference to the same object, so mutating the object's properties can be observed by the caller. But reassigning the function's local reference does not reassign the caller's variable. Swift's inout parameter lets a function modify a caller's variable using copy-in/copy-out semantics; it is not generally described as traditional call by reference.

Practice these out loud, don't memorise them

Reading an answer is not the same as being able to give one under pressure. ChannelPulse plays the interviewer, asks the follow-ups, and scores each answer with feedback and a model answer so you can hear the gap between what you said and what lands.

Get ChannelPulse Browse all questions