Software Engineer in Test Interview Questions
- 0of 0 votes
Answersfor this code:
class Interview { // input is max 3 chars public static int convertToString(int input) throws IllegalArgumentException; }
write a method which checks whether the proper exception is being thrown.
- HB February 08, 2013 in United States| Report Duplicate | Flag | PURGE
thePlatform Software Engineer in Test - 0of 0 votes
Answerswrite as many test cases for this : example : 123, 1, 2,... -123, 0,...
- HB February 08, 2013 in United Statesclass Interview { // input is max 3 chars public static int convertToString(int input) throws IllegalArgumentException; }
| Report Duplicate | Flag | PURGE
thePlatform Software Engineer in Test - 1of 1 vote
AnswersWrite a function that gets a number n and prints out a random list
- fly123 February 01, 2013 in United States
of numbers 1..n to the screen. For example:
randlist(5) : 1 5 3 2 4
randlist(6) : 4 6 1 5 3 2
This should be truly random (uniformly spread) and with a O(n) complexity.
Every number should appear only once. Random(n) is given as a tool you can use to generate a
single random number between 1-n| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test Coding - 19of 19 votes
AnswersHow do you parse a phone number from a huge database of a 'n' billion webpages in 30 minutes ?
- Yashwanth January 30, 2013 in United States| Report Duplicate | Flag | PURGE
Apple Software Engineer in Test Algorithm - 0of 0 votes
AnswersDesigned a similar API like malloc, which has a similar functionality. How do you test the API ?
- Yashwanth January 30, 2013 in United States| Report Duplicate | Flag | PURGE
Apple Software Engineer in Test Testing - 0of 0 votes
AnswersGiven a two dimensional matrix of booleans, there is a function that returns the number of "true regions".
A region is a group of True values aligned vertically or horizontally.T T <= 1 region T F T F <= 2 regions F T
Question 1: How would you test a function that solve this problem, but is written by another developer. How many tests cases do you see?
- hnrqbaggio January 24, 2013 in United States for Office
Question 2: Now write the code to solve this problem. What are the time and space complexities?| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test Algorithm Arrays Data Structures Debugging Microsoft Testing - 1of 1 vote
AnswersGiven a string, find the start position of the largest block of repeated charactes.
- hnrqbaggio January 24, 2013 in United States for Office
After the solution, I was asked to write down as many test cases I could to test the function as if it was created by someone else.| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test Algorithm Microsoft String Manipulation Testing - 1of 1 vote
AnswersGiven two arrays of ints that are sets, create a function to merge them to create a new set.
- hnrqbaggio January 24, 2013 in United States for Office
A set must pass on these three conditions:
- All values are positive
- Sorted
- Non-duplicates| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test Algorithm Arrays Data Structures Debugging Microsoft - 0of 0 votes
AnswersTell me if a array of integers is a set.
- hnrqbaggio January 24, 2013 in United States for Office
A set must pass on these three conditions:
- All values are positive
- Sorted
- Non-duplicates
After the first solution, I was asked about time and space complexity and to create 5 test cases for my function.| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test Algorithm Arrays Data Structures Debugging Microsoft - 1of 1 vote
Answersdesign Malloc Function which user can call and get the allocation. For example, there is a Byte array of byte[1000] so if use call getAllocation(3) then we will assign 3 bytes to user. and again if another user call getAllocation(100) then we will assign again,
- Andy2000 December 22, 2012 in United States for STB| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test Algorithm - 11of 11 votes
AnswersReverse word in the string
- williamqp December 08, 2012 in United States| Report Duplicate | Flag | PURGE
Amazon Software Engineer in Test - 0of 0 votes
AnswersFind the least common ancestors for two tree node. Given the parent point.
- williamqp December 08, 2012 in United States| Report Duplicate | Flag | PURGE
Amazon Software Engineer in Test - 0of 0 votes
AnswersGiven two arrays, array1 and array2
- williamqp December 08, 2012 in United States
using the rule of array1 to sort array2.
Ex.
array1 = { B, A, C}
array2 = {A, B, A, C, A, B, B, C, A}
output: sortedArray2 = {B,B,B,A,A,A,A,C,C}
What if array2 existed some element not existed in Array1? Can you put it in the end? and sorted by alphabetical? What if array have lower case and upcases letter?| Report Duplicate | Flag | PURGE
Amazon Software Engineer in Test Algorithm - 1of 1 vote
AnswersPrint a binary tree in vertical order using singly linked list...complexity should be O(n)
- Nueman December 02, 2012 in India| Report Duplicate | Flag | PURGE
Groupon Software Engineer in Test Data Structures - 0of 0 votes
AnswersFind the union of non-overlapping ranges,
- shaik November 25, 2012 in India
e.g; given an array {0,3,1,5,7,9,8,13} where 0 is starting point and 3 is the end point and so on.
The output should be {0,5,7,13}| Report Duplicate | Flag | PURGE
Amazon Software Engineer in Test Java - 0of 0 votes
Answersimplement hasNext() and next() methods like the Java collection iterator's, but hasNext() checks if collection has negative value only, and next() only return negative (assume collection has intergers)
- chen November 22, 2012 in United States for Ads| Report Duplicate | Flag | PURGE
Google Software Engineer in Test Algorithm - 0of 0 votes
AnswersWrite positive test cases to test this function
- siva November 09, 2012 in India for Bing
bool FileCopy(string source, string destination)| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test Testing - 0of 0 votes
AnswersDesign an algorithm to find the least common ancestor of two nodes in a Binary tree(Note: Its not a binary search Tree)
Node Structure is given as
- teja.sbt November 07, 2012 in United States for KindleClass Node{ int data; Node leftchild; Node Rightchild; }
| Report Duplicate | Flag | PURGE
Amazon Software Engineer in Test Algorithm - 0of 0 votes
Answersint match(string input, string pattern)
- Lucas October 31, 2012 in United States
input= input string
pattern = pattern that we are looking for in a string.
The pattern can contain * wild char which atleast matches 1 char, that is A*B doesnt match AB.
return = index of start of first such sequence .| Report Duplicate | Flag | PURGE
Software Engineer in Test Algorithm - 1of 1 vote
AnswersString getSentence(String text, Set<String> dictionary);
- Vincent October 29, 2012 in United States
// text is a string without spaces, you need to insert spaces into text, so each word seperated by the space in the resulting string exists in the dictionary, return the resulting string
// running time has to be at least as good as O(n)
// getSentence("iamastudentfromwaterloo", {"from, "waterloo", "hi", "am", "yes", "i", "a", "student"}) -> "i am a student from waterloo"| Report Duplicate | Flag | PURGE
Twitter Google Software Engineer / Developer Software Engineer in Test Algorithm - 1of 1 vote
AnswersThere is a given linked list where each node can consist of any number of characters :- For example
- vibsy October 25, 2012 in India
a-->bcd-->ef-->g-->f-->ed-->c-->ba.
Now please write a function where the linked list will return true if it is a palindrome .
Like in above example the linked list should return true| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Software Engineer in Test Data Structures - 1of 1 vote
AnswersWAP to print the node values of a binary tree
- yakku October 22, 2012 in United States
- Even level starting from right to left
- Odd level starting from left to right
Assume that level of root is 1.
a
b c
d e f g
Output: a c b d e f g| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test Algorithm - 0of 0 votes
AnswersAssume you have a integer matrix (m x n) sorted over column wise & row wise. WAP to find the kth smallest element from the matrix.
- yakku October 22, 2012 in India
E.g.
int[][] a =
2, 5, 8, 10
4, 7, 9, 12
6, 15, 20, 22
So 5th smallest element is: 7| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test Algorithm - 1of 1 vote
AnswersWrite code to sort an integer array of size N which has only three unique values 0,1,2 duplicated & randomly placed over the entire array.
- yakku October 22, 2012 in India
- Memory used should be O(1)
- Run time should be O(N)| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test Algorithm - 1of 1 vote
AnswersAssume that a binary tree is drawn over a Cartesian coordinate system (with X & Y axis) where the leftmost node is placed at point (0,0). So, we need to traverse the nodes and print in following manner:
- yakku October 22, 2012 in India
For e.g., for this tree
a
b c
d e f g
Output should be:
d,0,0
b,1,1
e,2,0
a,3,2
f,4,0
c,5,1
g,6,0| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test Algorithm - 0of 0 votes
AnswersSort an array of characters in linear time complexity (and linear space complexity if that's possible).
- jeanclaude October 17, 2012 in United States for Kindle| Report Duplicate | Flag | PURGE
Amazon Software Engineer in Test Sorting - 1of 1 vote
AnswersGiven a sum find(print) all 2 numbers and their index positions from an un-ordered array that add up the sum value. 1 4 4 3 7 5 8 as array and sum =8 .
- M October 06, 2012 in United States for Server tools division
So here the code should print 1 (index 0) + 7(index 4)
4(index 1)+ 4(index2), and so on..| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test - 1of 1 vote
AnswersHow do you test a Calendar? (eg. An outlook calendar or google calendar)
- M October 06, 2012 in United States for Server tools division| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test Testing - 0of 0 votes
AnswersGiven two lists sorted in increasing order, create and return a new list representing the intersection of the two lists. The new list should be made with its own memory — the original lists should not be changed.
- soni vashisht September 30, 2012 in United States
For example, let the first linked list be 1->2->3->4->6 and second linked list be 2->4->6->8, then your function should create and return a third list as 2->4->6.| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test Algorithm - 0of 0 votes
AnswersGiven two numbers represented by two lists, write a function that returns sum list. The sum list is list representation of addition of two input numbers ?
- soni vashisht September 30, 2012 in United States
Example First List: 5->6->3 // represents number 365
Second List: 8->4->2 // represents number 248
Resultant list: 3->1->6 //
Note :Any Carry forward should also be added as the new node . Any Comments on the code below| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test Algorithm