✅ 50 Java Programs for SDET Interviews
✅ 50 Java Programs for SDET Interviews
-
Write a program to check if a number is positive or negative.
-
Write a program to find the greatest of two numbers.
-
Write a program to find the greatest among three numbers.
-
Write a program to check if a number is even or odd.
-
Write a program to check if a year is a leap year.
-
Write a program to check if a character is a vowel or consonant.
-
Write a program to check if a number is divisible by 5 and 11.
-
Write a program to check if a character is uppercase or lowercase.
-
Write a program to check if a number is a multiple of both 3 and 7.
-
Write a program to print "Pass" if marks are above 40, else print "Fail".
-
Write a program to find the maximum of four numbers.
-
Write a program to check if a number lies between 100 and 200.
-
Write a program to check if a character is an alphabet.
-
Write a program to calculate the absolute value of a number.
-
Write a program to print day name based on day number (1-7).
-
Write a program to print grade based on marks (using if-else ladder).
-
Write a program to check if a triangle is valid using three angles.
-
Write a program to swap two numbers using a function.
-
Write a program to check if a number is prime using a function.
-
Write a program to calculate the factorial of a number using a function.
-
Write a program to check if a number is palindrome (e.g., 121).
-
Write a program to check if a string is palindrome.
-
Write a program to count the number of digits in a number.
-
Write a program to sum digits of a given number (e.g., 123 ➔ 6).
-
Write a program to reverse a given number.
-
Write a program to reverse a string without using inbuilt methods.
-
Write a program to find the largest digit in a number.
-
Write a program to print numbers from 1 to N using a function.
-
Write a program to print all even numbers between 1 and 100.
-
Write a program to print multiplication table of a number using function.
-
Write a program to calculate sum of first N natural numbers.
-
Write a program to find sum of even numbers between 1 to N.
-
Write a program to check if the sum of two numbers is greater than 100.
-
Write a program to find the smallest among three numbers.
-
Write a program to convert Celsius to Fahrenheit using function.
-
Write a program to calculate simple interest using function.
-
Write a program to check if a string contains only digits.
-
Write a program to count vowels and consonants in a string.
-
Write a program to check if a number is Armstrong (e.g., 153 ➔ 1³+5³+3³=153).
-
Write a program to print Fibonacci series up to N terms using function.
-
Write a program to check if a number is strong number (e.g., 145 ➔ 1!+4!+5!).
-
Write a program to print all prime numbers between 1 and N.
-
Write a program to find GCD (greatest common divisor) of two numbers.
-
Write a program to find LCM (least common multiple) of two numbers.
-
Write a program to check if a character is special symbol (!,@,#,...).
-
Write a program to count number of uppercase and lowercase letters in a string.
-
Write a program to print sum of squares of first N natural numbers.
-
Write a program to print pattern of stars (triangle) using loops.
-
Write a program to check if two numbers are co-prime.
-
Write a program to print sum of digits until the result is a single digit (e.g., 9875 ➔ 9+8+7+5=29 ➔ 2+9=11 ➔ 1+1=2).
๐ฏ Special: Why These Are Picked
✔️ All require correct conditional statements (if
, else
, else if
)
✔️ Require relational operators (==
, >
, <
, >=
, <=
, !=
)
✔️ Test syntax (curly braces, semicolons) — errors if you miss!
✔️ Involve functions (define, call, return, trace)
✔️ Are actual coding test and SDET automation logic favorites (e.g., palindrome, prime, reverse)
Comments
Post a Comment