Scenario based interview questions are a popular method hiring managers to use to assess a candidate’s problem-solving skills and decision-making abilities. These questions typically present the candidate with a hypothetical situation and ask how they would respond or what actions they would take. 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 of Selenium. We Hope these questions will help you answer some scenario-based interview questions.
Scenario Based Interview Questions for Manual Testing
- 100 test cases are there; only we need to execute the selected 5 test cases? Can you please let us know?
- If there are 100 test cases if I want to execute the first 50th test case and then 1 test case should be executed, how do you do it?
- There is a release tomorrow, and you got the build today. you are able to 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 20thtest case, 21 st test case needs to be executed.
When our release is in the next 2 hours & as a Tester, we found a blocker bug; then what will you do?
Ans: First thing, 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 then 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, and in my organization, we called it dry-run testing. If it fails, then a release decision meeting takes place either to accept the bug if it is serious, then either this to be released separately using that hotfix release or planned for the next release. If it is really serious without it you can’t release the latest on production then it has to be fixed on priority and release has to be rescheduled for another 24hr After all, you can’t release something on production which will block the client application which was running 2hr before and suddenly stops working.
You are put into a new team with a large backlog of bugs raised since the project’s inception. The bugs have not been reported in a good state 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 are in the backlog for since long. Once that exercise is done, take High severity and high-priority bugs and try to reproduce them again. And 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 not broken when new functionality is getting developed in the newsprint? Also, if you keep doing regression for past developed sprints (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?
Ans: We ensure no past built functionality is not broken when the newsprint starts is by having a good Regression suite Test.
You have 30 test cases to execute and you have limited time to deliver, you cannot take another resource for help, so how u will execute these test cases to deliver on time? What will be ur 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 did we 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, rest 50% monitor in production what those test cases would actually do and how it’s behaving. Leverage unit test cases that can cover up for those 30 test cases
- Use feature toggle, where you release the product, test in production and release again with just a toggle once you are sure it works as expected.
- Use Blue–Green deployments.
- Highlight the risks to the stakeholders.
When the developer is not ready to accept the issue at any cost in this situation what will you do?
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 still unable to replicate QA or dev, then adding comments seems this is an inconsistent issue, and if we found 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 start planning a test strategy for a new feature?
Ans: Not sure does QA need to pitch in at only some point of SDLC things are changed now many QA members are already contributing in Designing of the application, so I could say at starting only (QA can understand the design/tech stack/flow/DBS)
While reviewing the necessary regression tests that are needed for a particular story, you notice there are currently no automated tests available. Please describe what your next step would be.
Ans: First, look at the features that are not covered and see those are done repeatedly, and critical features, 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 reaching out to the Software Engineer, you are given an explanation that 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 builds, what will be the first approach
Ans: Your Approach should be like the below:
- The first step will be to log the bugs.
- Will first test the critical and high-priority test cases
- One person should start retesting the bugs, and the other person should start regression. Once the 1st guy has finished the retesting of bugs, he can join you in regression.
- It seems a deployment issue or the environment of the QA environment is different 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 have to 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 if the issue is reproducible or not. If the issue is reproducible, you can try to figure out if the customer is using customized data or if it’s a direct issue, you can also try to find if there are any workarounds that you could help the customer to 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 particular calls were failing. Once you identify them, you can try to reproduce the issue locally. If the issue can be reproducible locally, then you try to find 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 to reproduce the same in local /pre-prod/staging environments using the same set of data.
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, its 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 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. Now 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 on That, link a window will open, and now that opened window contains three different frames, you have to do the operation 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 part is constant, and the second part 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 to find the number of windows opened after clicking 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 cell..here 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 to 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 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 to 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. Basically, we log each and every 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 is failed with an error(fatal or fail) irrespective of level, we need to have a stack trace generated in our logs, and looking at the stack trace, we can exactly point out which line of code the script failed and can navigate to that line in source code and put a debug point over that line and 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 issue or script issue. Again if any test automation developer uses a wrong log level in his script source code, then it would be a mess. As part of peer code reviews and lead code reviews, we strictly make sure that we are adhering to the framework standards. Besides this, we have a rich reporting feature that says at what step the script failed and what is the log level.
There are three buttons available in 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: Yes, 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.
- All APIS we should place in excel with endpoint, base URL, headers test data, and it means 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 rows or 100 rows.
Note: make sure the excel read utility and API Json utility are already in place in your framework. Then only it’s possible or else it take 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.
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 types of 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.
- If you need more time to complete any task and the given time is very less, what will you do as a tester?
- You have 20 bugs, and you need to fix them as well as you need to run the regression. You are only two people in a team. How will you do it, and which one will you give priority to?
- 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 arises, 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 were your tasks 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 describe, 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.
Scenario Based Interview Questions in Java
Java Program:
- Input string=”Hi Softwaretestingo User”;
- Output = “resU ognitseterawtfoS iH”;
Program 2:
Make 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
Let’s say you have to store Global information like URLs, Default Username Password, and Env details.
Ans: Use Map & store the data as Key and value, i.e., URL: www.xyz.com & Map returns the value associated with keys.
Scenario Based Interview Questions and Answers
Scenario Based Interview Questions 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 will ask your manager then what strength you he will tell
- How will you handle frequent modification of test cases if the product is already implemented and release is very near
- Any certification is done in the last year
Scenario Based Interview Questions in SQL
Questions will be added
Conclusion:
In conclusion, scenario-based interview questions 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 with confidence and clarity are more likely to stand out during the hiring process and demonstrate that they have the skills and attributes required to excel in the role.
Leave a Reply