# Category: programming

## Find first duplicate character in a string in Java

Problem:  Write a Java program to find first duplicate character in a string. For example: If given string is color, then the first duplicate character in the string is …

## Reverse words in a string in Java

Problem: Write a Java program to reverse words in a string. For example: Input sentence :  Java fries is an awesome site for programming questions Output: questions programming for site …

## First non repeating character in a string in Java

Problem: Write a Java program to find first non repeating character in a string or first unique character in a string. For example. 1. In string “baby”, first non repeating …

## Check if a given array contains duplicate elements within k distance from each other

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 …

## Java program for Fibonacci series

Problem: Write a Java program to print Fibonacci series. Here we have to print first ‘n’ numbers of Fibonacci series. This is a college level program and could be asked …

## Duplicate elements in array in Java

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 …

## Second largest number in an array

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 …

## k largest elements / smallest elements in an array

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 …

## Matrix multiplication program in Java

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 …

## Nth Fibonacci number in Java

Problem: Find nth Fibonacci number in Java. Write a Java program to find nth Fibonacci number. What is Fibonacci series? In mathematics, following is the Fibonacci series. (We will take …