Core Java Coding Interview Questions
Core Java Coding Interview Questions
1. String Coding
-
Reverse a string without using built-in reverse().
-
Check if a string is a palindrome.
-
Count the number of vowels and consonants in a string.
-
Count occurrences of each character in a string.
-
Find the first non-repeated character in a string.
-
Remove duplicate characters from a string.
-
Reverse each word in a sentence.
-
Check if two strings are anagrams.
-
Extract only digits from a string.
-
Find the maximum occurring character in a string.
2. Array Coding
-
Find the largest and smallest element in an array.
-
Reverse an array.
-
Check if an array is sorted or not.
-
Find duplicate elements in an array.
-
Remove duplicates from an array.
-
Find second largest element.
-
Find missing number in array 1 to N.
-
Move all zeros to the end of array.
-
Find pair of numbers whose sum is a given value.
-
Merge two sorted arrays.
3. Number Programs
-
Check if a number is prime.
-
Check if a number is Armstrong.
-
Check if a number is palindrome.
-
Find factorial of a number.
-
Print Fibonacci series.
-
Find GCD & LCM of two numbers.
-
Count digits in a number.
-
Reverse a number.
-
Find sum of digits.
-
Check perfect number.
4. Collections Coding
-
Sort a list without using sort().
-
Convert array to list and list to array.
-
Find frequency of each element in list/map.
-
Remove duplicates from ArrayList.
-
Find intersection of two lists.
-
Find union of two lists.
5. Map & Set Coding
-
Find first non-repeating element using HashMap.
-
Sort HashMap by key.
-
Sort HashMap by value.
-
Check if two HashMaps are equal.
6. Java 8 Coding
-
Find even numbers from list using streams.
-
Find max and min using streams.
-
Convert list to map using streams.
-
Get duplicate elements using streams.
-
Count occurrences using streams.
7. Miscellaneous
-
Swap two numbers without third variable.
-
Find longest word in a sentence.
-
Print pattern programs (triangle, pyramid).
-
Check if a given sentence is pangram.
-
Implement custom exception.
If you want complete solutions for all 50 coding questions, or want “Selenium + Java coding questions”, just tell me!
Comments
Post a Comment