Situational Scenario Based Interview Questions [ Manual Java SQL ]

Scenario based software testing interview questions and answers for experienced employees are a popular method hiring managers use to assess a candidate’s problem-solving skills and decision-making abilities.

These situation based interview questions or best situation questions typically put the candidate in a hypothetical situation, and mainly, the interviewer asks them to notice how they would respond or what actions they would take.

With these scenario based questions, interviewers can gain insight into a candidate’s thought process, creativity, and ability to handle challenging situations using scenario-based questions.

This approach can be particularly useful for jobs requiring critical thinking, problem-solving, and quick decision-making, such as leadership roles, project management, or customer service.

In this context, candidates can demonstrate their ability to apply their knowledge and experience to real-life situations, proving they have the skills and attributes required to excel in the role.

Situational Interview Questions

Now, we will share some of the situational interview questions. We Hope these scenario based interview questions for automation testing will help you give your answer in the interview.

Manual Testing Scenario Based Interview Questions

  • 100 test cases are there; do we only need to execute the selected 5 test cases? Can you please let us know?
  • If there are 100 test cases, and I want to execute the first 50th test case, then 1 test case should be executed. How do you do it?
  • There is a release tomorrow, and you got the build today. you can execute only 60 % of test cases; what is your approach to completing 100 %
  • If there are 15000 test cases and you have to test all test cases in very little time, what would be your approach?
  • There are 25 test cases. After running the 20th test case, the 21st test case needs to be executed.

When our release is in the next 2 hours & as a Tester, we found a blocker bug. What will you do?

Ans: First, raise the bug; we need some ID to track for sure, then discuss with the Lead/Manager and call the development team to see if they can replicate and fix or have some workaround. If we have a workaround, it’s always suggested to go with it for now, as the fix may create new issues.

If we don’t have it, discuss it with the Product Owner and analyze the business impacts based on that. Either we need to fix it or notify the customer that it’s a known issue for this patch, and we fix it later and then deploy.

Or You can mention it like below.

In real-time, I’ve handled such issues; we called it dry-run testing in my organization. If it fails, a release decision meeting takes place either to accept the bug if it is serious, then either this will be released separately using that hotfix release or planned for the next release.

If it is serious without it, you can’t release the latest on production; then it has to be fixed on priority, and the release has to be rescheduled for another 24 hours. After all, you can’t release something on production that will block the client application, which was running 24 hours before and suddenly stops working.

You are put into a new team with many bugs raised since the project’s inception. The bugs have not been reported well and are mostly reported in very small one-line details. Please explain your approach to handling this and how you would arrange these issues into something more usable for the QA Manager to review.

Ans: The first step is to schedule a meeting with the offering Manager and other stakeholders to prioritize the bug severity and priority. Many issues will be irrelevant now as the bugs have been in the backlog for a long.

Once that exercise is done, take High severity and high-priority bugs and try to reproduce them again. Rewrite the steps, and assign it to sprint ready. Discuss in the sprint planning and then proceed to the next action.

How do you ensure that no past-built functionality is broken when new functionality is developed in the newsprint? Also, suppose you keep doing regression for past developed sprints (the list of which keeps increasing every sprint with new functionality getting developed). How do you plan for effort or cover-up for the functional testing?
We ensure no past built functionality is broken when the newsprint starts by having a good Regression suite Test.

You have 30 test cases to execute and limited time to deliver; you cannot take another resource for help, so how will you execute these test cases to deliver on time? What will be your strategy?

Ans: In such a scenario, we can do:

  • Prioritize the test cases depending on risk, cost, time, and other factors
  • Ask what would happen if you don’t execute 50% of those 30 test cases
  • Understand the 30 test cases and create a mental model to ascertain the best way to test rather than running through step by step for 30 test cases.
  • Look for ways to automate at lower levels fully or partly for the 30 test cases.
  • Ask yourself why you end up in this situation.
  • Everybody has 24 hours; if it cannot be done in 24 hours, there is no way anybody can bring in the 25th hour, so be candid in your feedback.
  • Skip 50% of executing 30 test cases, and the remaining 50% monitor in production what those test cases would do and how it’s behaving. Leverage unit test cases that can cover up to those 30 test cases
  • Use a feature toggle where you release the product, test it in production, and rerelease it with just a toggle once you are sure it works as expected.
  • Use Blue-Green deployments.
  • Highlight the risks to the stakeholders.

