Tip 1 : Practice coding from Leetcode, Interview bit, at least 100 questions
Tip 2 : Practice any one automation framework includes design patterns
Tip 1 : Restrict your resume to 1 page and write your practical work only
Tip 2 : Mention top topics like Selenium, Rest Assured Automation, Language used Java etc



V is the number of vertices present in graph G and vertices are numbered from 0 to V-1.
E is the number of edges present in graph G.
The Graph may not be connected i.e there may exist multiple components in a graph.
Use simple recursion approach to solve this



• The given leaf node becomes the root after the inversion.
• For a node (say, ‘x’)
○ If there exists the left child that is not yet taken then this child must become the right child of ‘x’.
○ If the left child is already taken then the right child is still on the right side of ‘x’.
• The parent of ‘x’ must be the left child of ‘x’.

Consider the above binary tree (image- before inversion), if the given leaf node is ‘1’ then the binary tree after inversion becomes exactly the same as given in the image representing after inversion.
The given binary tree will only have distinct values of nodes.
You are provided with a Binary Tree and one of its leaf nodes. You have to invert this binary tree.



The idea is to maintain a maxHeap of size k. A number is to be evicted from this heap if the k-sized window moves past it.
-> If that number to be evicted is at the top, immediately pop the heap.
-> if not, then maintain a toDelete heap which will evict the number as soon as it reaches top in both. Keep discarding numbers from both these heaps until the tops don't match.



1. Delete a character
2. Replace a character with another one
3. Insert a character
Strings don't contain spaces in between.
Firstly I gave the interviewer, a recursive solution then he asked me to reduce complexity as it was exponential of recursive solution so I gave him a top-down DP solution.


Input is given such that the answer will fit in a 32-bit integer.
Input: 'k' = 3, 'arr' = [1, 20, 13, 4, 4, 1]
Output: 80
Explanation:
We can divide the array into the following subarrays
[1,20] max of this subarray is 20 so the contribution of
this subarray in the final answer will be 20*2=40.
[13,4,4] max of this subarray is 13 so the contribution of
this subarray in the final answer will be 13*3=39.
[1] max of this subarray is 1 so the contribution of this
subarray in the final answer will be 1*1=1.
So, the answer will be 40 + 39 + 1 = 80.
Use dynamic Programming. This is just a variation of the MCM problem and can be understood just by building a recursion tree as we generally do for MCM-type problems. It is a standard problem, just we need to identify the pattern.



Suppose ‘A’ = “brute”, and ‘B’ = “groot”
The shortest supersequence will be “bgruoote”. As shown below, it contains both ‘A’ and ‘B’ as subsequences.
A A A A A
b g r u o o t e
B B B B B
It can be proved that the length of supersequence for this input cannot be less than 8. So the output will be bgruoote.
For every string s we pre-calculate the length of the longest possible overlap between s and any other strings.
Then for every possible subset A'of A, we could use the sum of the precalculated lengths as an upper bound to the total overlaps that can be obtained by combining all the strings in A'.
Using this upper bound, we could give up early on many branches.

Here's your problem of the day
Solving this problem will increase your chance to get selected in this company
How do you remove whitespace from the start of a string?