Swiggy Coding Interview Questions
25 Swiggy coding interview problems with full optimal solutions — 10 easy, 11 medium, 4 hard. Every problem ships with multiple approaches (brute-force first, then the optimal), complexity tables for each, company-specific tips on what an Swiggy interviewer values, and a FAQ section.
- #1easyfoundational
1. Two Sum
Find two indices in an array whose values sum to a target.
- #2easyfoundational
2. Valid Parentheses
Check whether a string of brackets is well-formed.
- #3easyfoundational
3. Merge Two Sorted Lists
Merge two sorted linked lists into one sorted list.
- #4easyfoundational
4. Remove Duplicates from Sorted Array
Compact a sorted array in-place so each value appears once, returning the new length.
- #5easyfoundational
5. Merge Sorted Array
Merge nums2 into nums1 in-place so the result is sorted non-decreasing.
- #6easyfoundational
6. Best Time to Buy and Sell Stock
Find the max profit from one buy-sell of a stock given daily prices.
- #7easyfoundational
7. Single Number
In an array where every element appears twice except one, find the unique value.
- #8easyfoundational
8. Linked List Cycle
Detect whether a singly linked list contains a cycle.
- #9easyfoundational
9. Min Stack
Design a stack that returns the minimum element in O(1).
- #10easyfoundational
10. Reverse Linked List
Reverse the direction of every pointer in a singly linked list.
- #11mediumfoundational
11. Add Two Numbers
Add two numbers stored as digits in linked lists in reverse order.
- #12mediumfoundational
12. Longest Substring Without Repeating Characters
Find the length of the longest substring with all distinct characters.
- #13mediumfoundational
13. Longest Palindromic Substring
Return the longest substring of s that reads the same forwards and backwards.
- #14mediumfoundational
14. 3Sum
Find every unique triplet in the array that sums to zero.
- #15mediumfoundational
15. Search in Rotated Sorted Array
Binary search a target in a sorted array that has been rotated at an unknown pivot.
- #16mediumfoundational
16. Permutations
Return every permutation of a distinct-integer array.
- #17mediumfoundational
17. Group Anagrams
Group an array of strings by their anagram equivalence class.
- #18mediumfoundational
18. Merge Intervals
Merge all overlapping intervals in a list and return the result.
- #19mediumfoundational
19. Number of Islands
Count the connected land regions in a 2-D grid of '1's and '0's.
- #20mediumfoundational
20. Course Schedule
Decide whether you can finish all courses given prerequisite pairs.
- #21mediumfoundational
21. Network Delay Time
Compute the time it takes for a signal to reach every node from a source.
- #22hardfoundational
22. Median of Two Sorted Arrays
Find the median of two sorted arrays in logarithmic time.
- #23hardfoundational
23. Merge k Sorted Lists
Merge k sorted linked lists into one sorted linked list.
- #24hardfoundational
24. Trapping Rain Water
Compute how much water is trapped between bars of given heights.
- #25hardfoundational
25. Minimum Window Substring
Find the shortest substring of s that contains every character of t (with multiplicities).