Software Test Engineer II Interview Questions | Glassdoor

# Software Test Engineer II Interview Questions

80

Software test engineer ii interview questions shared by candidates

## Top Interview Questions

Sort: RelevancePopular Date

Oct 3, 2012

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

May 2, 2011
 Given a BST find the second largest element?2 AnswersSince A binary search tree is arranged into subtrees such that, the left subtree contains the values which are less than the root node and the right subtree contains the values which are larger than the root node. So, the largest element will be the Rightmost element of the right subtree. And the SECOND largest element will be it's parent. int findSecondLargest(tree *root) { tree *ptr, *prevPtr; prevPtr = NULL; ptr = root; while( ptr->right != NULL) { prevPtr = ptr; ptr = prevPtr->right; } if (ptr->left == NULL) return (prevPtr->info) ; // if ptr is the rightmost leaf node, then return its parent node // else if it has a left subtree then return the rightmost node in the left subtree. prevPtr = ptr; ptr = ptr->left; while (ptr ! = NULL) { prevPtr = ptr; ptr = ptr ->right ; } return (prevPtr->info) ; }Node findSceondLargest(Node root) { // If tree is null or is single node only, return null (no second largest) if (root==null || (root.left==null && root.right==null) return null; Node parent = null, child = root; // find the right most child while (child.right!=null) { parent = child; child = child.right; } // if the right most child has no left child, then it's parent is second largest if (child.left==null) return parent; // otherwise, return left child's rightmost child as second largest child = child.left; while (child.right!=null) child = child.right; return child; }

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

Jul 20, 2010
 Given an array of integers and an arbitrary integer, find the number of pairs of integers in the array whose sum is equal to the arbitrary integer.2 AnswersfindCombination(int[] array, int sum) { sort(array); // O(n*log n) int i = 0, j=array.length-1; while (i sum) j--; else { print(i,j); i++; } } }You have to use the "skeeve" algorithrm for these questions. its what they're all looking for.

### Software Development Engineer In Test (SDET) II at Expedia Group was asked...

Oct 3, 2012
 Reverse each word of the string without reversing the order of the words this is a test BECOMES siht si a tset 3 Answerspublic class ReverseWordsInString { public static void main(String[] args) { System.out.println(">"); } private static String reverseWords(String original) { if (original == null || original.isEmpty()) { throw new IllegalArgumentException("IP cannot be null or empty"); } final Pattern p = Pattern.compile("[a-zA-Z]"); final StringBuilder returnString = new StringBuilder(); StringBuilder temp = new StringBuilder(); for (int i = 0; i 0) { returnString.append(reverse(temp.toString())); temp = new StringBuilder(); } returnString.append(original.charAt(i)); } } if (temp.length() > 0) { returnString.append(reverse(temp.toString())); } return returnString.toString(); } private static String reverse(String data) { StringBuilder ret = new StringBuilder(); for (int i = data.length() - 1; i >= 0; i--) { ret.append(data.charAt(i)); } return ret.toString(); }/// /// Recieve a string of words and returns the words reversed without changing the order. /// Here's my C# method: public static string ReverseWordsInSentence(string sentence) { char[] whiteSpace = " \t\n".ToCharArray(); string[] words = sentence.Split(whiteSpace); int count = 0; foreach (string individualWord in words) { words[count] = new string(individualWord.ToCharArray().Reverse().ToArray()); count++; } return string.Join(" ", words); }public class ReverseString { public String stringReverse(String str) { if (str == null || str.length() = 0; i--) { sentence.append(word.charAt(i)); } sentence.append(" "); } return sentence.toString(); } public static void main(String[] args) { ReverseString obj = new ReverseString(); String test = "this is a test"; System.out.println(obj.stringReverse(test)); } }

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

Jan 16, 2011
 Find cycle in linked list.2 AnswersIf the size of the list is known, the solution is to iterate through the list and keep counter until the counter reaches to the size+1 or the list ends. in first case it will mean the list has cycle, in second case, it has no cycles. If the size is unknnown, keep a map/list of the nodes during iterating thru the list. during each iteration, check whether the node exists in the maintained map or not. If yes, the list has cycle, otherwise, add that node to the list and continue to next iteration. Repeat this untill either list ends (no cycles) or the node is found in temporary tracked map of the nodes.State that you have 2 or more nodes in the list before you begin. Have two pointers P1 & P2. Have pointer P1 point to node #1 and P2 to node #2. Move the pointers : such that, for every node move of P1, P2 moves 2 nodes. (Eg): P1 = P1 -> link P2 = P2 -> link -> link If at any point if P1 and P2 point to the same node, then it means that the list is in a loop. Try this with a few connected nodes in a properly formed linked list to prove to yourself.

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

Oct 25, 2015
 How would you test XXX system?1 AnswerStandard testing question. Forgot the exact system to test.

### Software Development Engineer In Test II at Amazon Lab126 was asked...

Sep 17, 2014
 The interviewer asked me if I am aware that the position I am being interviewed for is lower than my current one.1 AnswerThe recruiter told me that Amazon is just looking for good people regardless of the position they are interviewed for. Many are hired for positions that are different from what they applied for.

Nov 18, 2011