Tip 1 - Practice Atleast 250 Questions from geeks from geeks and coding ninjas
Tip 2 - Ex- Do atleast 2 good projects
Tip 1 : Have some projects on resume.
Tip 2 : Do not put false things on resume and be confident.
2 coding questions



Consider the maze below :
0 0 0
0 -1 0
0 0 0
There are two ways to reach the bottom left corner -
(1, 1) -> (1, 2) -> (1, 3) -> (2, 3) -> (3, 3)
(1, 1) -> (2, 1) -> (3, 1) -> (3, 2) -> (3, 3)
Hence the answer for the above test case is 2.
The most efficient solution to this problem can be achieved using dynamic programming. Like every dynamic problem concept, we will not recompute the subproblems. A temporary 2D matrix will be constructed and value will be stored using the top-down approach.



A book will be allocated to exactly one ninja.
At least one book has to be allocated to a ninja.
Allotment of the books should be done in a contiguous manner. For example, a ninja can not be allocated book 2 and book 4, skipping book 3.
The idea is to use Binary Search. We fix a value for the number of pages as mid of current minimum and maximum. We initialize minimum and maximum as 0 and sum-of-all-pages respectively. If a current mid can be a solution, then we search on the lower half, else we search in higher half.
The interviewer started with asking my intro and then asked 2 DSA question.


You don’t have to print anything, it has already been taken care of. Just implement the function.
The string will contain lowercase alphabets only.



In the below histogram where array/list elements are {2, 1, 5, 6, 2, 3}.
The area of largest rectangle possible in the given histogram is 10.
By finding next smaller element and previous smaller element for every element in O(n) time complexity and O(n) auxiliary space .
As the round is only for 40-45 minutes, he told me not to write the code. Then he told me about his work at zomato and his recent achievements. I asked a few doubts regarding his work and how did they tackle a few problems (about the search option in the Zomato app as the interviewer worked on this particularly). This discussion went on for another 5 minutes and he ended the interview by adding a few points on work culture at zomato.



1. get(key) - Return the value of the key if the key exists in the cache, otherwise return -1.
2. put(key, value), Insert the value in the cache if the key is not already present or update the value of the given key if the key is already present. When the cache reaches its capacity, it should invalidate the least recently used item before inserting the new item.
Type 0: for get(key) operation.
Type 1: for put(key, value) operation.
1. The cache is initialized with a capacity (the maximum number of unique keys it can hold at a time).
2. Access to an item or key is defined as a get or a put operation on the key. The least recently used key is the one with the oldest access time.
When a page is referenced, the required page may be in the memory. If it is in the memory, we need to detach the node of the list and bring it to the front of the queue.
If the required page is not in memory, we bring that in memory. In simple words, we add a new node to the front of the queue and update the corresponding node address in the hash. If the queue is full, i.e. all the frames are full, we remove a node from the rear of the queue, and add the new node to the front of the queue.

Here's your problem of the day
Solving this problem will increase your chance to get selected in this company
What is recursion?