Curated interview practice questions with answers. These are practice scenarios, not a verified list of past interview questions.
Solved for DeloitteStart 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.
final makes a variable, method or class unchangeable; finally is a block that always runs after try-catch; finalize is a deprecated method called before garbage collection.
Comparable defines the natural order inside the class (compareTo); Comparator defines custom orders externally (compare), useful for sorting test data in several ways.
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 is the difference between hard and soft assertions?
Automate stable, repetitive, high-risk and data-heavy flows (smoke, regression). Skip one-time tests, frequently changing UI and checks needing human judgement. Compare run frequency × manual time with build and maintenance cost.
Runtime events that disrupt flow. Use try-catch-finally, throw, throws, and custom exceptions; checked exceptions must be handled while unchecked ones need not be.
25
How would you design an automation framework from scratch?
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.
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.
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.
36
What is method overriding and where is it useful in frameworks?
Compare effort saved by running automated tests repeatedly against the cost of building and maintaining scripts, counting execution time, defects found earlier and release speed.
39
How do you test an API that depends on another service that is down?
String parent = driver.getWindowHandle();
for (String h : driver.getWindowHandles())
if (!h.equals(parent)) driver.switchTo().window(h);
// ...then switch back to parent
42
How do you read data from Excel or properties files in Java?
Re-locate the element after the DOM refreshes, use explicit waits for the refreshed element, don't keep element references for long, or wrap the action in retry logic.
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.
Locate rows and columns with XPath such as //table//tr and //td, loop through them to read or click cells, or build the XPath dynamically from the row text.
62
Write an XPath for a button with the text "Login".
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.
Code pushed to Git → Jenkins job triggers (webhook or schedule) → mvn clean test with the suite XML → reports and screenshots published → notifications on Slack/email → failures triaged before release.
Continuous Integration builds and tests every commit, and Continuous Delivery ships automatically. Automated tests give fast feedback and gate releases.