Tip 1 : Practice DSA from Leetcode, Geeksforgeeks, etc.
Tip 2 : Go through the subjects from Geeksforgeeks, Javatpoint, etc.
Tip 1 : Keep it one-pager
Tip 2 : Try to cover maximum points by keeping each crisp. No need to go into details.



1. The heights of the buildings are positive.
2. Santa starts from the cell (0, 0) and he has to reach the building (N - 1, M - 1).
3. Santa cannot leave the grid at any point of time.
Don't remember the questions as of now.
The questions would be long but try to get the logic of each and implement them in a most optimized approach.



Can you solve each query in O(logN) ?



Consider the following Binary Tree:

So the final answer is
12 9 11 6
We need to maintain the level of every vertex and sum up the value of nodes in the respective level



Input: Let the binary tree be:

Output: [10, 4, 2, 1, 3, 6]
Explanation: Consider the vertical lines in the figure. The top view contains the topmost node from each vertical line.
This was a follow-up to the previous question.
We can store the first occurrence of some vertex for a particular level in some hashmap.
At the end, the map will be storing the top view of the binary tree.



If ‘WORDS’ = ["word","world","row"], ‘ORDER’ = "worldabcefghijkmnpqstuvxyz",the answer will be ‘NO’ as first and second words are not lexicographically sorted as ‘l’ comes before ‘d’ in alien language.
First I created a Directed Acyclic Graph of characters using the given input
Run Topological Sort on this graph to find the required output



In the given linked list, there is a cycle, hence we return true.

I used Floyd's Cycle Detection Algorithm to solve this problem
Tell any 2 components in OS where Tree Data Structure is used
Explain Inheritance
Explain Polymorphism
Explain ACID property in DBMS
Explain CRUD



1. The array can have duplicate elements.
2. Each of the array elements must belong to exactly one of the 'K' subsets.
3. The elements chosen for a subset may not be contiguous in the array.
The interviewer was more interested in how I reach to the approach.
I gave a backtracking solution where I checked by putting each element to one of the 3 partitions and checked if that gives a valid partition

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