Software Development Engineer In Test (SDET) II Interview Questions | Glassdoor

# Software Development Engineer In Test (SDET) II Interview Questions

52

Software development engineer in test (sdet) 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 (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 (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

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

Nov 18, 2011
 Write an optimized program to find the characters within a string and return number of times it will get repeated along with the character. Test the program1 AnswerStrategy is same as in question no. 2. Here think about Dictionary or Hash table solutions. Think about abstract data types. Ask questions. Think about ASCII and UNICODE.

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

Nov 18, 2011
 175 players in a 1 to 1 match. Those who fail the match quits. Find out a strategy to design the games in a way where minimum number of games will be played to select the winner. 2 AnswersVerbalize the way you think. Dont stare blank. Sometimes by evening you may get exhausted. But never go blank with ideas.I think its a very open question and answer should be open too. We can start with around 86 or 87 initial matches and there would be 50% winners then we can calculate the top scorers of the matches and make separate pools for them. In that case winners with low points would eliminate and players/winners with top scores will qualify for the next rounds. I think it happens in boxing,...

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

Nov 18, 2011
 How to explain to a non techy about the paging process of an operating system. Tell the non techy guy about the fragmentation procedure and fragmentation.1 AnswerExplain about the technical terms. Then tell how you will tell an non techy about the process. Think and come up with a nice example. Also as I think as its SDET level 2 they will ask you questions about managing difficult situations. Be prepared for that.

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

Nov 30, 2011
 Write a method to rotate an array at n without using O(1) space. How would you test this method1 Answer- Reverse the array from 0 to array length - Reverse the array from position 0 to n and n+1 to array length - When doing the reverse (swapping elements) it can be done with no extra space using XOR public string RotateOnIndex(string word, int index) { if (String.IsNullOrWhiteSpace(word)) return word; if (index (word.Length - 1)) return String.Empty; char[] letters = word.ToCharArray(); Reverse(letters, 0, letters.Length - 1); Reverse(letters, index, letters.Length - 1); Reverse(letters, 0, index - 1); return new String(letters); } private void Reverse(char[] letters, int start, int end) { while (start < end) { letters[start] ^= letters[end]; letters[end] ^= letters[start]; letters[start] ^= letters[end]; start++; end--; } }
110 of 52 Interview Questions