Merge to sorted arrays into second array, both arrays has N elements, but second array size is N * 2. So you merge both arrays in second array in a sorted way.
Senior Software Developer Java Interview Questions
97,971 senior software developer java interview questions shared by candidates
Sequence of numbers in random order and 1 of them is missing how to find that out...
What are the most challenging tasks you faced in your previous projects and how did you handle them
One of the question was on Designing & Code a TTL Cache with some modifications
Implement a method 'find' that will find the starting index (zero based) where the second list occurs as a sub-list in the first list. It should return -1 if the sub-list cannot be found. Arguments are always given, not empty. Sample Input 1 list1 = (1, 2, 3) list2 = (2, 3) Sample Output 1 1 Explanation As second list (2, 3) is sub-list in first list (1, 2, 3) at index 1 Sample Input 2 list1 = (1, 2, 3) list2 = (3, 2) Sample Output 2 -1
Given an NxN matrix, find out the number of ways to get to the NxNth cell from the 1x1 cell...
Probability of a knight making a valid move on NxN matrix in m steps.
technologies, not algorithms nor data structures
Given an array with duplicate elements give an algorithm to get the count of distinct elements in the array
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) { } }
Viewing 131 - 140 interview questions