Tip 1 : Work on communicating effectively, give a lot of mock interviews. There is no point studying so hard if your thoughts or solution don't reach the interviewer.
Tip 2 : Practice variety of questions. 50 questions of different topics, patterns are better that 50 questions done for same topic.
Tip 3 : Try to think of solution by different approaches, this will expand your horizon by doing less questions.
Tip 1 : Don't make a fancy resume, keep it simple, you can use Latex templates from overleaf.com.
Tip 2 : Make it short and crisp. Resume should not be more than 1 page. And don't write anything you're not confident about. For experienced people, read the JD first and design your resume accordingly.
[1, 2, 3, 4] is a strictly increasing array, while [2, 1, 4, 3] is not.
Used DP
Let the encoded sequence be 121,
The first way to decode 121 is:
1 = A
2 = B
1 = A
Thus, the decoded string will be ABA.
The second way to decode 121 is:
12 = L
1 = A
Thus, the decoded string will be LA.
The third way to decode 121 is:
1 = A
21 = U
Thus, the decoded string will be AU.
So, there will be 3 ways to decode the sequence 121 i.e. [(ABA), (LA), (AU)].
The input sequence will always have at least 1 possible way to decode.
As the answer can be large, return your answer modulo 10^9 + 7.
Can you solve this using constant extra space?
Used DP
Consider the given binary tree:
For the given tree the leaf nodes are 5, 4, 7, 6. All these nodes are on the same level. So the output will be True.
I gave a level-order traversal solution using queue and then he asked me to optimise it to O(1) space.
A subsequence of an array/list is obtained by deleting some number of elements (can be zero) from the array/list, leaving the remaining elements in their original order.
Gave him a recursive solution then optimised it using DP(to O(n) time and O(n) space) and then again optimised to O(1) space.
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.
Code this problem beforehand. It's a very common problem.
There are 100 doors in a row, all doors are initially closed. A person walks through all doors multiple times and toggle (if open then close, if close then open) them in following way:
In first walk, the person toggles every door
In second walk, the person toggles every second door, i.e., 2nd, 4th, 6th, 8th, …
In third walk, the person toggles every third door, i.e. 3rd, 6th, 9th, …
In 100th walk, the person toggles 100th door.
Which doors are open in the end?
Practise puzzles from gfg
Tell the difference between Mutex and semaphores.
Study OS nicely.
What is Indexing, why it is done and explain all the types of Indexing?
Study nicely.
Given employee and dept table find the no of employees in each dept(Question on Joins).
Study SQL queries nicely.
Difference between function overloading and function overriding with example. And also about runtime and compile time binding while overriding.
Here's your problem of the day
Solving this problem will increase your chance to get selected in this company
Which operator is used for exponentiation in Python?