Tip 1 : Code & practice
Tip 2 : Have good grip on DS & Algorithms
Tip 1 : Clean one page resume
Tip 2 : Mention previous experiences, projects, coding profile links
OA consisted of 2 coding questions followed by the explanations on why this solution was proposed. Then a series of behavioral based questions (Work style)
Optimize Suggestions
Search nearest X restaurants in the city relative to the customer's location.
Input -
1. Pair of x & y coordinates representing the location of restaurants.
2. Number of restaurants returned to customer X
Note - Customer begins at (0,0)
Find the distance with the coordinates provided, the sort & pick first X elements & return



1. There can be more than one shortest route, you should return the one which is lexicographically smallest among them.
Consider that your friend’s house is in the cell (2, 1) in the grid. And the route given by your friend is represented by the string ‘STR’= “NNSEWEE”.
One of the smallest route to reach cell (2, 1) from origin i.e cell (0, 0) is given by string “EEN” i.e you start from the cell (0, 0), then move East, i.e at cell (1, 0), then again move East, i.e at cell (2, 0), and then finally move North i.e at cell (2, 1).
Note, there are some other smallest routes such as “NEE”, “ENE” etc, but “EEN” is the lexicographically smallest among them, so you should return it.
To find optimal answer, a bigger number just smaller than the max distance that can be formed by combination of both the forward & return routes.
Binary search can be used here.
Coding Interview (Chime)



For each node there can be four ways that the max path goes through the node:
1. Node only
2. Max path through Left Child + Node
3. Max path through Right Child + Node
4. Max path through Left Child + Node + Max path through Right Child



1. The grid has 0-based indexing.
2. A rotten orange can affect the adjacent oranges 4 directionally i.e. Up, Down, Left, Right.
BFS
Different types of graph traversals, which one should be used for shortest distance/time & why? Time complexities.
Tip 1 : Understand DS & TC well



For the given binary tree

The level order traversal will be {1,2,3,4,5,6,7}.
BFS + Flags to find the direction of visit



In zigzag order, level 1 is printed from left to right fashion, level 2 is printed from right to left. and level 3 is printed from left to right again, and so on…..
For the given binary tree

The zigzag traversal is [1, 4, 3, 5, 2, 7, 6]
Simulate the scenario & count the occurrences



Can you solve each query in O(logN) ?
Use Binary search



'N' = 3, 'A' = {3, 1, 2, 3}, 'X' = 4, 'Y'= 2, 'SUM' = 14
For 'i' = 1, 'j' = 2, Value of the expression = 4 * 3 + 2 * 1 = 14.
For 'i' = 1, 'j' = 3, Value of the expression = 4 * 3 + 2 * 2 = 16.
For 'i' = 1, 'j' = 4, Value of the expression = 4 * 3 + 2 * 3 = 18.
For 'i' = 2, 'j' = 3, Value of the expression = 4 * 1 + 2 * 2 = 8.
For 'i' = 2, 'j' = 4, Value of the expression = 4 * 1 + 2 * 3 = 10.
For 'i' = 3, 'j' = 4, Value of the expression = 4 * 2 + 2 * 3 = 14.
The possible pairs are :
(1, 3), (3,4)
One method - Using hashmaps
What is a hashmap? When is it used. What is the time complexity while retrieving data, inserting data?
Explain the internal working of maps in Java.
Tip 1 : Know the internal working of DS
Explain about the project you're currently working on. What are the challenges faced?
Tip 1 : Know your current project, know the tasks undertaken at work



A majority element is an element that occurs more than floor('N' / 2) times in the array.
Solved using Moore's voting algorithm
Questions based on the projects mentioned in the Resume
Tip 1 : Know your resume well

Here's your problem of the day
Solving this problem will increase your chance to get selected in this company
How do you remove whitespace from the start of a string?