Problem database last updated: June 20, 2025

SSwiggy logo

Swiggy Coding Interview Questions

31 problems · 9 Easy, 18 Medium, 4 Hard · Ranked #61 of 458

Difficulty breakdown

9 Easy

29% · avg 23%

18 Medium

58% · avg 59%

4 Hard

13% · avg 18%

Top topics

array
67.7%
hash-table
35.5%1.6x
sorting
29%2x
dynamic-programming
19.4%
stack
16.1%1.9x
string
16.1%

Interview profile

Based on 31 reported problems, Swiggy interviews are in line with industry averages - 13% Hard vs 18% overall. The majority (58%) of questions are Medium difficulty, which is typical for companies that want to see solid fundamentals without excessive trick questions.

Compared to the industry average, Swiggy puts unusual emphasis on monotonic-stack (9.7% of problems, 3.3x the industry average), divide-and-conquer (9.7% of problems, 2.3x the industry average), sorting (29% of problems, 2x the industry average). If you're short on time, these are the categories to double down on.

The most common topics are array (67.7%), hash-table (35.5%), sorting (29%), dynamic-programming (19.4%). Problems below are sorted by frequency, the ones at the top are asked most often.

All 31 problems

Maximize Area of Square Hole in Grid

Solve

You are given the two integers, n and m and two integer arrays, hBars and vBars. The grid has n + 2 horizontal and m + 2 vertical bars, creating 1 x 1 unit cell...

MediumVery Likely
arraysorting

Minimum Value to Get Positive Step by Step Sum

Solve

Given an array of integers nums, you start with an initial positive value startValue.

EasyVery Likely
arrayprefix-sum

Sort Colors

Solve

Given an array nums with n objects colored red, white, or blue, sort them in-place so that objects of the same color are adjacent, with the colors in the order...

MediumVery Likely
arraytwo-pointerssorting

Next Greater Element I

Solve

The next greater element of some element x in an array is the first greater element that is to the right of x in the same array.

EasyVery Likely
arrayhash-tablestack

Merge Sorted Array

Solve

You are given two integer arrays nums1 and nums2, sorted in non-decreasing order, and two integers m and n, representing the number of elements in nums1 and num...

EasyVery Likely
arraytwo-pointerssorting

Maximum Profit in Job Scheduling

Solve

We have n jobs, where every job is scheduled to be done from startTime[i] to endTime[i], obtaining a profit of profit[i].

HardVery Likely
arraybinary-searchdynamic-programming

Happy Number

Solve

Write an algorithm to determine if a number n is happy.

EasyVery Likely
hash-tablemathtwo-pointers

Valid Parentheses

Solve

Given a string s containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid.

EasyVery Likely
stringstack

Count Good Meals

Solve

A good meal is a meal that contains exactly two different food items with a sum of deliciousness equal to a power of two.

MediumLikely
arrayhash-table

Fair Candy Swap

Solve

Alice and Bob have a different total number of candies. You are given two integer arrays aliceSizes and bobSizes where aliceSizes[i] is the number of candies of...

EasyLikely
arrayhash-tablebinary-search

Course Schedule

Solve

