Java Coding Interview Questions: 35+ Most asked Java coding

It is challenging for freshers to find most asked Java coding interview questions that commonly asked in interviews.

Here We have collected 35+ Most asked Java coding Interview Questions that are recommended by Engineers of MNCs.

Here we have covered both easy and tricky questions. Because of some time, easy questions are also not solved by many candidates.

This coding question of Java Programming will help you to crack the coding interview rounds.

Along with the coding questions, you should also prepare pattern programming in Java because the interviewer may ask some time pattern questions. 

Coding Programs are like you have given some operations to perform on numbers, strings, arrays, or on linked lists

Below are the Java programs which mostly asked in a coding round, which are categorized in section wise. Prepare each variety of coding questions, which is very important and will help you crack your coding rounds.


Java Coding Questions on Numbers

  1. Write a program to reverse an integer in Java.
  2. Write a program in Java to check whether an integer is Armstrong number or not.
  3. Write a program in Java to check given number is prime or not.
  4. Write a program in Java to print the Fibonacci series using iteration.
  5. Write a program in Java to print the Fibonacci series using recursion.
  6. Write a program in Java to check whether a number is Palindrome or not using iteration.
  7. Write a program in Java to check whether a number is Palindrome or not using recursion.
  8. Write a program in Java to find greatest among three integers.
  9. Write a program in Java to find sum of digits of a number.
  10. Write a program in Java to find sum of digits of a number using recursion.
  11. Write a program in Java to swap two numbers without using third variable.
  12. Write a program in Java to swap two numbers using third variable.
  13. Write a program in Java to find prime factors of a given integer.
  14. Write a program in Java to add two integer without using arithmetic operator?
  15. Write a program in Java to find given number is perfect or not.
  16. Java Program to Calculate the Average of Integer Array.
  17. Java Program to calculate the Average of number taken from user.
  18. Java Program to calculate factorial using iterative method.
  19. Java Program to calculate factorial using recursion.
  20. Java Program to check a given number is even or odd.
  21. Java program to print first n Prime Number with explanation.
  22. Java Program to print Prime Number in a given range.
  23. Java Program to find Smallest number among three.
  24. Java program to calculate the power using the POW method.
  25. Java Program to calculate the power without using POW function.
  26. Java Program to calculate the square of a given number.
  27. Java Program to calculate the cube of a given number.
  28. Java Program to calculate the square root of a given number.
  29. Java program to calculate LCM of given two numbers.
  30. Java Program to find GCD or HCF of two numbers.
  31. Java Program to find GCD of two numbers using recursion.
  32. Java Program to check the given year is a leap year or not.
  33. Java Program to convert Celsius to Fahrenheit.
  34. Java Program to convert Fahrenheit to Celsius.
  35. Java program to calculate Simple Interest with explanation.

Java Coding Questions on String

  1. Write a method in Java which will remove any given character from a String.
  2. Write a program in Java to count occurrence of a given character in a String?
  3. Write a program in Java to check if two String are Anagram.
  4. Write a program in Java to check a String is palindrome or not.
  5. Java program to check given character is vowel or consonant.
  6. Java program to check given character is digit or not.
  7. Java program to replace the string space with a given character.
  8. Java program to convert lowercase char to uppercase of string.
  9. Java program to convert lowercase vowel to uppercase in string.
  10. Java program to delete vowels in a given string.
  11. Java program to count Occurrence Of Vowels & Consonants in a String.
  12. Java program to print the highest frequency character in a String.
  13. Java program to Replace First Occurrence Of Vowel With ‘-‘ in String.
  14. Java program to count alphabets, digits and special characters.
  15. Java program to remove blank space from string.
  16. Java program to Concatenate two strings.
  17. Java Program to remove repeated character from string.
  18. Java program to calculate sum of integers in string.
  19. Java program to print all non repeating character in string.
  20. Java Program to sort characters of string in Ascending Order.
  21. Java Program to sort character of string in descending order.

Java Coding Questions on Array

  1. Write a program in Java for, In array 1-100 numbers are stored, one number is missing how do you find it.
  2. Write a program in Java for, In a array 1-100 multiple numbers are duplicates, how do you find it.
  3. Write a program in Java for, How to find all pairs in array of integers whose sum is equal to given number.
  4. Write a program in Java for, In a array 1-100 exactly one number is duplicate how do you find it.
  5. Write a program in Java for, Given two arrays 1,2,3,4,5 and 2,3,1,0,5 find which number is not present in the second array.
  6. Write a program in Java for, How to compare two array is equal in size or not.
  7. Write a program in Java to find largest and smallest number in array.
  8. Write a program in Java to find second highest number in an integer array.
  9. Write a program in Java to find top two maximum number in array?
  10. Java program to print array in reverse Order.
  11. Java program to reverse array without using second array.
  12. Java Program to calculate length of an array.
  13. Java program to insert an element at end of an Array.
  1. Java program to insert element at a given location in Array.
  2. Java Program to delete element at end of Array.
  3. Java Program to delete given element from Array.
  4. Java Program to delete element from array at given index.
  5. Java Program to find sum of array elements.
  6. Java Program to print all even numbers in array.
  7. Java Program to print all odd numbers in array.
  8. Java program to perform left rotation of array elements by two positions.
  9. Java program to perform right rotation in array by 2 positions.
  10. Java program to find all pairs in array of integers whose sum is equal to given number.
  11. Java Program to remove duplicate elements form array.