**Company Name**: Swiggy

**Job Role:** Software Development Engineer

**Years of Experience Required:** 0

**Drive:** Oncampus

**CTC: **31.8 LPA

# Preparation

**Topics**: DSA, SQL

**Duration**: 1-2 months

**Source of Preparation**: GeeksForGeeks, Leetcode, HackerRank, Takeuforward youtube channel.

[*BONUS]:*

*Check Striver’s SDE Sheet for Interview Preparation.**Check the ultimate resume building guide for coding interviews*.*Blind 75 Leetcode*

# Swiggy Interview Rounds

Swiggy conducted its virtual hiring process for our campus during the second week of October.

There were a total of 3 rounds in the Swiggy on campus drive.

**Round 1:** Online Coding Test

This round was conducted on Hacker Rank. There was a SQL problem, and 3 coding problems.

**Problem List:**

**Problem Statement 1:** Find out the city names and country names for which the number of customers is greater than the average customer per city.

The given tables were: Country, City, Customer

**Problem Statement 2**: Given a string s, a substring is defined as a non-empty string that can be obtained by the following means:

- Remove 0 or more characters from the left side of s.
- Remove 0 or more characters from the right side of s.
- Remove 0 or more characters from the left side of s and Remove 0 or more characters from the right side of s.

We need to find the number of distinct substrings.

**Examples**:

Input Format: str = “ababa”Result: 9Explanation: Total number of distinct substring are 9, which are,"a", "b", "ab", "ba", "aba", "bab", "abab", "baba" and "ababa"Input Format: str = “abcde”Result: 15Explanation: Total number of distinct substring are 15, which are,"a", "b", "c", "d", "e", "ab", "bc", "cd", "de", "abc", "bcd","cde", "abcd", "bcde", and "abcde"

**Problem Statement 3**: Given a weighted undirected graph with N nodes and M edges. The stress level of a path between two nodes is defined as the weight of the edge with the maximum value present in the path. Given a source node “source” and destination node “destination”. Find the path with minimum stress level. If no such path exists, return -1.

**Examples**:

Input Format: N = 5, M = 6,graph_from = {1, 1, 1, 2, 4, 5},graph_to = {2, 4, 5, 3, 3, 3},graph_weight = {10, 3, 4, 5, 2, 6},source = 1, destination = 3Where graph_from, graph_to, graph_weight represents the description of an edge.Result: 3

**Explanation**:

Given graph:

There are 3 paths from source to destination. The respective stress levels for each path are:

1-2-3 : Stress level = 10

1-4-2 : Stress level = 3

1-5-3 : Stress level = 6

Hence, the minimum stress level = 3.

**Problem Statement 4**: There are n cars parked in the parking lot and you want to cover k cars by building a roof over them. What’s the minimum length of the roof that would cover k cars?

We are given the slots for each car.

**Examples**:

Input Format: N = 4, cars[] = {2, 10, 8, 17}, K = 3Result: 9Explanation: There are 4 cars at slots 2, 10, 8, 17. You could build a roof of length 9 that will cover the slots from 2 to 10, thus covering cars at slots 2, 10, 8. No shorter roof could cover 3 cars.Input Format: N = 4, cars[] = {1, 2, 3, 10}, K = 4Result: 10Explanation: We need to make a roof of length 10to cover all the slots from 1 to 10.

**Round 2**: DSA Round on Video Call.

This round was conducted on Google meet. This round was easier than I expected.

**Topics asked:** Arrays, Stack, Binary Search

**Problem Statement 1**: We are given an array of “asteroids” of integers representing asteroids in a row. For each asteroid, the absolute value represents its size, and the sign represents its direction (positive meaning right, negative meaning left). Each asteroid moves at the same speed. Find out the state of the asteroids after all collisions. If two asteroids meet, the smaller one will explode. If both are the same size, both will explode. Two asteroids moving in the same direction will never meet.

**Examples**:

Input Format: asteroid[] = {5, 10, -5}Result: {5, 10}Explanation: The 10 and -5 will collide and theasteroid with value 5 will blast.10 and 5 will never collide.Input Format: asteroid[] = {-2, -1, 1, 2}Result: {-2, -1, 1, 2}Explanation: -2 and -1 are moving to their left,while 1 and 2 are moving to their right.Thus, they will never collide.

**Problem Statement 2**: Find the minimum element in a rotated and sorted array.

**Examples**:

Input Format: array[] = {5, 6, 1, 2, 3, 4}Result: 1Explanation: The minimum element is 1.

**Round 3**: HR Round

This round was also conducted on google meet. This round mainly focused on the projects done throughout college life. The interview asked to explain 2 projects in detail. I had done a couple of projects in Machine Learning, thus I explained that. Then, the interviewer asked if you have worked on any other technologies. After that, she asked if I was comfortable with Java, I answered I do not prefer Java to solve problems, but I can work with it. Then, she asked a few theoretical problems based on Java. The interview ended on a good note.

**Verdict:** Selected

**Message to Aspiring Students:**

*Prepare for DSA as much as you can. It’s never too late to start.*