What will you do when the developer is not ready to accept the issue at any cost in this situation?

Ans: Understand why he is not accepting the bug (it’s as per requirement, not replicated, or a known issue ). If it’s as per the requirement, get the ID, check that, and mention comments close/cancel.

If not replicated, try different ways and see what’s different in dev and QA machines (env, test data, exact steps, browser versions, OS version). If everything is the same and we are still unable to replicate QA or dev, then adding comments seems like this is an inconsistent issue, and if we find it again, we will open the bug.

What typically helps you determine the appropriate test coverage amount while creating a plan?

Ans: No of Test cases pass % and No of Features covered for either Manual or Automation No of defects opened (less no obvious and severity of the defect) By considering all these, we can conclude on Test Coverage

At what stage in an SDLC should QA plan a test strategy for a new feature?

Ans: I am not sure if QA needs to pitch in at only some point of SDLC. Things have changed now many QA members are already contributing to the design of the application, so I could say at the start only (QA can understand the design/tech stack/flow/DBS)

While reviewing the necessary regression tests for a particular story, you notice no currently available automated tests. Please describe what your next step would be.

Ans: First, look at the features that are not covered and see those that are done repeatedly, as well as critical features, and then try to create some tasks and cover them along with other works or make this a priority. If not critical features, then still have a ticket/task to track the Automation for those, and whenever any QA gets time, ask them to pick and automate.

You are testing the implementation of a new feature. After reading over an Epic provided by the Project Manager, you notice the workflow isn’t performing as designed. However, the end result is working as expected. After contacting the software engineer, you were told the feature could not be implemented as documented. Please describe what your next step would be.

Ans: Here, we need to discuss with the Product Owner and explain to them how this is designed rather than how it should be. If he/she is okay with that, then u can ask them to change the story or add comments (for future reference)

If we are getting bugs in every build, what will be the first approach

Ans: Your Approach should be like the below:

  • The first step will be to log the bugs.
  • We will first test the critical and high-priority test cases.
  • One person should start retesting the bugs, and the other should start regression. Once the 1st guy has finished the retesting of bugs, he can join you in regression.
  • It seems to be a deployment issue or that the QA environment differs from Prod.

Say you have 100 regression test cases and four days to execute. But you can execute only 20 per day. What will you do in this situation? You have to execute all 100. you can’t leave any. Please, guys, help me how to answer this question.
Ans: You can give multiple answers like (not considering risk-based testing as the requirement is to complete all cases.)

  • Ask your lead to give an extra tester who can complete 5 cases daily.
  • You must stretch for some days to complete(which we all sometimes do 😂 ).
  • (If cases are automated) Take the help of automation and execute the remaining manual cases.

There is a client issue, and one developer is on leave for the entire week, and other developers are in training. The issue needs to be escalated urgently, and it has come to the tester to find the root cause of the problem. How will the tester’s approach be? Can someone answer this?
Ans: Based On the Issue, I can work like this:

1. If it’s a front-end issue, You can quickly check whether it is reproducible. If the issue is reproducible, you can determine if the customer uses customized data or if it’s a direct issue. You can also try to find out if there are any workarounds that you could use to help the customer unblock the issue.

If there is no workaround, you can create a bug, and based on the priority and severity of the issue, you can escalate to the development manager and see if they can provide a quick hotfix or rollback of the production build.

2. If it’s a back-end issue, you can go to the back-end server, analyze the logs, and figure out which calls were failing. Once you identify them, you can try to reproduce the issue locally. If the issue can be reproducible locally, you can try finding any workarounds.

If there are any workarounds, inform the customer. If there is no workaround, you can create a bug, and based on the priority and severity of the issue, you can escalate to the development manager and see if they can provide a quick hotfix or rollback of the production build.

If the issue is not reproducible, see what the customer is doing differently (for example, any customized data or what kind of environments they are running this functionality, etc.) and try reproducing the same in local /pre-prod/staging environments using the same data set.