There are a total of numCourses courses you have to take, labeled from 0 to numCourses - 1. You are given an array prerequisites where prerequisites[i] = [ai, b...

MediumLikely
depth-first-searchbreadth-first-searchgraph

Integer to Roman

Solve

Seven different symbols represent Roman numerals with the following values:

MediumLikely
hash-tablemathstring

Daily Temperatures

Solve

Given an array of integers temperatures represents the daily temperatures, return an array answer such that answer[i] is the number of days you have to wait aft...

MediumLikely
arraystackmonotonic-stack

Immediate Food Delivery II

Solve

Table: Delivery

MediumLikely
database

Maximum Score From Removing Substrings

Solve

You are given a string s and two integers x and y. You can perform two types of operations any number of times.

MediumLikely
stringstackgreedy

Minimum Number of Work Sessions to Finish the Tasks

Solve

There are n tasks assigned to you. The task times are represented as an integer array tasks of length n, where the ith task takes tasks[i] hours to finish. A wo...

MediumLikely
arraydynamic-programmingbacktracking

Two City Scheduling

Solve

A company is planning to interview 2n people. Given the array costs where costs[i] = [aCosti, bCosti], the cost of flying the ith person to city a is aCosti, an...

MediumLikely
arraygreedysorting

Subarray Sum Equals K

Solve

Given an array of integers nums and an integer k, return the total number of subarrays whose sum equals to k.

MediumLikely
arrayhash-tableprefix-sum

Maximum Length of Pair Chain

Solve

You are given an array of n pairs pairs where pairs[i] = [lefti, righti] and lefti < righti.

MediumLikely
arraydynamic-programminggreedy

Best Time to Buy and Sell Stock

Solve

You are given an array prices where prices[i] is the price of a given stock on the ith day.

EasyLikely
arraydynamic-programming

Majority Element

Solve

Given an array nums of size n, return the majority element.

EasyLikely
arrayhash-tabledivide-and-conquer

Edit Distance

Solve

Given two strings word1 and word2, return the minimum number of operations required to convert word1 to word2.

MediumLikely
stringdynamic-programming

Median of Two Sorted Arrays

Solve

Given two sorted arrays nums1 and nums2 of size m and n respectively, return the median of the two sorted arrays.

HardLikely
arraybinary-searchdivide-and-conquer

Trapping Rain Water

Solve

Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it can trap after raining.

HardLikely
arraytwo-pointersdynamic-programming

Merge Two Sorted Lists

Solve

You are given the heads of two sorted linked lists list1 and list2.

EasyLikely
linked-listrecursion

Letter Combinations of a Phone Number

Solve

Given a string containing digits from 2-9 inclusive, return all possible letter combinations that the number could represent. Return the answer in any order.

MediumLikely
hash-tablestringbacktracking

First Missing Positive

Solve

Given an unsorted integer array nums. Return the smallest positive integer that is not present in nums.

HardLikely
arrayhash-table

Subsets II

Solve

Given an integer array nums that may contain duplicates, return all possible subsets (the power set).

MediumLikely
arraybacktrackingbit-manipulation

LRU Cache

Solve

Design a data structure that follows the constraints of a Least Recently Used (LRU) cache.

MediumLikely
hash-tablelinked-listdesign

Longest Consecutive Sequence

Solve

Given an unsorted array of integers nums, return the length of the longest consecutive elements sequence.

MediumLikely
arrayhash-tableunion-find

K Closest Points to Origin

Solve

Given an array of points where points[i] = [xi, yi] represents a point on the X-Y plane and an integer k, return the k closest points to the origin (0, 0).

MediumLikely
arraymathdivide-and-conquer

How often are these problems asked?

Frequency scores are based on crowdsourced interview reports. A higher score means the problem has been reported more often in recent Swiggy interviews.

Very Likely

75-100%

Likely

50-74%

Sometimes

25-49%

Rare

0-24%

Preparing for your Swiggy coding interview

Swiggy interviews focus heavily on array, hash-table, sorting problems. If you're short on time, these are the categories to prioritize. The problems on this page are sorted by frequency, so start from the top and work your way down.

Beyond solving problems, practice explaining your approach. Swiggy interviewers care about your thought process - how you break down a problem, consider edge cases, and evaluate tradeoffs between solutions. A clean O(n) solution you can explain clearly beats an O(log n) solution you can't articulate.

Looking for more companies? Browse all 458 companies in our directory, or sharpen your fundamentals with our free data structure visualizers and AI-powered DSA tutor.

Frequently Asked Questions

What coding problems does Swiggy ask in interviews?add

Swiggy has been reported to ask 31 distinct coding problems. The most common topics are array, hash-table, sorting. 9 are Easy difficulty, 18 are Medium, and 4 are Hard. Problems are sorted by frequency - the ones at the top are asked most often.

How hard are Swiggy coding interviews?add

Based on 31 reported problems, Swiggy interviews are in line with industry averages - 13% Hard vs 18% overall. 58% of questions are Medium difficulty. Focus on the high-frequency Medium problems first, then work through the Hard ones.

How should I prepare for a Swiggy coding interview?add

Start with the highest-frequency problems listed on this page. Focus on the core topics: array, hash-table, sorting. Practice solving them under time pressure and explaining your approach out loud. Mock interviews with AI can simulate the real experience.

Other companies to explore

Ready to ace your Swiggy interview?

Simulate a real Swiggy coding interview with an AI interviewer. Get a scorecard with specific feedback on your problem-solving, code quality, and communication.

Simulate a Swiggy interview with AIarrow_forward