Java & Selenium Automation Interview Questions faced by me
Interview given for CGI :
1) What is Polymorphism
2) Types of polymorphism
3) What are collections in Java
ArrayList:
A dynamic array that grows as needed.
Allows duplicate elements.
Maintains the insertion order.
HashSet:
Uses a hash table for storage.
Does not allow duplicate elements.
Does not maintain any order.
Queue (LinkedList):
Maintains the insertion order.
Allows duplicate elements.
Provides additional methods for queue operations (offer, poll, peek).
HashMap:
Stores key-value pairs.
Allows one null key and multiple null values.
Does not maintain any order.
4) What is ArrayList
5) Can we overload the main method
6) What is Inheritance
7) Types of Inhertiance
8) What are the advantages of encapsulation in java
9) What is Super Class
10) What are inputFile streams
11) What is outputFile stream
12) What is static block
13) Write a java code for where you need to count the spaces
14) How do you handle Dynamic elements
15) How we manage Frame in selenium web driver
16) What are different navigation commands
17) What is Page Object Model, design Patter
18) Write code for getting screenshot
19) Write code for reading data from excel sheet
20) Write code for clicking on element by using javascriptexutor