But In most cases, if you don’t have much time to reproduce the issue or even to analyze the logs, and if the impact is too huge, it is always better to find some workarounds like disabling the feature temporarily or if you don’t find any solution and don’t have time to give a hotfix, its always better to roll back the build to previous stable build in production.

Scenario Based Interview Questions For Automation Testing

  • We have decided to make an existing field from our web application available for our mobile application. This mobile application utilizes an API to communicate and store data within a shared database. While testing the mobile app, you noticed data was not stored within the new field upon saving. Please describe what your next step would be.
  • What command do we use in Selenium to switch from one application to another? For example, if I am on Amazon and want to switch immediately to Gmail or Facebook,
  • If both I’d and XPath are dynamic, which approach and strategy should be used?
  • I have three drop-downs. I am using three different methods in all three drop-downs. I want to create a single generic method for all three drop-downs. Is it possible to create one? What could be the return type for the same?
  • There is a link on a webpage; click That, and a window will open. and now that the opened window contains three different frames, you have to operate on different elements in 3 frames and return to the window. How will you do this?
  • If an element contains an id attribute, that ID is split into two parts by ‘_’ (underscore); the first is constant, and the second is changing. How do you find that element using id?
  • The webpage has a submit button, and many windows are launched when that button is clicked. How do you find the number of windows opened after clicking the submit button?
  • You have been asked to help implement your chosen CI/CD pipeline for the Instagram app. Assume the app is hosted in the cloud on a TEST and PROD environment.
  • What does your essential CI/CD build pipeline(s) look like?
  • What causes the build pipeline(s) to start?
  • Briefly describe each step in your pipeline. Which actions are executed?
  • I have a web table with ten rows and ten columns; in that table, you need to click on Ur name, which is present in one catch is.. every time you refresh the table, cells will get changed, and the position of the cell in which my name is there also changes. In such a case, how do you click on the element?
  • You have to automate 100 test cases, and you will give an estimation for that. Tell us your approach.
  • Search for products on Flipkart and sort them from low to high. How will you make sure o/p is sorted or not?
  • Write a script in Selenium/Java or automate the following scenario:
    1) Open Facebook, Gmail, and LinkedIn in the browser in separate windows in the same order as mentioned.
    2) Now log into Facebook with the username and password
    3) Log in to Gmail with the username and password
    4) Log in to LinkedIn with the username and password
  • How do you handle dropdowns in Selenium without using a select class?
    Ans: Get the XPath of the drop-down location
    1. Then you will get the list of elements
    2. Iterate list elements
    3. Get the text
    4. Write if else
    5. Once you get the value that you want to enter, break the loop
    6. Quit the browser

If a script fails during the execution, how do you debug it, and how do you determine whether it is an application error automation error?

Ans: It might be helpful; please find the answers below in the logical steps.

1) We log information at every level whenever we develop automation scripts. We log each step of what our script is doing, and we use any logging library to generate logs (in the case of Java tech stack projects, mostly Log4J2 is used); again, in logging, we have different levels of logs like Info, Pass, Fail, fatal and debug, etc.

So when designing the logging feature of your Test Automation framework as a team will need to take a call like what level of logs we would be using for application error or automation script error, for example, in our logging feature, when our scripts are failed with a fatal level that means its a script problem if it fails with a Fail level that means its an application Issue.

2) Whenever a script fails with an error(fatal or fail), irrespective of level, we need to have a stack trace generated in our logs. Looking at the stack trace, we can pinpoint exactly which line of code the script failed and navigate to that line in the source code, put a debug point over that line, run your script in debug mode, and inspect your variables.

So, precisely answering your question by looking at the log levels, we can say it’s an application or script issue. Again, if any test automation developer uses a wrong log level in his script source code, it would be a mess.

We strictly adhere to the framework standards as part of peer and lead code reviews. Besides, we have a rich reporting feature that says at what step the script failed and the log level.

There are three buttons available in the UI. For all three buttons, ID is there, but in the ID, the initial values are kept on changes, but at last, button1, button2, and button3 are there. We want to select the 2nd button. How will you write XPath?

