Tip 1 : Graph should be on your tips.
Tip 2 : While explaining the solution to interviewer, don't just hop onto the most optimal solution. Start with the brute force one, give the cons of brute force solution, and then go step by step till you reach the optimal solution.
Tip 3 : Improve your communication skills as well.
Tip 1 : Mention only what is required for your profile, for e.g. do not stress too much on your co-curricular stuff. Rather, try explaining more of your technical stuff that is relevant for your job.
Tip 2 : Keep it limited to 1 page. And make sure it's a pdf and not an image.



1234 is represented as (1 -> 2 -> 3 -> 4) and adding 1 to it should change it to (1 -> 2 -> 3 -> 5).
The input Linked list does not have any trailing zeros.
We have been given a number that is represented in the form of a linked list such that each digit corresponds to a node. He has been asked to add 1 to it and return the updated list.



Let S = “abdd” and X = “bd”.
The windows in S which contain all the characters in X are: 'abdd', 'abd', 'bdd', 'bd'.
Out of these, the smallest substring in S which contains all the characters present in X is 'bd'.
All the other substring have a length larger than 'bd'.
You are given two strings S and X containing random characters. Your task is to find the smallest substring in S which contains all the characters present in X.



1. The given graph may have self-loops and parallel edges.
Consider ‘N’ = 4, ‘EDGES’ = [[0, 1], [0, 3], [1, 2], [3, 2]], ‘SRC’ = 0 and ‘DEST’ = 2. The given directed graph is shown below.

Here, all the paths that start from node 0 are -:
1. 0->1->2
2. 0->3->2
Both of these paths eventually end at node ‘2’ i.e node ‘DEST’. Thus we should return True.
The idea is to do Depth First Traversal of given directed graph.
Start the DFS traversal from source.
Keep storing the visited vertices in an array or HashMap say ‘path[]’.
If the destination vertex is reached, print contents of path[].
The important thing is to mark current vertices in the path[] as visited also so that the traversal doesn’t go in a cycle.



The lists (1 -> 2 -> 1), (3 -> 4 -> 4-> 3), and (1) are palindromes, while the lists (1 -> 2 -> 3) and (3 -> 4) are not.
A simple solution is to use a stack of list nodes. This mainly involves three steps.
Traverse the given list from head to tail and push every visited node to stack.
Traverse the list again. For every visited node, pop a node from the stack and compare data of popped node with the currently visited node.
If all nodes matched, then return true, else false.



Below is the example showing the input tree and its sum tree.

Get the sum of nodes in the left subtree and right subtree. Check if the sum calculated is equal to the root’s data. Also, recursively check if the left and right subtrees are SumTrees.



The idea is to use Hashing. We first insert all elements in a Set. Then check all the possible starts of consecutive subsequences.

Here's your problem of the day
Solving this problem will increase your chance to get selected in this company
To make an AI less repetitive in a long paragraph, you should increase: