28 December, 2023

Amdocs Pune | Java Interview Questions for Automation QA

 1. String reverse. Write a method that will take one string as an argument and will return the reverse version of this string.

2. Array reverse. Write a method that will take an array as an argument and reverse it.

3. Reverse words. Write a method that will take a string as an argument. The method will reverse the position of words and return it.

4. String palindrome. A palindrome is a word, phrase, number, or sequence of words that reads the same backward as forward.

5. Number palindrome. A palindrome is a word, phrase, number, or sequence of words that reads the same backward as forward. 

6. Max/min number from an array. Write a method that will accept an array of int as an argument and it returns the max/min number from a given array.

7. Find the second min/max number from an array. Write a method that accepts int array as an argument and returns second or n min/max number from the given array.

8. Static keyword in Java. The static keyword is a very popular question in the interviews.

9. String Pool and == operator to compare references in Java. Let’s see an example, what’s output from this program? Why this output?

10. Swap values of two variables without direct reassignment and without creating any extra variables.

11. Two string anagram. An anagram is when all the letters in one string exist in another but the order of letters does not matter. Write a method that accepts two string arguments and returns true if they are anagram and false if they are not.

12. Remove duplicates from a string. Write a method that accepts one string argument and returns it without duplicates.

Note : Feel free to comment if you have any query here !

No comments: