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
How to find the pre order traversal of a tree?
State complexity of merge sort
Questions based on radix sort
Pre-order traversal of a tree is a way to visit and process the nodes of a tree in a specific order. The pre-order traversal follows the rule of visiting the root node, then recursively visiting the left subtree in pre-order, and finally recursively visiting the right subtree in pre-order.
how does radix sort work?
What are the different variants of radix sort, such as least significant digit (LSD) radix sort and most significant digit (MSD) radix sort?
What is the time complexity of radix sort?
What are the applications or use cases where radix sort can be useful?
Can you implement radix sort in a specific programming language, such as Python or C++?
What are the advantages and disadvantages of radix sort compared to other sorting algorithms, such as comparison-based sorting algorithms like merge sort or quicksort?



• 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.
It is guaranteed that a BST can be always constructed from the given preorder traversal. Hence, the answer will always exist.
From PREORDER = [20, 10, 5, 15, 13, 35, 30, 42] , the following BST can be constructed:

Converting a pre-order traversal of a binary tree into a binary search tree (BST) involves constructing a BST from the given pre-order traversal sequence. The pre-order traversal sequence represents the order in which the nodes are visited starting from the root node.


To check if a given number is binary or not, you can follow these steps:
Convert the number to a string representation.
Iterate through each character in the string and check if it is either '0' or '1'. If any character is found that is not '0' or '1', then the number is not binary.
If all characters in the string are '0' or '1', then the number is binary.



Input: arr[] = {1,1,1,2,2,2}
Output: {1,2,1,2,1,2}
Note: {2,1,2,1,2,1} is also valid because there are no two adjacent elements which are the same.


You are given ‘N’ as 21, the only number whose sum of digits and the number itself equals 21 is 15 as 15 + 1 + 5 = 21. Hence the answer is [15].
Numbers and digits are related concepts that are used in mathematics to represent quantities and values.
A number is a mathematical concept that represents a quantity or value. Numbers can be classified into different types based on their properties, such as natural numbers (1, 2, 3, ...), integers (..., -3, -2, -1, 0, 1, 2, 3, ...), rational numbers (numbers that can be expressed as a ratio of two integers), real numbers (numbers that can be represented on a number line, including irrational numbers like π), and complex numbers (numbers of the form a + bi, where a and b are real numbers and i is the imaginary unit).
Digits, on the other hand, are symbols used to represent numbers in a positional number system. The most common positional number system is the decimal system, which uses ten digits (0, 1, 2, 3, 4, 5, 6, 7, 8, 9) to represent all possible numbers. For example, the number 1234 in the decimal system is composed of the digits 1, 2, 3, and 4. The position of each digit in the number determines its place value, with the rightmost digit representing ones, the next digit to the left representing tens, the next representing hundreds, and so on.
Digits are also used in other positional number systems, such as binary (base-2), octal (base-8), and hexadecimal (base-16), which use different sets of digits to represent numbers. For example, the binary system uses only two digits, 0 and 1, to represent all possible numbers, while the hexadecimal system uses sixteen digits, 0-9 and A-F (where A represents 10, B represents 11, and so on), to represent numbers. The concept of digits is fundamental to understanding how numbers are represented and manipulated in different number systems.



If the given string is: STR = "abcde". You have to print the string "edcba".
Try to solve the problem in O(1) space complexity.
To reverse a string, you can use the following steps:
Convert the string to a list of characters to make it mutable.
Use two pointers, one at the beginning of the list and the other at the end of the list.
Swap the characters at the two pointers.
Move the pointers towards each other until they meet in the middle.
Convert the list of characters back to a string.
To identify the defective coin among 10 coins using a weight scale, you can follow these steps:
Divide the 10 coins into three groups: Group A with 3 coins, Group B with 3 coins, and Group C with 4 coins.
Weigh Group A against Group B using the weight scale.
If Group A and Group B have the same weight, then the defective coin must be in Group C. Move on to step 4.
If Group A and Group B have different weights, then the defective coin must be in one of these two groups. Let's assume without loss of generality that Group A is lighter than Group B (the opposite case can be handled in the same way). Move on to step 5.
Take any two coins from Group A and weigh them against each other. If one of them is lighter, then that coin is defective. If they have the same weight, then the third coin in Group A is defective.
Here's a summary of the steps:
Divide the 10 coins into Group A (3 coins), Group B (3 coins), and Group C (4 coins).
Weigh Group A against Group B.
If Group A and Group B have the same weight, go to step 4. Otherwise, go to step 5.
Weigh any two coins from Group C against each other. The lighter coin is defective.
Weigh any two coins from Group A against each other. If one of them is lighter, that coin is defective. Otherwise, the third coin in Group A is defective.
Using these steps, you can identify the defective coin among the 10 coins with just three weighings using the weight scale.

Here's your problem of the day
Solving this problem will increase your chance to get selected in this company
What is recursion?