{"id":27957,"date":"2022-02-25T08:51:24","date_gmt":"2022-02-25T08:51:24","guid":{"rendered":"https:\/\/www.testingdocs.com\/questions\/?p=27957"},"modified":"2026-02-25T08:58:55","modified_gmt":"2026-02-25T08:58:55","slug":"qa-interview-questions-for-qa-role-4-years-experience","status":"publish","type":"post","link":"https:\/\/www.testingdocs.com\/questions\/qa-interview-questions-for-qa-role-4-years-experience\/","title":{"rendered":"QA Interview Questions for QA role | 4 Years Experience"},"content":{"rendered":"<h1>QA Interview Questions for QA role | 4 Years Experience<\/h1>\n<hr \/>\n<h2>1. Tell Me About Yourself<\/h2>\n<h3>Sample Answer<\/h3>\n<p>I am a QA Engineer with 4 years of experience in Manual and Automation Testing. I have worked extensively on Web and API automation using Selenium WebDriver, Java, TestNG, Maven, and RestAssured. I have experience in designing and maintaining Hybrid frameworks with Page Object Model (POM).<\/p>\n<p>I am involved in requirement analysis, test case design, execution, defect reporting using Jira, CI\/CD integration using Jenkins, and cross-browser testing. I also have experience in API automation and validating responses using POJO classes.<\/p>\n<hr \/>\n<h2>2. Test Case: Search Button on Amazon Not Working<\/h2>\n<h3>Sample Answer<\/h3>\n<p><b>Test Case ID:<\/b> TC_AMZ_001<\/p>\n<p><b>Title:<\/b> Verify Search Button Functionality<\/p>\n<p><b>Precondition:<\/b> User navigates to Amazon homepage<\/p>\n<p><b>Test Steps:<\/b><\/p>\n<ol>\n<li>Open browser<\/li>\n<li>Navigate to https:\/\/www.amazon.in<\/li>\n<li>Enter product name in search textbox (e.g., \u201cLaptop\u201d)<\/li>\n<li>Click on Search button<\/li>\n<\/ol>\n<p><b>Expected Result:<\/b><br \/>\nUser should be redirected to search results page displaying relevant products.<\/p>\n<p><b>Actual Result:<\/b><br \/>\nSearch button does not respond \/ No navigation happens.<\/p>\n<p><b>Defect Raised:<\/b><\/p>\n<ul>\n<li>Summary: Search button not working on homepage<\/li>\n<li>Severity: High<\/li>\n<li>Priority: High<\/li>\n<li>Steps to Reproduce: Mention above steps<\/li>\n<li>Environment: Chrome 120, Windows 10<\/li>\n<\/ul>\n<hr \/>\n<h2>3. Selenium 4 \u2013 Navigate to Google<\/h2>\n<h3>Sample Answer<\/h3>\n<pre>import org.openqa.selenium.WebDriver;\r\nimport org.openqa.selenium.chrome.ChromeDriver;\r\n\r\npublic class GoogleTest {\r\n    public static void main(String[] args) {\r\n        WebDriver driver = new ChromeDriver();\r\n        driver.get(\"https:\/\/www.google.com\");\r\n        driver.manage().window().maximize();\r\n        driver.quit();\r\n    }\r\n}\r\n<\/pre>\n<hr \/>\n<h2>4. What is WebDriver? Interface or Class?<\/h2>\n<h3>Sample Answer<\/h3>\n<p>WebDriver is an <b>interface<\/b> in Selenium. It defines methods like get(), findElement(), close(), quit().<br \/>\nClasses like ChromeDriver, FirefoxDriver implement this interface.<\/p>\n<hr \/>\n<h2>5. Can\u2019t We Write ChromeDriver Instead of WebDriver?<\/h2>\n<h3>Sample Answer<\/h3>\n<p>We can write ChromeDriver driver = new ChromeDriver(); but best practice is:<\/p>\n<pre>WebDriver driver = new ChromeDriver();\r\n<\/pre>\n<p>Because it follows <b>Abstraction &amp; Polymorphism<\/b>. If we change browser to FirefoxDriver, we only change the object, not the reference type.<\/p>\n<hr \/>\n<h2>6. Difference Between Class and Interface<\/h2>\n<h3>Sample Answer<\/h3>\n<table border=\"1\">\n<tbody>\n<tr>\n<th>Class<\/th>\n<th>Interface<\/th>\n<\/tr>\n<tr>\n<td>Can have method implementation<\/td>\n<td>Contains abstract methods (before Java 8)<\/td>\n<\/tr>\n<tr>\n<td>Supports constructors<\/td>\n<td>No constructors<\/td>\n<\/tr>\n<tr>\n<td>Single inheritance<\/td>\n<td>Multiple inheritance supported<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<hr \/>\n<h2>7. Why Can\u2019t We Write Class Logic in Interface?<\/h2>\n<h3>Sample Answer<\/h3>\n<p>Interface is meant to provide 100% abstraction (design level). Logic should be written in implementing classes to ensure flexibility and reusability. Before Java 8, interfaces could not contain method bodies.<\/p>\n<hr \/>\n<h2>8. Login to Google \u2013 Framework Structure (POM)<\/h2>\n<h3>Sample Answer<\/h3>\n<p><b>BaseClass:<\/b><\/p>\n<pre>public class BaseClass {\r\n    public static WebDriver driver;\r\n\r\n    public void initializeDriver() {\r\n        driver = new ChromeDriver();\r\n        driver.manage().window().maximize();\r\n    }\r\n}\r\n<\/pre>\n<p><b>LoginPage (POM):<\/b><\/p>\n<pre>public class LoginPage {\r\n\r\n    WebDriver driver;\r\n\r\n    By email = By.id(\"identifierId\");\r\n    By nextBtn = By.id(\"identifierNext\");\r\n\r\n    public LoginPage(WebDriver driver){\r\n        this.driver = driver;\r\n    }\r\n\r\n    public void login(String username){\r\n        driver.findElement(email).sendKeys(username);\r\n        driver.findElement(nextBtn).click();\r\n    }\r\n}\r\n<\/pre>\n<p><b>Test Class:<\/b><\/p>\n<pre>public class LoginTest extends BaseClass {\r\n\r\n    @Test\r\n    public void verifyLogin(){\r\n        initializeDriver();\r\n        driver.get(\"https:\/\/accounts.google.com\");\r\n\r\n        LoginPage lp = new LoginPage(driver);\r\n        lp.login(\"test@gmail.com\");\r\n\r\n        Assert.assertTrue(driver.getTitle().contains(\"Google\"));\r\n        driver.quit();\r\n    }\r\n}\r\n<\/pre>\n<hr \/>\n<h2>9. Java Program \u2013 Find 2nd Maximum Element<\/h2>\n<h3>Sample Answer<\/h3>\n<pre>public class SecondMax {\r\n    public static void main(String[] args) {\r\n        int[] arr = {10, 5, 20, 8, 25};\r\n\r\n        int max = Integer.MIN_VALUE;\r\n        int secondMax = Integer.MIN_VALUE;\r\n\r\n        for(int num : arr){\r\n            if(num &gt; max){\r\n                secondMax = max;\r\n                max = num;\r\n            } else if(num &gt; secondMax &amp;&amp; num != max){\r\n                secondMax = num;\r\n            }\r\n        }\r\n\r\n        System.out.println(\"Second Max: \" + secondMax);\r\n    }\r\n}\r\n<\/pre>\n<hr \/>\n<h2>10. Did You Develop the Framework?<\/h2>\n<h3>Sample Answer<\/h3>\n<p>Yes, I contributed to developing a Hybrid framework using Selenium, Java, TestNG, Maven, and POM.<br \/>\nI was responsible for Base class creation, utility classes, report generation using Extent Reports, and CI integration with Jenkins.<\/p>\n<hr \/>\n<h2>11. POJO Classes &amp; API Automation Logic<\/h2>\n<h3>Sample Answer<\/h3>\n<pre>public class User {\r\n    private String name;\r\n    private String job;\r\n\r\n    \/\/ getters and setters\r\n}\r\n<\/pre>\n<p><b>Sending Request:<\/b><\/p>\n<pre>User user = new User();\r\nuser.setName(\"John\");\r\nuser.setJob(\"QA\");\r\n\r\nResponse response = \r\ngiven()\r\n.contentType(ContentType.JSON)\r\n.body(user)\r\n.when()\r\n.post(\"\/users\");\r\n<\/pre>\n<p><b>Extract Response:<\/b><\/p>\n<pre>String id = response.jsonPath().getString(\"id\");\r\nSystem.out.println(id);\r\n<\/pre>\n<hr \/>\n<h2>12. Jenkins \u2013 Can You Build a Pipeline?<\/h2>\n<h3>Sample Answer<\/h3>\n<p>Yes, I can create Freestyle and Pipeline jobs. I configure Git repository, build triggers, Maven goals (clean test), and generate reports.<\/p>\n<hr \/>\n<h2>13. Can We Use Script to Create Jenkins Pipeline?<\/h2>\n<h3>Sample Answer<\/h3>\n<pre>pipeline {\r\n    agent any\r\n    stages {\r\n        stage('Build') {\r\n            steps {\r\n                sh 'mvn clean'\r\n            }\r\n        }\r\n        stage('Test') {\r\n            steps {\r\n                sh 'mvn test'\r\n            }\r\n        }\r\n    }\r\n}\r\n<\/pre>\n<hr \/>\n<h2>14. Do You Know Linux?<\/h2>\n<h3>Sample Answer<\/h3>\n<p>Yes, I have basic knowledge of Linux commands for navigating directories, creating files, checking logs, and running automation scripts in CI environments.<\/p>\n<hr \/>\n<h2>15. Linux Command to Create a File<\/h2>\n<h3>Sample Answer<\/h3>\n<pre>touch filename.txt\r\n<\/pre>\n<p>Or<\/p>\n<pre>cat &gt; filename.txt\r\n<\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>QA Interview Questions for QA role | 4 Years Experience 1. Tell Me About Yourself Sample Answer I am a QA Engineer with 4 years of experience in Manual and Automation Testing. I have worked extensively on Web and API automation using Selenium WebDriver, Java, TestNG, Maven, and RestAssured. I have experience in designing and [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-27957","post","type-post","status-publish","format-standard","hentry","category-automation","has-post-title","has-post-date","has-post-category","has-post-tag","has-post-comment","has-post-author",""],"_links":{"self":[{"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/posts\/27957","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/comments?post=27957"}],"version-history":[{"count":3,"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/posts\/27957\/revisions"}],"predecessor-version":[{"id":27960,"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/posts\/27957\/revisions\/27960"}],"wp:attachment":[{"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/media?parent=27957"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/categories?post=27957"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/tags?post=27957"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}