Tip 1 : Practice coding questions on Leetcode and GeeksforGeeks.
Tip 2 : Have a thorough understanding of all the core subjects.
Tip 3 : Do at least 2 good projects.
Tip 1 : Keep a one-page resume only.
Tip 2 : Focus more on work experience and skills.
This was the first interview round. The interview began with a brief introduction and then followed questions on data structures.
I started with the brute force approach of using recursion and formulated a recursive function. The interviewer asked me to optimize the solution. So, I used dynamic programming. He asked me to code the function.
1. If ‘k’ is not present in the array, then the first and the last occurrence will be -1.
2. 'arr' may contain duplicate elements.
Input: 'arr' = [0,1,1,5] , 'k' = 1
Output: 1 2
Explanation:
If 'arr' = [0, 1, 1, 5] and 'k' = 1, then the first and last occurrence of 1 will be 1(0 - indexed) and 2.
I could think of a solution using binary search for this question. So, I directly explained that approach. The interviewer was satisfied.
Time Complexity: O(logn)
This was the second interview round. We discussed one coding problem followed by some questions on the projects that I had done.
1. Delete a character
2. Replace a character with another one
3. Insert a character
Strings don't contain spaces in between.
I first thought of a recursive approach and formulated the recurrence relation. The interviewer was expecting an optimized dynamic programming solution, however, I was not able to completely build a dp solution.
Why have you used MongoDB as the database? Difference between SQL and No-SQL database?
Tip 1 : Go through your projects thoroughly.
Tip 2 : You should be able to answer all questions related to the projects that you have done.
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?