Ans: You can use that, or it even contains works. As you are saying, you have numbers in there (button 1,2,3), so u can use XPath, which contains button2 or u can even use an index with Id[2]

You are given 200 APIs and 2 weeks. How would you automate those 200 APIs in 2 weeks? They said there could be multiple correct answers. Any idea what the solution could be?

Ans: Yes, we can automate. Here, the way is

  • Already having the framework in place means accepting the string and converting it to JSON, validating the response, status code, etc., which means reusable methods are already in place.
  • We should place all APIS in Excel with endpoint, base URL, headers, test data, and where you’re required JSON file located.
  • Finally, run your testng.xml and get the result. Ok, take it for simply 10 APIs instead of 200

You have to create one Excel. 1st row will be columns ( Baseurl, endpoint, headers, file location, tagname1, tagvalue1, tagname2, tagvalue2 (these tags are nothing, but once we get the response validation, the tag name is key, and the tag value is value in the respective tag), etc.
From the 2nd row, you should place your 1st API details as per the above columns, like ten or 100 rows.

Note: Ensure the Excel read utility and API JSON utility are already in your framework. Then only it’s possible, or else it takes time.

Let’s say you have multiple windows open in the browser & you want to perform some action on the Xth window.
Ans: Use Set & get the IDs of all the open windows on the browser, as the set always contains unique values & window IDs are always unique. Set return an array containing all of the elements in the list in RANDOM sequence.

Let’s say you have a list of checkboxes & you need to select the check box at the Xth position to continue the rest of the flow.
Ans: Use ArrayList & then, based on the index value of the check box at X th position, perform the needed operation on the checkbox. ArrayList returns an array containing all the list elements in a PROPER sequence.

Real Time Scenario Based Interview Questions For Freshers

For freshers, the recruiter is not concentrating on the depth of technical skills but looking at how the candidate can deal with real-time situations. So for that, they ask these questions; recruiters can gain insight into a candidate’s potential to adapt, learn, and grow on the job and identify those with the skills and aptitude required to succeed in the role.

  • What will you do as a tester if you need more time to complete any task and the given time is much less?
  • You have 20 bugs and need to fix them and run the regression. You are only two people in a team. How will you do it, and which one will you prioritize?
  • What will be your approach if some function is working in the testing environment and the same is not working in production?

Scenario Based Interview Questions for Test Lead

As a Test Lead, having strong problem-solving skills, attention to detail, and the ability to make quick decisions is crucial. To evaluate these skills during the hiring process, recruiters often use Situational Interview Questions.

  • Describe a time when you had to deal with an angry client.
  • Do you think team members should take any responsibility for problems in the project? What would your advice be if one of them failed and caused harm? If so, under what circumstances might this issue arise, and how do we avoid it? How well prepared will each member feel about their roles after working on such a self-managed team all year?
  • Which skills and qualities do you think a person needs to be a good team member?
  • Please briefly explain your role when the project got delayed for an unexpected reason, which our date commitment scope did not cover.
  • Describe when you encountered problems working with people from other countries/cultures during your employment experience. How did you handle it in such a situation? How would you have been the outcome if you couldn’t solve the problem effectively?
  • How would you describe your work style to others?
  • Please tell me what your tasks were in your previous job. What projects did you manage or do technical leadership within that project(s)?
  • How do you handle your conflicts with management/higher-ups of the company? What methods are employed to solve them, and how successful can the result be?
  • Describe a project update meeting, What will be described, presentation style presentation on new techniques/tools of presenters, what individual team members discussed during their conference call, etc. Understand that your turn is not until 5 minutes.
  • Tell me about the work you’ve been doing recently. What’s the most interesting bug that you’ve found, and why?
  • What kind of challenges does testing present? Can you tell me about some specific software testing challenges and how you overcame them?
  • Why did you choose software testing as a career, and what motivates you to stick with it?
  • Have you encountered any challenges working with your colleagues? Tell me about a specific instance when you were in a difficult situation and how you dealt with it.
  • How about situations where you have to make decisions. Have you ever made a bad decision? What contributed to you making that decision? How did you deal with the consequences?
  • How have you added value to the organizations you’ve worked with? Can you give me a specific example from your last or current position?
  • What process are you using for testing currently? Can you describe how you might improve it?
  • What kind of tests have you been doing? What do you enjoy about them? How do you develop those tests?
  • When you perform a test, what steps do you take? What’s your process?
  • Have you ever written a test plan? What would you put in one?
  • What’s the role of risk in your testing? How do you analyze and measure it?
  • If I left you testing for two hours, what would you have to show me when I returned?
  • Testing can be challenging. What keeps you motivated?
  • How do you stay at the top of your game? What self-learning do you do?
  • What have you been criticized for in the past? How did you respond to that criticism? What did you do about it?
  • Describe the characteristics of your ideal boss and why.
  • How many people are working on your project, and what teams are there

Java Scenario Based Interview Questions

Below, we have shared scenario based Java interview questions, so kindly prepare these questions before attending any Java position.

Java Program:

  • Input string=”Hi Softwaretestingo User”;
  • Output = “resU ognitseterawtfoS iH”;

Program 2:

Make a pair which out of the sum value is 25;

  • Input: (1 15 21 13 10 4 12 24)
  • Output = (10 15) (21 4) (12 13) (24 1)

Write a code (any language you are proficient in) such that when two arrays of names are passed, it will return an array containing the names that appear in either or both arrays. The returned array should have no duplicates.
For example,

  • Input: Array 1 – {‘Ava’, ‘Emma’, ‘Olivia’} & Array 2 – {‘Olivia’, ‘Sophia’, ‘Emma’}
  • Output: should return an array containing Ava, Emma, Olivia, and Sophia in any order.

Write a code (any language you are proficient in) to check the biggest palindrome in a given array.

  • Input: Array – {aaa, aba, adda, acdea, aeda }
  • Output: The biggest palindrome is adda

Return the sum of the numbers in the array, except ignore sections of numbers starting with a 6 and extending to the next 7. (every 6 will be followed by at least one 7). Return 0 for no numbers.
Ex1: [1, 2, 2] → 5
Ex2: [1, 2, 2, 6, 7] → 5
Ex3: [1, 1, 6, 7, 2] → 4

Given an array of ints, return true if every element is a 1 or a 4.
Ex1:([1, 4, 1, 4]) → true
Ex2:([1, 4, 2, 4]) → false
Ex3:([1, 1]) → true
Ex4:([4]) → true

You must store Global information like URLs, Default Username Password, and Env details.
Ans: Use Map & store the data as Key and value, i.e., URL: & Map returns the value associated with keys.

Scenario Based Interview Questions and Answers From HR

  • How do you handle a difficult situation?
  • What is your greatest weakness?
  • What are your strengths and weaknesses as a leader?
  • Describe the most challenging work experience you’ve had in the past year.
  • How would you describe yourself as an employee?
  • Tell me about yourself and how your professional journey started in Testing.
  • What motivates you in testing
  • Why do you want to join us
  • If I will ask your manager then what weakness about you he will tell
  • If I ask your manager what strength you have, he will tell me.
  • How will you handle frequent modification of test cases if the product is already implemented and release is very near
  • Any certification done in the last year

Scenario Based SQL Interview Questions

We are working on adding some of the sql scenario based interview questions to our scenario-based interview questions.

In your interview, if you have faced any sql scenario based interview questions for experienced professionals, kindly share them with us.


In conclusion, scenario based interview questions for manual testing are a valuable tool for hiring managers seeking to evaluate a candidate’s suitability for a role. They allow the interviewer to assess a candidate’s decision-making skills, problem-solving abilities, and communication skills, as well as their ability to think creatively and adapt to new situations.

Candidates who can respond to scenario-based questions confidently are likelier to stand out during the hiring process and demonstrate the skills and attributes required to excel in the role.

I love open-source technologies and am very passionate about software development. I like to share my knowledge with others, especially on technology that's why I have given all the examples as simple as possible to understand for beginners. All the code posted on my blog is developed, compiled, and tested in my development environment. If you find any mistakes or bugs, Please drop an email to, or You can join me on Linkedin.

Leave a Comment