Tip 1 : Build a strong foundation by acquiring a deep understanding of how each data structure works. Try out a few LeetCode problems for every concept.
Tip 2 : Try to talk out loud through your thinking process, diagram the problem, ask questions and decide on an approach with the interviewer, before jumping into coding.
Tip 1 : Tailor your resume to suit the position you are applying for
Tip 2 : Limit it to one page
Given Pairs = [3,4], [1,2], [2,3].
The length of the maximum chain will be 2. The longest chain is [1,2] -> [3,4].
1. You can select a pair only once.
2. You needn’t use up all the given pairs.
3. You can select pairs in any order.
Alex has a list of items to purchase at a market. The cashier offers to discount the items after the first one by the lowest marked price among the prior items. No item's price can be discounted below 0, and the items cannot be reordered. Calculate the payable amount.Example: prices = [2,5,1,4]Alex pays 2 for the first item,Second item costs, 5 - 2 = 3Third item costs, max(1 - min(5, 2), 0) = 0Fourth item costs, 4 - 1 = 3
Questions on semaphores, mutex, polling, TCP servers, load balancing and DNS
Questions on sharding and partitioning
Step 1 : Discussed some corner cases with the interviewer. (Suppose the array is [3,2,1] we don't have a lexicographical larger rearrangement).
Step 2 : Started with brute force and then optimized it to the single pass approach.
Step 3 : Mentioned the changes I would make to take care of negative numbers as well.
1. If any two numbers have the same count of set bits, then in the sorted array they will appear in the order in which they appear in the original array. For example, let the array be { 2, 4, 3}, in this case, both 2 and 4 have the same number of set bits so the answer will be {3, 2, 4} and not {3, 4, 2}, because in the original array 2 appears before 4.
2. The array may contain duplicate elements.
Used Brian Kernighan’s algorithm to find the no. of “set bits” for every number and stored them in a Map, them
used a Custom Comparator to sort the array.
What is inheritance and its types?
What is a singleton class?
How to design a singleton class?
Tell me about your previous internship experience and projects.
What do you know about tech stack?
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?