# Swiggy Interview Experience | Set 2 (On-Campus)

First Round (Online Coding on HackerRank) 4 problems Time -90 min 1. Stock Buy Sell to Maximize Profit
```Input: 1 3 100
Output: 196```
link- https://www.hackerrank.com/challenges/stockmax 2. Given A string you need to print all subset of that string
```Input: "abc"

Output:
"a"
"b"
"c"
"ab"
"ac"
"bc"
"abc"```
3. Check if a given sequence of moves for a robot is circular or not Input: path[] = “GLGLGLG” Output: Given sequence of moves is circular Input: path[] = “GLLG” Output: Given sequence of moves is circular link- https://www.geeksforgeeks.org/check-if-a-given-sequence-of-moves-for-a-robot-is-circular-or-not/ Second Round (F2F Interview) 45 min. 1. First he asked me to design the database for food shop, then he asked me to minimize the complexity of database and then he asked me some DBMS Query related to Join Operation. 2. Given a Sorted array in which all elements are repeated except one element. Find non repeated element in O (log n). 3. Some Questions On DNS server and IP address. 4. What is cache Memory? What is TLB? And uses? 5. Which policy you will use to swap pages? Implement LRU? Third Round (F2F Interview) (70-80) min. 1. Discussion on project 2. What is Encryption? How you can use it in your project? 3. What is Block cipher and Advanced Encryption Standard (AES)? If someone knows that you are using Polybius Cipher then what is the complexity in decrypting your original data (information)? 4. He modified â€œStock Buy Sell to Maximize Profit â€œproblem i.e. you canâ€™t buy or sell stock continuously and you can skip any day to sell or purchase.
```  Input: 2 100 2 3 500 2 1
Output: max profit 596```
3. Diff between Mutex and Semaphore? 4. There is stream of infinite number you need to find the median of number?
```Input: 1 5 10 15 20 22 35 ....inf

Output:
Median of first number 1
Median of first 2 numbers 3
Median of first 3 numbers 5
Median of first 4 numbers 7.5
Median of first 5 numbers 15

....

....```