2. /** * A tournament tree is a binary tree * where the parent is the minimum of the two children. * Given a tournament tree find the second minimum value in the tree. * A node in the tree will always have 2 or 0 children. * Also all leaves will have distinct and unique values. * 2 * / \ * 2 3 * / \ | \ * 4 2 5 3 * * In this given tree the answer is 3. */ class Node { Integer value; Node left, right; Node(Integer value, Node left, Node right) { this.value = value; this.left = left; this.right = right; } } class Solution { /** * This should return the second minimum * int value in the given tournament tree */ public static Integer secondMin(Node root) { } }
Software Engineers Interview Questions
420,052 software engineers interview questions shared by candidates
Print a tree level by level
A couple tricky questions. One required writing a modified binary search, the other dealt with data structures and how to efficiently check if a given set of numbers contained two numbers summing to some other number x.
Basic OOP related questions and Java question about different data structures.
Questions about Manual Testing, Differences between Functional, Performance, Unit, Regression, Load, Stress, Volume testing.
Given a list of buying and selling prices, check if by given a new price will there be any match / transaction. buyer and seller both should get the best prices.
given a number, how do you determine if its a power of 3?
Describe your everyday work methodology
You have a sentence with several words with spaces remove and words having their character order shuffled. You have a dictionary. Write an algorithm to produce the sentence back with spaces and words with normal character order.
Viewing 1221 - 1230 interview questions