Software Development Engineer In Test II Interview Questions | Glassdoor

# Software Development Engineer In Test II Interview Questions

69

Software development engineer in test 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 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 (SDET) II at Expedia 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 II at Amazon was asked...

Jul 20, 2010
 Design a parking lot using OOPS.1 Answerhttp://stackoverflow.com/questions/764933/amazon-interview-question-design-an-oo-parking-lot

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

Jul 20, 2010
 How would you test a search engine ?1 Answer1.) Response Time. 2.) Number of servers the engine is using to retrieve data for the search. 3.) Throughput 4.) Simulate search engine using several multi-threaded searches.

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

Nov 18, 2011
 Design a test strategy for DLNA based wireless streaming. Tell how to test it.1 AnswerTell how the Test Design Document will look like. Tell about the Test Strategy. Tell about different test methodologies you adopt along with examples. You have to continuously think back of mind about a new methodology while you are saying about one so that the flow is intact. Otherwise you will get stuck for the next one to tell. It can last up to 45 minutes or more. Issue here is you will get stuck after sometime or ideas will start to repeat on back of your head. Never let it happen, I guess that is where the trap is , but not sure. Verbalize what you think.

Nov 18, 2011