Swiggy Interview Experience for SDE-II

07 Jul, 2021
I applied on LinkedIn for Swiggy SDE-II (R&G). Got the first round link – Hackerrank after 9-10 days.
Round 1(Online Coding): HackerRank
3 Questions were asked in this round and time limit was 75 minutes. All the 3 questions were hard.
Flexible StringsGiven a string abccc, Given are below operationsb can be replaced by ca can be replaced by bCan the given string converted to all of the same charcters? The string abccc can be converted to ccccc by following operations:Convert b at index 1 to cConvert a at index 0 to bConvert b at index 0 to cThe given operations can be performed infinite number of times on the string. We need to find whether the string can be converted to a string containing all same characters. Note : the operations can be performed in any order and any number of times.Example 1:
Input : String - abccc
Operations -
b --> c
a --> b
Output - YES
Example 2: String - abcdc
Operations:
b --> c
a --> d
Output - NOProgramming ContestA programming organization is planning a contest for several programmers, each of which has a certain rating. (The higher the rating, the better the programmer.) Each programmer is paired with another programmer, and the difference between their ratings is referred to as the “bias amount”. Given the ratings of all the programmers in the contest, what is the minimum total bias amount that can be achieved by optimally planning the programmer pairs? [ Some modification in this problem]Maximum Swiggy Genie This sum is a variation of Maximum Profit in Job SchedulingGiven 3 arrays called as pickup, drop and tip. find the max profit the delivery guy can earn. The guy can only process one delivery at a time.E.g he gets profit of 5 - 0 + 1 = 6
6 units if delivers the 1st order
pickup: [0,2,9,10,11,12]
drop:[5,9,11,11,14,17]
tip:[1,2,3,2,2,1]
Flexible StringsGiven a string abccc, Given are below operationsb can be replaced by ca can be replaced by bCan the given string converted to all of the same charcters? The string abccc can be converted to ccccc by following operations:Convert b at index 1 to cConvert a at index 0 to bConvert b at index 0 to cThe given operations can be performed infinite number of times on the string. We need to find whether the string can be converted to a string containing all same characters. Note : the operations can be performed in any order and any number of times.Example 1:
Input : String - abccc
Operations -
b --> c
a --> b
Output - YES
Example 2: String - abcdc
Operations:
b --> c
a --> d
Output - NO
Given a string abccc, Given are below operations
b can be replaced by c
a can be replaced by b
Can the given string converted to all of the same charcters? The string abccc can be converted to ccccc by following operations:
Convert b at index 1 to c
Convert a at index 0 to b
Convert b at index 0 to c
The given operations can be performed infinite number of times on the string. We need to find whether the string can be converted to a string containing all same characters. Note : the operations can be performed in any order and any number of times.
Example 1:
Input : String - abccc
Operations -
b --> c
a --> b
Output - YES
Example 2: String - abcdc
Operations:
b --> c
a --> d
Output - NO
Programming ContestA programming organization is planning a contest for several programmers, each of which has a certain rating. (The higher the rating, the better the programmer.) Each programmer is paired with another programmer, and the difference between their ratings is referred to as the “bias amount”. Given the ratings of all the programmers in the contest, what is the minimum total bias amount that can be achieved by optimally planning the programmer pairs? [ Some modification in this problem]
A programming organization is planning a contest for several programmers, each of which has a certain rating. (The higher the rating, the better the programmer.) Each programmer is paired with another programmer, and the difference between their ratings is referred to as the “bias amount”. Given the ratings of all the programmers in the contest, what is the minimum total bias amount that can be achieved by optimally planning the programmer pairs? [ Some modification in this problem]
Maximum Swiggy Genie This sum is a variation of Maximum Profit in Job SchedulingGiven 3 arrays called as pickup, drop and tip. find the max profit the delivery guy can earn. The guy can only process one delivery at a time.E.g he gets profit of 5 - 0 + 1 = 6
6 units if delivers the 1st order
pickup: [0,2,9,10,11,12]
drop:[5,9,11,11,14,17]
tip:[1,2,3,2,2,1]
This sum is a variation of Maximum Profit in Job Scheduling
Given 3 arrays called as pickup, drop and tip. find the max profit the delivery guy can earn. The guy can only process one delivery at a time.
E.g he gets profit of 5 - 0 + 1 = 6
6 units if delivers the 1st order
pickup: [0,2,9,10,11,12]
drop:[5,9,11,11,14,17]
tip:[1,2,3,2,2,1]
Verdict :Rejected
Marketing
Swiggy
Interview Experiences
Swiggy
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.