I have shared my interview experience with the EPAM Software company for the QA Lead position below. The following are the technical interview questions and answers discussed during the round.
Question 1: Please Explain yourself and Roles and responsibilities in the previous project
Answer:
This is the common question in most of the interviews. We can explain about our experience and roles and responsibilities in our recent project.
Question 2: How to find Duplicate characters in a String using Selenium and Java?
Answer:
We can find the duplicate characters of String in different ways such as using HashMap, Set or char array. I have explained scenario about using HashMap. Here I am going to provide the code using HashMap and Set below for finding duplicate characters using char array you can go through the video suggested in the description.
Using HashMap:
import java.util.HashMap;
import java.util.Map;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.testng.annotations.Test;
public class DuplicateCharacters {
@Test
public void verifyDuplicates {
WebDriver driver = new ChromeDriver();
driver.get(“https://example.com”);
// Get text from a web element
String text = driver.findElement(By.id(“sampleText”)).getText();
// Remove spaces and convert to lowercase (optional)
text = text.replaceAll(“\\s”, “”).toLowerCase();
// HashMap to store character count
HashMap<Character, Integer> charCount = new HashMap<>();
for (char ch : text.toCharArray()) {
charCount.put(ch, charCount.getOrDefault(ch, 0) + 1);
}
// Print duplicate characters
System.out.println(“Duplicate characters are:”);
for (Map.Entry<Character, Integer> entry : charCount.entrySet()) {
if (entry.getValue() > 1) {
System.out.println(entry.getKey() + ” : ” + entry.getValue());
}
}
driver.quit();
}
}
Using Set:
import java.util.HashSet;
import java.util.Set;
String text = “selenium”;
Set<Character> seen = new HashSet<>();
Set<Character> duplicates = new HashSet<>();
for (char ch : text.toCharArray()) {
if (!seen.add(ch)) {
duplicates.add(ch);
}
}
System.out.println(“Duplicate characters: ” + duplicates);
Question3: What is the use of Lamda expression how to use it in previous scenario from Question 2?
Answer:
I have explained use of Lamda expression as part previous program with HashMap for duplicate characters
A lambda expression is used to write cleaner, shorter, and more readable code by providing an implementation of a functional interface without creating a separate class or method.
import java.util.HashMap;
import java.util.Map;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.testng.annotations.Test;
public class DuplicateCharacters {
@Test
public void verifyDuplicates {
WebDriver driver = new ChromeDriver();
driver.get(“https://example.com”);
// Get text from a web element
String text = driver.findElement(By.id(“sampleText”)).getText();
// Remove spaces and convert to lowercase
text = text.replaceAll(“\\s”, “”).toLowerCase();
// HashMap to store character count
HashMap<Character, Integer> charCount = new HashMap<>();
for (char ch : text.toCharArray()) {
charCount.put(ch, charCount.getOrDefault(ch, 0) + 1);
}
System.out.println(“Duplicate characters are:”);
charCount.forEach((key, value) -> {
if (value > 1) {
System.out.println(key + ” : ” + value);
}
});
driver.quit();
}
}
Question 4: What is the difference between Post and PUT methods? – Api Testing
Answer:
Difference Between POST and PUT Methods (REST / HTTP)
| Feature | POST | PUT |
| Purpose | Create a new resource | Update or replace an existing resource |
| Resource URI | Server decides the URI | Client specifies the URI |
| Idempotent | ❌ No (multiple requests create multiple resources) | ✅ Yes (multiple requests give same result) |
| Data Handling | Adds new data | Replaces existing data completely |
| Repeat Request Effect | Creates duplicates | No duplicate creation |
| Response | Usually returns 201 Created | Usually returns 200 OK or 204 No Content |
| Example URL | /users | /users/101 |
Question 5: When do we receive 401 and 500 status codes in api testing?
Answer:
🔹 401 – Unauthorized
✅ When it occurs
You receive 401 when the client is not authenticated or authentication is invalid.
Common reasons
- Missing Authorization header
- Invalid username/password
- Expired or invalid JWT / OAuth token
- Incorrect API key
- Token format is wrong
Example
GET /users
Authorization: Bearer invalid_token
Response
401 Unauthorized
Interview Line
401 means the request is not authenticated. The server refuses access because credentials are missing or invalid.
🔹 500 – Internal Server Error
✅ When it occurs
You receive 500 when the server fails to process a valid request due to an internal issue.
Common reasons
- Null pointer or unhandled exception in backend code
- Database connection failure
- Server crash
- Incorrect server configuration
- Code bug
Example
POST /users
Body:
{
"name": null
}
Question 6: Explain one scenario for API test automation?
Answer:
I have explained an API automation scenario for verification with Get request as below
🔹 API Details
- Method: GET
- URL:
{{baseUrl}}/users/{{userId}} - Authorization: Bearer Token
- Headers:
Content-Type: application/json
1. Verify Status Code
pm.test(“Status code is 200”, function () {
pm.response.to.have.status(200);
});
2. Verify Response Time
pm.test(“Response time is less than 2000ms”, function () {
pm.expect(pm.response.responseTime).to.be.below(2000);
});
3. Verify Content-Type Header
pm.test(“Content-Type is application/json”, function () {
pm.response.to.have.header(“Content-Type”);
pm.expect(pm.response.headers.get(“Content-Type”))
.to.include(“application/json”);
});
4. Verify Response Body is not empty
pm.test(“Response body is not empty”, function () {
pm.expect(pm.response.json()).to.not.be.empty;
});
5. Verify User ID
pm.test(“User ID is correct”, function () {
var jsonData = pm.response.json();
pm.expect(jsonData.id).to.eql(parseInt(pm.environment.get(“userId”)));
});
6. Verify Mandatory Fields
pm.test(“Mandatory fields are present”, function () {
var jsonData = pm.response.json();
pm.expect(jsonData).to.have.property(“name”);
pm.expect(jsonData).to.have.property(“email”);
});
7. Verify Data Types
pm.test(“Verify data types”, function () {
var jsonData = pm.response.json();
pm.expect(jsonData.id).to.be.a(“number”);
pm.expect(jsonData.name).to.be.a(“string”);
pm.expect(jsonData.email).to.be.a(“string”);
});
Watch YouTube Video here: EPAM interview questions for automation testing