Tip 1 : Being consistent is the key. Practice DSA questions daily and revised core concepts weekly
Tip 2 : I personally recommend you Coding Ninjas and Geeks For Geeks for interview preparation.
Tip 3 : Be an active user of job platforms and started appearing in mock or real interviews for confidence without thinking about the level of your preparation
Tip 1 : Make a one-page resume and add skills in which you are confident
Tip 2 : Mention at least two good projects and links to coding platforms
Tip 3 : Must read interview experiences before any interview
This was the DSA round. The interviewer asked 3 questions which are of medium level and asked upto optimal solution
Input:
Output: 2 35 2 10 2
Step 1 : Figure out how the tree will look after traversal and got the point that I have to do something like vertical order traversal
Step 2 : I do a level order traversal so that the topmost node at a horizontal node is visited before any other node of the same horizontal distance below it.
Step 3 : Hashing is used to check whether a node at a given horizontal distance is seen.
Step 4 : I explained the whole approach and code
Suppose we have 2 balls of type ‘A’, 1 ball of type ‘B’ and 1 ball of type ‘C’, following are the ways to arrange them in the required fashion.
ABCA
ABAC
ACBA
ACAB
BACA
CABA
Hence, there is a total of six ways.
Step 1 : Initially I read the problem and start thinking about two pointer approach
Step 2 : But after a few minutes I got to the point where I can treat balls as numbers (i.e 0, 1, 2) then I remembered the DNF algorithm
Step 3 : So I took three-pointers i.e low, high, and mid, and write code keeping in mind I save to store red -> white -> blue and applied DNF algo
A graph problem-
Given N X N matrix filled with 1, 0, 2, 3. Find whether there is a path possible from source to destination, traversing through blank cells only. You can traverse up, down, right, and left.
A value of cell 1 means Source.
A value of cell 2 means Destination.
A value of cell 3 means a Blank cell.
A value of cell 0 means Blank Wall.
Step 1 : He just asked for an approach to this question so I told him like that
Consider each cell as a node and each boundary between any two adjacent cells be an edge. so the total number of Nodes is N * N. So the idea is to do a breadth-first search from the starting cell till the ending cell is found.
Step 2 : Then he asked for time complexity
It was a complete Database Round.
Asked for 2-3 SQL Queries
Query 1: Related to join of tables
Query 2: Normalize the Resultant table of Query 1 and asked for some theoretical questions regardings Normalization, Acid Properties, etc.
Tip 1 : Practice SQL queries
Tip 2 : Grasp theoretical concepts also
Asked for Schema Design of LinkedIn
Tip 1 : Practice the design of the schema
Tip 2 : Well understanding of the keys in schema
Asked for almost everything that I mentioned in my resume
Input: linked list = [1 2 3 4] , k = 2
Output: 3 4 1 2
Explanation:
We have to rotate the given linked list to the right 2 times. After rotating it to the right once it becomes 4->1->2->3. After rotating it to the right again, it becomes 3->4->1->2.
1)Create a function for a single rotation
2)Take care of some edge cases
3)Simply make the value of k smaller: to avoid the repeated effect of rotation (k=k%n)
4)Since the function singleRotate() will rotate the list one time only so to rotate it k times call the function under a while loop which will be operated k-times
5)Return the head of the list
Schema Design for Instagram post
Asked about web development theoretical concepts some remembered questions like ----
Q1: You have given n no. of articles and you have to change the color of the title in an alternate fashion in CSS
Q2: What happens when we hit google.com in browser?
Tip 1 : Well revised your skills and made some projects hands-on
Tip 2 : Read the standard interview question
Here's your problem of the day
Solving this problem will increase your chance to get selected in this company
Which SQL keyword removes duplicate records from a result set?