Tip 1 : Practice popular questions from Arrays, Binary Trees, LinkedLists from CodeStudio's Interview Problems
Tip 2 : Make sure you are aware of calculating the time and space complexity for every problem you're coding.
Tip 3 : Prepare through Mock Interviews to practice explaining your approach while solving in an actual interview.
Tip 1: Describe the best of your projects in minimum words. Don't forget to add buzzwords like REST APIs, DB Indexing, Benchmarking, etc., if you worked on the backend.
Tip 2: Don't add school achievements like Olympiads or being a class topper to your resume.
Tip 3: If you have some work experience, present it in a way that markets yourself. Use terms like "Created" or "Owned the project through the entire SDLC.
There are three numbers, say 8, 5 and 10.
8 can be written as 1 0 0 0 .
5 can be written as 0 1 0 1.
10 can be written as 1 0 1 0.
positions of the bits as i j k l.
So we can see majority bit at ith position are set bits so ith bit will be 1. Similarly for positions of j, k and l are set as 0 0 0 respectively.
So the number generated is 1 0 0 0 i.e. 8.
Given a linked list, reverse alternate nodes and append them to the end of the list. Extra allowed space is O(1).
Input: 'a' = [7, 12, 1, 20]
Output: NGE = [12, 20, 20, -1]
Explanation: For the given array,
- The next greater element for 7 is 12.
- The next greater element for 12 is 20.
- The next greater element for 1 is 20.
- There is no greater element for 20 on the right side. So we consider NGE as -1.
Solved this question using stack and comparing current element of array to top of the stack.
1. get(key) - Return the value of the key if the key exists in the cache, otherwise return -1.
2. put(key, value), Insert the value in the cache if the key is not already present or update the value of the given key if the key is already present. When the cache reaches its capacity, it should invalidate the least recently used item before inserting the new item.
Type 0: for get(key) operation.
Type 1: for put(key, value) operation.
1. The cache is initialized with a capacity (the maximum number of unique keys it can hold at a time).
2. Access to an item or key is defined as a get or a put operation on the key. The least recently used key is the one with the oldest access time.
Design and implement a data structure for a Least Recently Used (LRU) cache to support the following operations:
1. `get(key)` - Return the value of the key if the key exists in the cache; otherwise, return -1.
2. `put(key, value)` - Insert the value in the cache if the key is not already present, or update the value of the given key if the key is already present. When the cache reaches its capacity, it should invalidate the least recently used item before inserting the new item.
If the given input string is "Welcome to Coding Ninjas", then you should return "Ninjas Coding to Welcome" as the reversed string has only a single space between two words and there is no leading or trailing space.
This was a standard question about strings and gave him an approach to initially reverse each word in the string and then reverse the whole string, and he was satisfied with that approach.
Can you solve each query in O(logN) ?
He extended the above question, and after a hint, I was able to come up with a binary search approach in which the end index would double up each time the binary search was called. He looked convinced.
You are given ‘ARR’ = {1, 2, 2, 3, 3} and ‘K’ = 2.
The answer will {2, 3} as 2 and 3 are the elements occurring most times.
Given a book of words, assume you have enough main memory to accommodate all the words. Design a data structure to find the top K maximum occurring words. The data structure should be dynamic so that new words can be added.
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?