Company Interview Questions · Product & Retail Tech
Swiggy: Data Science (Campus 2025)
Swiggy: Data Science Interview Experience (Campus, 2025). Rounds, real reported questions and model answers, compiled from public candidate reports (sources at the end). Practice mode hides every answer: say your answer first, press Show answer, then rate yourself. Use 🔁 Review again to build your revision list and 🎲 Random question for a quick drill.
About this interview
Compiled from a public candidate report for a Swiggy Data Science Intern role through on-campus hiring at an IIIT (August 2025) and a public Swiggy ML Engineer question guide. The questions are paraphrased, and the model answers are written by EasyLearnSpace.
| Role | Data Science Intern (campus); Data Scientist 1 / ML Engineer (guides) |
| Rounds | Resume shortlist → Python + SQL interview (1 each) → technical deep dive with a DS-II (regularisation, ML concepts tied to projects) → HR (design an autocomplete / search feature) |
| Outcome | Not selected; no feedback received |
| Domain | Delivery-time prediction, search and ranking, dynamic pricing, fraud (Dine-Out / Instamart) |
01Rounds at a glance
- Python + SQL: one problem each, practical and medium level.
- Technical: verbal ML depth connected to your projects (regularisation, bias-variance, metrics).
- HR with a twist: even this round had a design question: autocomplete with a prefix trie.
02Questions and model answers
Q1
Design an autocomplete for Swiggy search (restaurants and dishes).
- Data structure: a trie of normalised queries, where each node stores the top-k completions by popularity. Lookup is O(prefix length).
- Ranking signals: global popularity, location (only serviceable restaurants nearby), time of day, the user's history, open/closed status, freshness of trends.
- Robustness: typo tolerance (edit distance or n-gram index), transliteration ("paneer" vs "panir"), synonyms ("biryani" ≈ "biriyani").
- Serving: precomputed top-k per prefix per city in Redis; a latency budget under 50 ms; update the counts in near real time from logs.
- Evaluation: keystrokes saved, CTR on suggestions, search-to-order conversion; A/B test ranking changes.
Q2
Explain L1 vs L2 regularisation and when to use each.
- L2 (Ridge): penalty λΣw². Shrinks weights smoothly and handles correlated features. The usual default.
- L1 (Lasso): penalty λΣ|w|. Produces sparse weights (feature selection), good with many irrelevant features.
- Elastic Net mixes both. In neural networks, weight decay (L2) plus dropout.
- Tune λ by cross-validation and standardise features first.
Q3
How would you predict food delivery time (ETA)?
- Decompose: preparation time + rider assignment wait + rider to restaurant + restaurant to customer.
- Features:
- Restaurant prep history by dish and time of day.
- Current kitchen load.
- Rider availability.
- Distance and road-graph ETA.
- Traffic, weather, rain flags.
- Festival days.
- Model: gradient boosting per component, or one model with quantile loss. Predict P50 and P90 so you can promise conservatively.
- Metrics: MAE, plus the share of orders delivered later than promised (customer trust). Monitor by city and zone; retrain often.
Q4
SQL: find each customer's most frequently ordered cuisine.
WITH c AS (
SELECT o.customer_id, r.cuisine, COUNT(*) AS n,
RANK() OVER (PARTITION BY o.customer_id ORDER BY COUNT(*) DESC) AS rk
FROM orders o JOIN restaurants r ON r.restaurant_id = o.restaurant_id
GROUP BY o.customer_id, r.cuisine
)
SELECT customer_id, cuisine, n FROM c WHERE rk = 1;
- A window function over an aggregate works in a single CTE.
RANKkeeps ties; useROW_NUMBERto pick exactly one.
Q5
How would you identify genuine customers vs fake or abusive accounts on a dine-in offer?
- Signals: device and payment reuse across accounts, new accounts that redeem immediately, mismatches between location and restaurant, repeated maximum-discount bills, reviews posted only by linked accounts.
- Methods: velocity rules, a graph of shared identifiers (connected components), an anomaly score, then a supervised model once labels exist.
- Action: limit offers for risky clusters and require verification. Measure the false-positive impact on genuine users.
Q6
Python: return the top-k most-ordered dishes from a list of orders.
from collections import Counter
def top_dishes(orders, k=3):
return Counter(d for o in orders for d in o["items"]).most_common(k)
- O(n) to count plus O(m log k) for the top k. Mention streaming with a heap if the data is huge.
03How to prepare for Swiggy
- Practise search, ranking and ETA design, which is core to food-tech.
- Be strong on ML fundamentals tied to your own projects.
- Medium SQL with window functions; easy–medium Python.
Sources
- LeetCode Discuss: Swiggy Data Science (on-campus, Aug 2025)
- Interview Query: Swiggy ML Engineer guide
Created by Ajeetkumar