Tip 1 : Practice at least 250 Questions
Tip 2 : Do good projects
Tip 3 : Don't take long gaps in between your coding days
Tip 1 : Keep it short and precise.
Tip 2 : Do not put false things on resume.
Coding test of 90 minutes comprising 2 coding questions



1. You are not required to print the output explicitly, it has already been taken care of. Just implement the function and return the minimum number of parentheses required to make a string valid.
We keep the track of balance of the string i:e the number of ‘(‘ minus the number of ‘)’. A string is valid if its balance is 0, and also every prefix has non-negative balance.



Let ‘S1’ be “ABBCD” and ‘S2’ be “ABC”, so the smallest substring of ‘S1’ which contains all the characters of S1 is “ABBA”.
Idea is to generate all possible substring of the given string S and store the frequency of each substring in a HashMap
The interviewer has provided a codility link and asked me to solve a single problem.



• The left subtree of a node contains only nodes with data less than the node’s data.
• The right subtree of a node contains only nodes with data greater than the node’s data.
• Both the left and right subtrees must also be binary search trees.

This is the binary search tree made by Ninja. But here, the left node of 8 is greater, and the right node is smaller.
If we swap the right and the left node of 8 Ninja’s Binary Search Tree will become correct.

This is the correct binary Search Tree.
Traverse the BST in In-order fashion and store the nodes in a vector.
The interviewer has given a codility link with two problems and asked me to solve them.


The intersection of the set of the persons who go to ‘CITY_A’ to those going to ‘CITY_B’ is to be disjoint set, whereas the union must be the ‘2N’.
I sorted the array based on the difference in the cost of both cities. Sorting can be done using a comparator interface in Java.



A valid IP address consists of exactly four integers, each integer is between 0 and 255 separated by single dots, and cannot have leading zeros except in the case of zero itself.
The following are valid IP addresses:
0.1.24.255
18.5.244.1
Following are invalid IP addresses:
0.01.24.255 (as 01 contains one leading zero).
18.312.244.1 (as 312 not lies between 0 and 255).
Split the string with ‘ . ‘ and then check for all corner cases. Before entering the loop, check the size of the string. Generate all the possible combinations using looping through the string. If IP is found to be valid then return the IP address, else simply return the empty list.

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?