Tip 1: Data structures are very important while going into Tech Interviews.
Tip 2: Having a system design is a plus.
Tip 3: Dealing with failures is the most significant learning I had.
Tip 1: Have a single-page resume with brief information about the academic and professional journeys (if applied) along with the skills.
Tip 2: Adding the details of the projects is a plus.
Two strings are said to be anagram if they contain the same characters, irrespective of the order of the characters.
If 'STR1' = “listen” and 'STR2' = “silent” then the output will be 1.
Both the strings contain the same set of characters.
Step 1: I traversed through the first string and noted the frequencies of each character.
Step 2: I traversed through the second string and checked whether the count of the characters is under the frequency of the same character in the first array. If it happens for all the characters, then the second string is an anagram of the first; otherwise, it is not an anagram.
The given linked list is 1 -> 2 -> 3 -> 4-> NULL. Then the reverse linked list is 4 -> 3 -> 2 -> 1 -> NULL and the head of the reversed linked list will be 4.
Can you solve this problem in O(N) time and O(1) space complexity?
I have solved this problem by maintaining three pointers, pointing to the current, previous, and next nodes. I have used only one traversal. While traversing the given linked list, there is a need to tweak the pointers.
There was an ask to make the calculator application to check the OOPS knowledge.
This problem was given into steps:
1. Design a basic calculator which can perform the arithmetic calculations.
2. Extend the already designed basic calculator, to a new calculator which can also perform logical operations, programming operations, scientific operation.
Tip 1: Gain the OOPS knowledge and practice.
This round was to check the knowledge on pointers and double pointers.
1. Push(num): Push the given number in the stack if the stack is not full.
2. Pop: Remove and print the top element from the stack if present, else print -1.
3. Top: Print the top element of the stack if present, else print -1.
4. isEmpty: Print 1 if the stack is empty, else print 0.
5. isFull: Print 1 if the stack is full, else print 0.
We perform the following operations on an empty stack which has capacity 2:
When operation 1 1 is performed, we insert 1 in the stack.
When operation 1 2 is performed, we insert 2 in the stack.
When operation 2 is performed, we remove the top element from the stack and print 2.
When operation 3 is performed, we print the top element of the stack, i.e., 3.
When operation 4 is performed, we print 0 because the stack is not empty.
When operation 5 is performed, we print 0 because the stack is size 1, which is not equal to its capacity.
In solving this problem, there is one very important point to note that there is need to track the tail node.
There was many questions to check the knowledge on the pointers and double pointers.
Tip 1: Have good knowledge on the pointers.
Here's your problem of the day
Solving this problem will increase your chance to get selected in this company
How do you select an element by class name in CSS?