Deloitte Interview Questions and Answers for QA Automation Testing
Deloitte Interview Questions and Answers for QA Automation Testing
Core Java
ArrayList: Implements a resizable array, supports fast random access (O(1) time
complexity for get() and set() operations), and slower insertions and deletions (O(n)
in the worst case) since elements may need to be shifted.
LinkedList: Implements a doubly linked list, with slower random access (O(n) for
get() and set()), but faster insertions and deletions (O(1)) at both ends (head and
tail).
Multithreading in Java:
Abstract Class: Can have both abstract and concrete methods (methods with
implementation). It can have constructors and member variables. A class can inherit
only one abstract class.
Interface: Can only have abstract methods (until Java 8, after which default and
static methods can be implemented). It cannot have member variables (only
constants). A class can implement multiple interfaces.
Garbage collection is the automatic process of reclaiming memory from objects that
are no longer in use. It is managed by the JVM. Objects are eligible for garbage
collection when there are no references to them. The garbage collector works by
identifying unreachable objects and freeing their memory space. There are different
GC algorithms like Serial, Parallel, CMS, and G1.
Serialization and Deserialization in Java:
Serialization: The process of converting an object into a byte stream so that it can be
saved to a file or transmitted over a network. It is achieved using the Serializable
interface.
Abstraction: Hiding the implementation details and showing only the necessary
functionality.
Encapsulation: Wrapping the data (variables) and methods into a single unit (class)
and restricting access to some of the object's components.
Overloading: Defining multiple methods with the same name but different parameters
within the same class.
StringBuffer: Mutable and synchronized, which makes it thread-safe but slower than
StringBuilder.
StringBuilder: Mutable and not synchronized, making it faster but not thread-safe.
Selenium
Dynamic elements often change attributes (like IDs) during execution. You can
handle them using dynamic locators like XPath with conditions, CSS selectors, or
waiting mechanisms like WebDriverWait to handle waiting for elements to appear or
change.
The Page Object Model is a design pattern in Selenium where each page of the
application is represented by a separate Java class. The class contains methods that
define the actions and elements of that page. It improves maintainability and reduces
code duplication.
Use getWindowHandles() to get all window handles, then switch between them using
switchTo().window(windowHandle). You can identify the window or tab by the handle
string.
Data-Driven Framework: Test data is stored externally (e.g., Excel, CSV), and tests
are run with different data inputs.
Keyword-Driven Framework: Test cases are created using keywords that represent
actions, like "click," "enter," etc.
A Test Data Management tool stores, manages, and provides test data for
automation tests. It ensures that different sets of test data are used during execution
and supports reusability.
Test data can be parameterized using external data sources like Excel, CSV, or
databases. In frameworks like TestNG or JUnit, data providers can be used to pass
different data sets into the test methods.
API Testing
SOAP (Simple Object Access Protocol) is a protocol that uses XML and provides a
strict standard for communication.
Use OAuth, API keys, JWT tokens, or basic authentication to secure APIs.
Authentication ensures the user is who they say they are, while authorization
ensures the user has permission to access the requested resource.
Use proper HTTP status codes, implement statelessness, ensure resources are
accessible via unique URIs, and handle error cases effectively. In testing, check for
response time, correctness, and security.
Use tools like JMeter or Postman to simulate traffic and measure the response time,
throughput, and load handling capabilities of the API.
BDD (Cucumber)
Components of Cucumber:
Hooks: Used to perform actions before or after tests (e.g., setup or teardown).
Handling Data Parameterization in Cucumber:
Use Examples in scenario outlines or integrate with external data sources like Excel,
CSV files, or databases to pass parameters into scenarios.
Integrating Cucumber with Selenium:
Maven/Gradle
Purpose of Maven/Gradle:
Maven and Gradle are build automation tools that manage project dependencies,
build processes, and project lifecycle. They ensure consistent builds, version
management, and project configuration.
Benefits of Maven/Gradle:
Git
Git is a version control system used for tracking changes in code. GitHub is a hosting
service for Git repositories, allowing collaboration and version control in the cloud.
Git Commands:
commit: Saves changes to the local repository.
Resolve conflicts manually by editing the conflicted files, then mark them as resolved
using git add and complete the merge with git commit.
Branching allows you to develop features or fixes in isolation from the main
codebase, enabling parallel development and minimizing disruption.
Use git checkout <commit> or git reset to revert changes. For safe revert, use git
revert <commit> to create a new commit that undoes the changes.