Java programs for interviews,
Java programs for interviews,
✅ String-Based Programs
-
Reverse each word in a sentence
-
Check if a string is a palindrome
-
Count vowels and consonants in a string
-
Remove duplicate characters from a string
-
Find the first non-repeated character
-
Check if two strings are anagrams
-
Count frequency of characters in a string
-
Convert string to title case (capitalize first letter)
-
Check for substring without using in-built methods
-
Replace all spaces with hyphens (
-
)
✅ Array-Based Programs
-
Find the largest and smallest number in an array
-
Find duplicate elements in an array
-
Sort an array without using built-in methods
-
Remove duplicates from an array
-
Reverse an array
-
Find the second largest number
-
Count the frequency of each element
-
Merge two arrays
-
Find the common elements between two arrays
-
Rotate an array to the left/right
✅ Number-Based Programs
-
Check if a number is prime
-
Generate Fibonacci series
-
Check if a number is Armstrong
-
Find factorial of a number
-
Check if a number is palindrome
-
Swap two numbers without using a third variable
-
Print all prime numbers between 1 and 100
-
Find GCD and LCM of two numbers
-
Convert decimal to binary
-
Count digits in a number
✅ Pattern Programs
-
Pyramid pattern
-
Diamond pattern
-
Floyd's triangle
-
Pascal’s triangle
-
Right-angled triangle of numbers/stars
-
Inverted triangle pattern
-
Hourglass/star pattern
-
Number increasing pattern
-
Zigzag pattern
-
Hollow rectangle
✅ Logic Building/General
-
Check if a year is a leap year
-
Print multiplication table of a number
-
Sum of digits of a number
-
Reverse digits of a number
-
Print even and odd numbers from 1 to N
-
Count the number of words in a sentence
-
Check if input is numeric (without
try-catch
) -
Find repeated words in a sentence
-
Calculate power of a number without using
Math.pow()
-
Find missing number in a sequence (like 1-100, missing 34)
Comments
Post a Comment