Swiggy's DSA rounds lean on graphs, dynamic programming, tries, and binary-search-on-answer patterns, often paired with a design-style twist (build a data structure, not just solve a problem). The three problems below are real, recently reported (2025) Swiggy questions with full solutions.
Given an m x n grid of 1s (land) and 0s (water), count the number of islands, where an island is a group of adjacent land cells connected horizontally or vertically.
Input: grid = [[1,1,0],[1,1,0],[0,0,1]]
Output: 2
The top-left 2x2 block of land forms one island; the isolated 1 at bottom-right forms a second.
Design a data structure that supports insert(val), remove(val), and getRandom() — returning a uniformly random element from the current set — all in average O(1) time.
Input: insert(1); insert(2); remove(1); getRandom()
Output: 2
After removing 1, the only remaining element is 2, so getRandom() must return it.
Given an integer n, return the number of structurally distinct binary search trees (BSTs) that store values 1 to n exactly once each.
Input: n = 3
Output: 5
More DSA questions Swiggy has asked recently
These topics were reported in verified 2025 Swiggy loops. Full problem statements, solutions and explanations for these are part of the Placement-Ready PYQ Kit.
5 more verified DSA questions with full solutions in the full Placement-Ready PYQ Kit
Includes every round they were asked in, from the online assessment through bar-raiser rounds.

