#
Category: Array

Problem: Write a Java program to check if a given unsorted array contains duplicate elements within k distance from each other. For example: If k = 3 and array is …

Problem: Write a Java program to find duplicate elements in array. This is entry-level interview question and interviewers are interested to see if you can solve the problem with …

Problem: Find the second largest number in an array. This program is asked in entry-level interviews. In this article we will see how to find second largest number in array in …

Problem: Given an array of size n, find first k largest elements (smallest elements) in the array. This program is asked in interviews to check how efficiently you can …

Problem: Write a program in Java for matrix multiplication. This program is a college level program. This program is asked in entry level interviews to see if you can handle …

Problem: First repeating element in array. Given an array of integers, find the first repeating number in the array. Example: Input array, arr = Then first repeating number …

Problem: Find missing number in an array. Given an array of size n-1, populated with numbers from 1 to n. There are no duplicates in the array. Find the …

In this article we will see how to transpose a matrix in Java. This is an algebra problem and asked in entry level interviews. Transpose matrix is similar to rotating …

Problem: Rotate matrix by 90 degrees. In this article we will see how to rotate a matrix by 90 degrees to right. This program is asked in programming interviews. …

Problem: Find N largest numbers from 3 sorted arrays. Ex: Given 3 sorted arrays, { 3, 7, 10, 14, 19, 78, 78, 200 }, { 4, 7, 67, 116, …