Testing Engineer Interview Questions | Glassdoor

Testing Engineer Interview Questions

3,257

Testing engineer interview questions shared by candidates

Top Interview Questions

Sort: RelevancePopular Date

Design Verification & Test Engineer at Marvell Semiconductor was asked...

Sep 20, 2010
 You have seven stones and a weighing scale. Six of the stones are equal in weight and one is lighter. How will you figure out which one is lighter ? Minimum tries required to do so ? 5 AnswersTrail 1: At random weigh two stones vs. two stones (3 sitting on the side) A: Of the 4 on the scales if one side weighs more then the other then weigh one on each side (since one of them must be heavier) B. If the 2 vs 2 are equal then at random weigh 2 (one on each side) of the three left on the side. If they are the same then the 3rd one that never got weighed is the heaviest. Simple case of process of elimination by grouping (Divide and Test)I would first weigh in one stone, say stone 1, and assume the weight is say 2 lbs(try 1). Then separate the 6 remaining stones into 2 piles, 2,3,4 and 5,6,7. Weigh in either 2,3,4 or 5,6,7, it doesn't matter. Say 2,3,4, if the sum of these 3 is 6 then the lighter stone has to be in the 5,6,7(try 2). Weigh in 5,6, if the sum of the two is 4 then the lighter is stone 7(try3). If sum is less than 4 then weigh in either 5 or 6 to find out. So, the maximum number of tries is 4 and least is 3.Needs two weighing at most: 1. Put {1, 2, 3} on LHS and {4, 5, 6} on RHS. 2. If LHS and RHS are equal 7 is the lighter one. else discard heavier of previously weighed group. Now we have a group 3 stones left. Lets call them A, B, C. 3. Put A on LHS and B on RHS. 4. If LHS and RHS are equal C is the lighter one. else lighter or LHS or RHS is the lighter one. Voila!Show More ResponsesTwo tries. 1st try: 3 : 3, 7th is fake if equal; otherwise, 2nd try: 1:1 picked from the light triple in 1st try. the lighter one is fake if any, the third one fake otherwise.If the stones are made of the same material... they likely have the same density... therefor whichever one looks the smallest, will weigh the least... there... 1 step... just look for the one that is the smallest.

Software Development Engineer In Test at Amazon was asked...

Jan 27, 2012
 First explain what a tree, then binary tree, then a binary search tree is. Now implement a function that verifies whether a binary tree is a valid binary search tree.5 AnswersSadly I ran out of time for this question. But I e-mailed the response after my time was up. First create a small implementation of a binary tree, I did it in java with the standard implementation Nodes with left and right children as data points. Check whether the left child and right child have valid values, which is to say make sure all children on the right of a node have values greater than parents that they came from. The key thing that I missed during the interview was the fact that if you traverse once to the right, then once to the left, you have to make sure the value is between the max and min that you've encountered up to that point.int validate_BST(struct tnode *tree){ int ret1, ret2; if (tree == NULL) return 1; else { if (tree->left != NULL){ if (tree->data > tree-left->data){ ret1 = validate_BSR(tree->left); } else return 0; } if (tree->right != NULL) { if (tree->data right->data){ ret2 = vaidate_BSD(tree->right); } else return 0; } return (ret1 == 1 && ret2 == 1)? 1: 0; } return 0; }To find whether a binary tree is valid Binary search tree, do inorder traversal and check if the nodes are sorted.Show More Responsesprivate boolean isBST(){ return isBST(root, Integer.MIN_VALUE, Integer.MAX_VALUE); } private boolean isBST(Node node, int min, int max){ if(node == null) return true; if(node.data max) return false; else return (isBST(node.left, min, node.data) && isBST(node.right, node.data+1, max)); }In order to verify the Binary Search Tree, Read the nodes in Inorder mode. Also at every step check if the current node value is less than the one previously found then exit the traversal as the items are not sorted.

Sep 26, 2012

Test Engineer at Qualcomm was asked...

