New Graduate Software Engineer Interview Questions | Glassdoor

# New Graduate Software Engineer Interview Questions

13

New graduate software engineer interview questions shared by candidates

## Top Interview Questions

Sort: RelevancePopular Date

### New Graduate - Software Development Engineer In Test at Microsoft was asked...

Nov 26, 2012
 You are in a room by yourself and someone walks into the room, asks you to find the temperature, and leaves. How would you find the temperature in the room without leaving the room?3 AnswersCall a friend to bring a thermometer over.Cut a 5cm*5cm*5cm ice cube from the refrigerator, and test how long it take for it to melt completely.Find two equal size ice cubes, for the first one, wait till it melts completely(0 ℃) , heat it till it boils, record the time t1. For the second one, wait long enough till the water has the same temperature with the room, than heat it till it boils, record the time t2. The room temperature is 100*t2/t1.

### New Graduate - Software Development Engineer In Test at Microsoft was asked...

Nov 26, 2012
 Write a function (in your preferred language C, C++, or Java) that will take the given string and return the reverse. (ie. input:"abc def ghi" output:"ihg fed cba") Optimize the above code (if possible). Now knowing that the original function you wrote in pt1 is being used by other programs and cannot be modified write another function that when called will utilize the function from pt1 to only reverse the words in the sentence. (ie. input:"abc def ghi" output:"ghi def abc") Test your code.2 Answerspublic class TestRun2 { public static void main(String[] args) { String inputString = "abc def ghi"; System.out.println(reverseString(inputString)); // now reverse the words System.out.println(reverseWords(inputString)); } public static String reverseString(String input) { char[] inputCharArray = input.toCharArray(); char[] returnCharArray = new char[inputCharArray.length]; for(int i=0; istring reverseString(string str) { int i = 0; while(i < str.size()/2) { char temp = str[i]; str[i] = str[str.size() - i - 1]; str[str.size() - i - 1] = temp; ++i; } return str; } int main(int argc, char *argv[]) { string temp = "abc def ghi"; cout << temp << endl; cout << reverseString(temp) << endl; } To do the second part, give the algorithm each word, and concatenate them.

### New Graduate - Software Development Engineer In Test at Microsoft was asked...

Nov 26, 2012
 Write a function that when given a string will return the position of the starting point of the largest reoccurring character. (ie. given:"AAABBCCCCD" would return 5 (starting point of C)) Test your code.1 Answerimport java.util.ArrayList; public class TestRun2 { public static void main(String[] args) { /* * Write a function that when given a string will return the position of * the starting point of the largest reoccurring character. (ie. * given:"AAABBCCCCD" would return 5 (starting point of C)) */ String input = "AAABBCCCCD"; System.out.print(largestReoccuringCharacter(input)); } public static int largestReoccuringCharacter(String input) { // 1. Count all the characters, find the character that reoccurs the // most // 2. Find the position of the first most reoccuring character if(input == null || input.isEmpty()) { return -1; } ArrayList charArrayList = new ArrayList(); ArrayList charIndexList = new ArrayList(); // Add all elements in input to ArrayList, and also a HashSet for (char c : input.toCharArray()) { Character inChar = (Character) c; // convert to object charArrayList.add(inChar); if (!charIndexList.contains(inChar)) { charIndexList.add(inChar); } } // For each char in the index, count occurences in arraylist. Find most // occuring int highestNumberOfOccurences = -1; Character highestChar = null; for (Character c : charIndexList) { int count = 0; while (charArrayList.contains(c)) { charArrayList.remove(c); count++; } if (count > highestNumberOfOccurences) { highestNumberOfOccurences = count; highestChar = c; } } // found character with highest count. Return index position. return input.indexOf(highestChar.toString()); } } JUnit Test: import static org.junit.Assert.*; import org.junit.Test; public class TestRun2Test { @Test public void testLargestReoccuringCharacter() { String input1 = "AAABBCCCCD"; String input2 = "AAABBCCCCDDDDD"; String input3 = "AAABBCCCCDDDD"; String input4 = "AAABBCCCC AADDDD"; String input5 = " "; String input6 = ""; String input7 = null; assertEquals(TestRun2.largestReoccuringCharacter(input1), 5); assertEquals(TestRun2.largestReoccuringCharacter(input2), 9); assertEquals(TestRun2.largestReoccuringCharacter(input3), 5); assertEquals(TestRun2.largestReoccuringCharacter(input4), 0); assertEquals(TestRun2.largestReoccuringCharacter(input5), 0); assertEquals(TestRun2.largestReoccuringCharacter(input6), -1); assertEquals(TestRun2.largestReoccuringCharacter(input7), -1); } }

Dec 22, 2016
 Q: Find the bottom head of linked list with three heads attached to it.1 AnswerDepth first search with a parent map to identify branch junctures, then walk backwards from the bottom juncture.

Mar 22, 2016

Mar 28, 2016
 Write code using neural network to realize handwriting(numbers) recognition.Be the first to answer this question

### New Graduate - Software Development Engineer In Test at Microsoft was asked...

Nov 26, 2012
 Someone codes and interface that consists of 3 input text boxes and a start button. When the start button is pressed a triangle will be drawn on the screen. Each side of the triangle will correspond to a length in one of the input boxes. How would you test this program?Be the first to answer this question

### New Graduate - Software Development Engineer In Test at Microsoft was asked...

Nov 26, 2012
 We have a quadtree algorithm and we are assuming that the boxes are labeled 0 (top left), 1 (top right), 2 (bottom left), 3 (bottom right) 'n' times. Write a function that when given an array input of n size (ie. [0,0,0,0] or [0,0,0,0,0,0,0,0,0] would be the top left corner) would determine if the corresponding box has at least one side touching at least one of the outermost walls. Be the first to answer this question