Testing Engineer Interview Questions | Glassdoor

Testing Engineer Interview Questions

3,230

Testing engineer interview questions shared by candidates

Top Interview Questions

Sort: RelevancePopular Date

Phone interview 1 : a) Simulate a Queue with stacks ? b)Find repeated occurrence of character in a string ? Phone interview 2 : a) Given a 2D matrix of numbers find the position of number . Constraints of matrix number always in increasing order left to right and top to bottom . b)When should version control be used . And a tricky discreet math problem ?

13 Answers

Wow, a lot of questions: 1. a) Something like this: public class StackBasedQueue { private final Stack store; public StackBasedQueue() { this.store = new Stack(); } public void addToTail(final Integer v) { this.store.push(v); } public Integer popHead() { final Stack temp = new Stack(); while(!this.store.isEmpty()) { final Integer v = this.store.pop(); temp.push(v); } final Integer head = temp.pop(); while(!temp.isEmpty()) { final Integer v = temp.pop(); this.store.push(v); } return head; } public int size() { return this.store.size(); } }

1. b) Something like this: O(n) runtime. public void findRepeats(final String str) { this.map.clear(); final char[] array = str.toCharArray(); for(int i = 0; i < array.length; i++) { final Character c = array[i]; Integer count = this.map.get(c); if(count == null) { this.map.put(c, 1); continue; } count++; this.map.put(c, count); } }

For a) further challenge was to simulate a double ended queue , but we ran out of time . you could maintain temp stack as permanent variable and get around doing that. b) Kind of sort of what I wrote I was asked to optimize even further , so I said XOR the array make a note of elements left , remove from original list and you have set of repeated elements .

How would you determine if someone has won a game of tic-tac-toe on a board of any size?

14 Answers

The Game of Nim worded diffently.

11 Answers

Most of them were expected. Almost all are problem solving questions. 1. Given a BST with following property find the LCA of two given nodes. Property : All children has information about their parents but the parents do not have information about their children nodes. Constraint - no additional space can be used

15 Answers

Given a set of numbers -50 to 50, find all pairs that add up to a certain sum that is passed in. What's the O notation for what you just wrote? Can you make it faster? Can you find an O(n) solution? Implement the O(n) solution

17 Answers

Initialize a 5 by 5 array with this sequence. 1 2 3 4 5 6 4 8 9 10 11 12 9 14 15 16 17 18 16 20 21 22 23 24 25

7 Answers

You are a parking lot attendant in a lot that has one open spot, and you want to move the cars from their original positions into a new arrangement. Create a program that will print out instructions on how to move the cars most efficiently.

7 Answers

Given a list of n numbers. All numbers except one are unique. Find the number with duplicate entry.

10 Answers

You have 2 buckets in a room and one bucket has 17 Red balls, 19 Green Balls, 21 Blue Balls, 23 Yellow Balls. You are blindfolded and you need to pick one ball at a time and put in the bucket#2. You should stop at a point where you are confident that the color of the ball you are putting in already exists in the bucket#2. When would you stop?

9 Answers

Asked to implement a function that takes an integer and returns whether or not the number had an odd or even number of 1 bits.

6 Answers
110 of 3,230 Interview Questions