Curated interview practice questions with answers. These are practice scenarios, not a verified list of past interview questions.
Solved for SwiggyStart practicing
3 QUESTIONS FREESign up or log in to unlock the full question bank and track your progress.Unlock every question and answer, then continue practising company-wise and package-wise.
✓ 3 questions free • Unlock the rest in seconds
01
How do you handle environment-specific configuration?
Schedule the job, spin up environments or containers, run suites in parallel, store reports and screenshots, notify failures on Slack or email and track trends.
Encapsulation: private locators with public page methods. Inheritance: pages extend a BasePage. Polymorphism: the WebDriver interface for different browsers. Abstraction: utility layers hiding Selenium details.
07
What are the advantages of version control for test code?
ArrayList and LinkedList for lists, HashSet for unique values, HashMap for key-value test data, and Iterator for traversing them, for example collecting web elements in a list.
Use TestNG parallel="methods | classes | tests" with thread-count, keep WebDriver in a ThreadLocal, and use Selenium Grid or a cloud grid for multiple browsers.
19
What is the execution order of TestNG annotations?
Overloading: same method name, different parameters, in the same class (compile time). Overriding: a subclass redefines a parent method with the same signature (runtime polymorphism). WebDriver driver = new ChromeDriver() is runtime polymorphism.
A special method that initialises an object. It can be overloaded with different parameters, and testers use it to pass the WebDriver into page classes.
An abstract class can hold state and concrete methods; an interface defines a contract (with default methods since Java 8). A class extends one abstract class but can implement many interfaces.
findElement returns the first match and throws NoSuchElementException if nothing is found. findElements returns a List (empty if nothing is found) — handy to check whether an element exists.
37
What is the difference between an array and an ArrayList?
Continuous Integration builds and tests every commit, and Continuous Delivery ships automatically. Automated tests give fast feedback and gate releases.
47
How do you verify response time and headers in REST Assured?
Headless mode or screen resolution, timing issues, environment data, missing dependencies, browser–driver version mismatch or parallel conflicts. Check logs and failure screenshots and make waits robust.
Lambdas are short anonymous functions; streams process collections declaratively with filter, map and collect, for example filtering link text from a list of elements.