Tip 1 : Practice problems daily
Tip 2 : Revise theoretical concepts
Tip 1 : Must have projects on your resume
Tip 2 : Always put the skills on your resume that you are confident about.
My interview was held in afternoon. The environment was calm and relaxing. The interviewers were very friendly and motivating.
1. If 'X' is not found in the array, return 0.
2. The given array is sorted in non-decreasing order.
Step 1 : I ran two loops. For every item counted a number of times, it occurs. To avoid duplicate printing, keep track of processed items.
Step 2 : The interviewer asked me to optimize the solution.
Step 3 : Then I used Hashing and the interviewer was satisfied.
Anagrams are defined as words or names that can be formed by rearranging the letters of another word. Such as "spar" can be formed by rearranging letters of "rasp". Hence, "spar" and "rasp" are anagrams.
'triangle' and 'integral'
'listen' and 'silent'
Since it is a binary problem, there is no partial marking. Marks will only be awarded if you get all the test cases correct.
Step 1 : I sorted both strings and then compared them. It was not good enough
Step 2 : The interviewer asked me to optimize the solution.
Step 3 : Then I used Hashmap and the idea is to put all characters of one string in Hashmap and reduce them as we encounter while looping over other strings.
'N' = 3
'ARR' = {2, 4, 1, 1}
TotalSum = 2 + 4 + 1 + 1 = 8
Tweaked Array = {6, 4, 7, 7}.
Here's your problem of the day
Solving this problem will increase your chance to get selected in this company
Which traversal uses a queue as its primary data structure?