# Hike Interview Experience | Off Campus September 2019

**Round 1: Online Coding Round**

5 Programming Questions, Duration: 75 minutes

- Given two coordinates (a, b) and (c, d), check if (a, b) can be made (c, d). At every step (a, b) can be converted to (a+b, b) or (a, a+b). Since there are two choices to be made at each step, recursion is the approach. Only “Yes” or “No” had to be the output.
- Given a 26 length array which indicates whether a character is normal or special(0/1), a string and an integer k, find the longest substring in input string such that their are atmost k special characters in it. Looking for each substring would timeout so use sliding window technique and keep the count of special characters encountered, Whenever the count>k, reduce the window form the beginning.
- Given an array of strings, we can move from one string to another by deleting one character. Find the longest chain that can be formed by performing this operation. Since the chain will constitute of strings with difference of length 1, we can sort the strings on the basis of length and then create the chain.
- Given a 2D array with 0 and 1, find the largest square with all 1s. DP question.
- Given an array, find the minimum number of swaps needed to move all even elements to beginning and odd elements to end of array.

**Round 2:**

- GetMin() function in Stack.
- Given two sorted linked lists, merge them. Then he modified the question to given k sorted linked lists, merge them. This can be done by using k-sized min-heap.
- Given an array you have sort it based on the relative ordering of another array. Modify custom sort.
- Minimum platforms needed in a railway station. I told him O(nlogn) approach. He asked for O(n) approach. I wasn’t able to think of O(n) approach so he asked another question which would help to solve the current question. How to check if two strings are anagrams? This question helped to find the O(n) solution.
- Given an array find all the subsets whose sum is divisible by 8. I knew that cumulative sum had to be taken but then I couldn’t think how to use that. So he told me that I can form an equation of numbers divisible by 8. If say sum(i, j) (i<j)is divisible by 8 then, sum(0, j) = 8*sum(i, j) + sum(0, i-1). And the possible remainders are 0-7. So we can store the remainder at each j, and such combination to determine the answer.
- How is HashMap implemented in Java? Handling Collisions and how is the hashmap size handled as more and more data comes in. The hashmap size is doubled and existing keys are remapped.

**Round 3:**

- Singleton class and its implementation.
- Reader Writer Problem with modifications to give preference to writer if it arrives, since standard implementation starves writers.

**Round 4:**

- LRU Cache implementation.
- Then he modified the question. Each key has a Time to expiry field. So those keys had to be removed from the cache. I started with hashmap but he was looking for a different data structure.

**Round 5:**

Round with VP. Asked me behavioral questions. About my CV, my interests.

Verdict: Selected.

## Recommended Posts:

- TCS Interview Experience | Off-Campus September 2019
- Tata Digital Health Interview Experience | (On Campus) September, 2019
- Oracle Interview Experience (On-Campus for APPS Profile) September 2019
- D.E. Shaw Internship Experience (On-Campus September 2019)
- Goldman Sachs Interview Experience | September 2019 | Experienced
- Samsung Interview Experience (On-Campus for Software Engineer) (September 2018)
- Bharti SoftBank (Hike) Interview Experience | Set 4 (Off-Campus for SDE1)
- Bharti SoftBank (Hike) Interview Experience | Set 5 (Off-Campus for Portal Team)
- TCS Digital Experience(September 2019)
- OYO Interview Experience 2019 (On-Campus)
- IBM Interview Experience | On-Campus 2019
- Oyo Interview Experience SDE - On campus 2019
- Oyo Interview Experience (On-Campus 2019)
- TCS Interview Experience (On-Campus 2019)
- OYO Interview Experience | On-Campus 2019 for SDE-1

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.