Java Questions:

1. What is a class?
2. What is the difference between heap and stack?
3. What is the difference between instance variable and local variable?
4. What is a Constructor? Types of Constructor?
5. Difference between Break and Continue?
6. To exit the system from the current execution what command is used in java?
7. Addition features in Java 8?
8. Difference between for and foreach loops in java and use of it?
9. Can we have multiple public class within a class?
10. What is inheritance? Types of inheritance? Does multiple inheritance allowed in java. If not, why?
11. What is polymorphism? How we can achieve it?
12. Difference between method overloading and method over riding?
13. Can we achieve method overloading when two methods have only difference in return type.
14. Method overloading and overriding examples in Selenium project?
15. What is encapsulation?
16. What is IS-A and HAS-A relation in java With examples?
17. What is final and super keyword? Difference between them?
18. Explain runtime polymorphism and compile time with examples?
19. Can final/Static method be overloaded?
20. Can final/Static methods be overridden?
21. Can we overload main method?
22. Can we execute a class without a main method?
23. What is Package?
24. What is an Abstract Class? Write an example code?
25. What is an Interface? What is the difference from Abstract class?
26. Can we use private and protect access modified inside a Interface?
27. Can multiple inheritances support in Interface?
28. Examples of Abstract and Interface used in selenium project?
29. What is Exception and what is the base class of it?
30. What is Final, Finally, Finalize?
31. What is done in finally block?
32. What is garbage collection java? How it is done?
33. What is the difference between Throws and Throw?
34. Gives some examples of java and Selenium?
35. What is Java Reflection, Singleton?
36. What is threading? How does multi threading achieved? How to initiate a thread in java? What do you mean by thread safe?
37. What is the difference between collection and collections?
38. Collection are what type?
39. Difference between Array and ArrayList?
40. Difference between Set and HashSet?
41. Difference between HashMap and HasTable?
42. Difference between ArrayList and LinkList?
43. How do you use Map collection your project?
44. Can we have duplicate key value in HasMap?
45. How to fetch values from a hashmap?
46. Difference between String, StringBuilder And StringBuffer?

Java Programs
1. Write a Code to generate Random numbers.
2. Write code to verify a number is perfect number or not.
3. Fibonacci series from 1 to 10.
4. Write a program to find a Factorial of a number.
5. Swap two number s without using the third variable.
6. Program to find greatest of three numbers.
7. An Array of numbers given. .Find the largest two number and print it
8. Reverse a number.
9. Verify if a given number is a palindrome or not.(same concept of reversing a number)
10. Armstrong number program.
11. A String is given remove the white spaces, reverse it and print the only odd position characters.
12. Check if a string is an anagram of another string.
13. A string is given make few characters to upper case as asked.
14. In a String print the occurrence of each character.
15. In a Statement check how any duplicate strings are there and remove them.
16. Use split to print each word of a statement.
17. Find the substring of a String.
18. Remove duplicate characters from a String and Print it.
19. Write a code to print the triangle of numbers.
20. Read and Write file program.
21.  Calculate power of a number using a while loop

SQL
1. What is primary key and unique key?
2. How many joins are there any difference?
3. Difference between join and union?
4. Select top 3 max salary employees by depts.
5. Difference between where and having and use of it?
6. Different types of Date functions?
7. What are the grouping functions?
8. Which function is used to get the current date?
9. What is a sub query?
10. What is indexing?