Feb 7, 2014
 Talk about how to verify if an RF amplifier is operating in its linear mode?4 AnswersObserve the IM3. Back off input by 1dB and see how much IM3 changes.hi, did you applied for system test engineer? If yes, can I ask some detailed question? Thank you!Yes.Show More Responseshi, can you send me your email address? Mine is dayuallen@gmail.com, thank you.

Software Design Engineer In Test at Amazon was asked...

Jul 28, 2012
 find if 2 strings are anagrams5 AnswershashHash what, lol ? :))) You simply need to alphabetically sort characters in strings and then compare the result.think about the time complexity. Whats the time complexity of the sorting? NlogN And when using hash mapping, it can be only N. Mapping the string to an alphabet array, the index is the char and the value stores the frequency of the char. Hope it helps.Show More Responseseasiest way probably to reduce the characters to ascii, add them all together. If values are equal, they all contain the same characters. O(n)Just reverse one string and then compare the result with other string.

Software Development Engineer In Test (SDET) at Microsoft was asked...

Feb 19, 2013
 Given a triangle, determine if its a scalene, equilateral, isosceles or neither... required knowledge of triangle properties, I learnt these properties about two decades ago so ofcourse I was fuzzy on the details, completely unexpected4 Answerstesting use of ==, got a feeling he wanted to use bit level comparisons to compare sides lengthsIf the sides are all integers, then compare the length^2 instead of length to avoid the floating comparison; If the sides are floating numbers, then we need to set an epsilon to test. You'd better ask the interviewer about this. Asking this will definitely gives the interviewer better impression.... I believe :-)BTW, if you are given the sides instead of points, the condition to make an triangle is: a+b > c && b+c > a && c+a > bShow More Responses/* Q: Given a, b, c, determine if it can be the 3 sides of triangles, if yes determine if it's equilateral, isosceles, or scalene. */ #include #include #include using namespace std; // Use this in real world typedef enum { NONE = 0, EQUILATERAL = 1, ISOCELES = 2, SCALENE = 3 } TriangleType; double Epsilon = 1.0E-6; string GetTriangleType(double a, double b, double c) { if (a+b > c && b+c > a && c+a > b) { bool ab = (fabs(a-b) < Epsilon); bool bc = (fabs(b-c) < Epsilon); bool ca = (fabs(c-a) < Epsilon); if (ab && bc && ca) return "Equilateral"; if (ab || bc || ca) return "Isoceles"; return "Scalene"; } else { return "None"; } } int main() { cout << GetTriangleType(3, 3, 3) << endl; cout << GetTriangleType(3, 3, 5) << endl; cout << GetTriangleType(3, 4, 5) << endl; cout << GetTriangleType(3, 4, 7) << endl; return 0; } /* Output: Equilateral Isoceles Scalene None */

Nov 11, 2013

Senior Systems Test Engineer at Qualcomm was asked...

Jun 7, 2010
 There is a body of water that starts with 1 square unit, and doubles in size every day (2 units after 2 days, 4 units after 4 days). It takes 100 days to fill up. How many days would it take to fill if you started with 2 square units?6 Answers100 - 1 = 99 daysThis question is phrased incorrectly. I think you meant "4 units after 3 days". Which makes your answer wrong as well. This is not helpful at all.if you start with 1sq unit - lets say you end up with 'x' amount to fill up - takes 100 days if you start with 2 sq unit - you will have to fill up '2x' amount thus it will take - 200 days.Show More ResponsesStarting with 2 square units at time t=0 is like 1 square unit at t = 1. [this logic is the key to answering the question]. Now let's do the first few cases. t = 0: size = 1+1 = 2 t = 1: size = 2(1+1) = 2+2 = 4 = f(2) in the 1 unit case. Pretty easy to see it only requires 1 time period less from here. The OP was right.1 day less that is 99 days.It is still 100 days. Starting from 2^0, and going all the way to 2^100, the reservoir has a capacity of 2^101 - 1 units. Now in the second case, starting from 2^1, in 99 days there will be 2^101-2 units of water in the reservoir, which is one unit short of the capacity of the reservoir. So we need the 100th day to fill it up!