Tip 1 : Practise new questions
Tip 2 : Give mock interviews
Tip 3 : Give time based contests
Tip 1 : Have some projects on resume
Tip 2 : Keep it concise and accurate
There were 2 Coding questions and 2 questions for describing the solution apprach for the coding questions. Bothe were of Medium level.



For the given string “what we think we become”
“what”,” think”, and “become” occurs 1 time, and “we” occurs 2 times in the given string.
I used stacks to provide efficient solution and was able to pass all test cases.



I used bottom up apprach to solve the problem with the given constraints and was able to pass all the test cases.
It was a video interview in the afternoon with an SDE. The interview started with an introduction of both of us and then we had some discussions around my Project and Work Experience and then 2 coding questions based on DSA. The interviewer was friendly and we had a good dicussion.



Input String: "aaaa"
Expected Output: "a"
Input String: "aabbbcc"
Expected Output: "abc"



Given a binary tree :

All the root to leaf paths are :
1 2 4
1 2 5
1 3
1. Two nodes may have the same value associated with it.
2. The root node will be fixed and will be provided in the function.
3. Note that the nodes in a path will appear in a fixed order. For example, 1 2 3 is not the same as 2 1 3.
4. Each path should be returned as a string consisting of nodes in order and separated by a space.
5. The path length may be as small as ‘1’.
I was a video interviewer taken by senior SDE. It was a tough round which involved a lot of discussions.
It was a Low Level Design problem. It was similar to an open ended problem of designing the backened APIs for generating some real world data like news feed of a social media site. It was more of a discussion around what data structure should be used to store different data according to the use case .
It can be asked to implement methods related to getting the data and to design the classes for creating objects that will be used.
Tip 1 : Make sure to gather all the requirements he was expecting before i started coding.
Tip 2 : It is important to have constant communication with interviewer
Tip 3 : I recommend thoroughly understanding OOPS concepts and SOLID design principles especially if you have some work experience.



Input:
["AutocompleteSystem","input","input","input"]
[[["i want to join faang","icecream","i love coding ninjas"],[4,3,1],["i"],["s"],["#"]]
Output:
[null,["i want to join faang","icecream","i love coding ninjas"],[],[]]
Explanation:
* AutocompleteSystem obj = new AutocompleteSystem(["i want to join faang","icecream","i love coding ninjas"],[4,3,1]);
* obj.input(“i”); // return ["i want to join faang","icecream","i love coding ninjas"]. There are three sentences that have prefix "I".
* obj.input(“s”); // return []. There is no sentence with prefix “is”
* obj.input(“#”); // return [].
I tried giving brute force solution but he asked me to optimise it. I gave the trie based solution and he ask me to implement it.I had to implement trie data structure and all the methods which took some time but he was convinced in the end.
It was the Bar Raiser round.This was the last interview of the hiring process. Like always, it started with introductions of both of us. Then we had a long discussion about my work experience and projects — my contributions, learnings and challenges.
He asked me to share instances involving complex decision making and the details of actions taken. We had some technical discussions around my projects related to the tech stack and some implementation details.



class BinaryTreeNode {
int data; // Value of the node.
BinaryTreeNode *left; // Pointer to left child node.
BinaryTreeNode *right; // Pointer to right child node.
BinaryTreeNode *next; // Pointer to next right node at same level.
}
Consider the figure shown below. The left part represents the initial binary tree and right part represents the binary tree after connecting adjacent nodes at the same level.

In the tree shown in the picture above -:
The ‘next’ pointer of the node having value 2 is connected to the node having value 3.
The ‘next’ pointer of the node having value 4 is connected to the node having value 5.
The ‘next’ pointer of the node having value 5 is connected to the node having value 6.
The ‘next’ pointer of nodes having value 1, 3, 6 will have a value NULL as there are no next right nodes in their cases.
1. The structure of the ‘Node’ of a binary tree is already defined. You should not change it.
2. The root of the binary tree is known to you.
3. There is at least one node in the given binary tree.
4. You may only use constant extra space.
I used BFS (level order traversal) for the same.

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?