Selenium Interview Questions
1. What are the components of Selenium?
2. Which version you are using and what addition features you see from the previous version?
3. What is a WebDriver?
4. How do you select you drivers to launch a url?
5. Which method is used to fetch the driver?
6. Which framework you are using? Explain in details and its benefit? What is POM?
7. What is datadriven and keyword driven frameworks?
8. What locators you are using?
9. How do you explain the concept of object repository?
10. What is the difference between findElement and findElements and what is return type? Give some example where it is used?
11. Which method is used to get the text of an element?
12. How do you fetch an attribute value of an element?
13. When multiple checkboxes are there how do you check which one is checked previously?
14. What is the return type of isSelected() method?
15. What are the methods used to verify the existence of an object in a webpage?
16. What is a Xpath difference between relative and absolute xpath?
17. Read all axes scenarios of xpath like parent, following, ancestor, child and sibling.
18. How to fetch an element when its attributes are changing frequently?
19. What are the ways to click on a button?
20. What are different types of wait (write the syntax)and explain the scenarios where you will use them?
21. What are different types of exception in selenium?
22. How do you handle exceptions selenium?
23. There are 4 browsers open you have no idea where the required element is present . What will be your approach to find that element?
24. What is the difference between getWindowhandles() and getWindowHandles()? What is its return type?
25. Difference between Quit() and Close()?
26. How do you handle an alert pop-up?
27. How do you get the text inside a Alert?
28. What is a Alert? Interface/class?
29. How do you handle Frames in selenium?
30. Give one example of method overloading concept used in Selenium? Ans : Switching to frames
31. How do you select a dropdown value and what are the different methods are there?
32. When your  Xpath is returning more than one matching values how will you handle it?
33. Which is better Xpath/CSS? Why?
34. How does u capture the screenshot? What is the best place to have the screenshot code?
35. How do you connect Excel sheet? Write the code?
36. Write the database connection code.
37. How do you read and write a text file?
38. How do you read and write a pdf file?
39. What are the disadvantages of selenium?
40. Give some scenarios where you cannot automate?
41. What is the base class of exception?
42. When you execution is failed how do you debug your code?
43. How do you fetch the tile of a webpage?
44. What are the methods used to verify the end result is achieved?
45. How do you handle dynamic webtable? In cases you have no idea of how many rows of record will come , what should be the approach to handle this case?
46. How to verify the broken images of a page?
47. How to clear the cookies of the browser before start the execution?
48. Write the code to maximize the window?
49. Implementation of collection in your framework?
50. Give a scenario where inheritance is used in your framework?
51. Give a scenario where interface is used in your framework?
52. Write a code using javascriptexecutor to scroll the webpage?
53. How do you highlight an web element?
54. What is use of property file in selenium?
55. How do you handle multiple browser selection?
56. What is used for reporting?
57. What are the annotations used in TestNG? How it is difference from JUnit?
58. Explain all annotations and its use?
59. How do you priorities your test cases?
60. Suppose you want to skip one test method during execution how you will do it?
61. How cross browser testing is handled?
62. What is the hierarchy of testNG.xml tags?
63. Write the structure of testNG.xml file and explain?
64. What is the difference between Assert and verify?
65. What re the different methods of Assert?
66. How do you store your testNG reports?
67. How do you use parameters in testNG?
68. What is use of Grouping in testNG?
69. What is the use of Maven?
70. How does u define dependencies?
71. What are the advantages of using Maven in your project?
72. Name the folder of maven which contains all libraries?
73. Give some example of implementation of Maps in your project?
74. What are the use of Action class?
75. How do you perform double click?
76.  Write code for DragandDrop?
77. How to hover over an element?
78. How do enter values using key commands?
79. What is the difference between key command and key types?
80. How do you fetch all links from a web page?
81. If a page containing 1000 of images how you select the 100th image?
82. How do you upload images into webpage?

Other Questions
1. Give a short introduction about yourself with your roles and responsibilities in the team?
2. How do you approach to develop Automation test cases?
3. Explain your agile work and your role in it?
4. How do you estimate your automation cases?
5. What are the principles of agile?
6. Why do we follow Fibonacci series in pointing?
7. How do you track your automation cases?
8. How do you execute your cases?
9. Why do you choose selenium over other automation tool?
10. Do you have any experience in framework development?
11. Have you worked in any BDD framework?
12. Tell me the difficulties you faced in developing automation scripts? Any complex scenarios handled?
13. Dou you have experience in API Testing
14. What are the structures used in SOAP and REST services?
15. What is the major difference REST and SOAP?
16. What is the difference methods used in REST?
17. How you pass your data in SOAP request?
18. How do verify the responses?
19. What is WSDL?
20. What is the use of Jenkins?
21. What are the commands of jenkin?
22. How do you set-up your maven project in jenkin?
23. How do you start jenkin?

Leave a Reply