Software Engineer in Test Interview Questions
- 0of 0 votes
AnswersGiven a sorted integer array and a number, find the start and end indexes of the number in the array.
- bvinay84 July 11, 2013 in United States
Ex1: Array = {0,0,2,3,3,3,3,4,7,7,9} and Number = 3 --> Output = {3,6}
Ex2: Array = {0,0,2,3,3,3,3,4,7,7,9} and Number = 5 --> Output = {-1,-1}
Complexity should be less than O(n)| Report Duplicate | Flag | PURGE
Linkedin Software Engineer in Test Algorithm - 0of 0 votes
AnswersIn order to print all the nouns and verbs present in a given book, what is the underlying algorithm you see to achieve this problem? Discuss the pros and cons of your choice and also how would you test this method. You may assume that the system already knows what are nouns and verbs.
- Jeanclaude July 09, 2013 in United States| Report Duplicate | Flag | PURGE
Accenture Software Engineer in Test - 3of 3 votes
AnswersIn a given array a = {1, 7, 3, 4, 5, 6, 2} Print the indices of all the combinations which lead to a given sum called target. For e.g. if the method is
- Jeanclaude July 09, 2013 in United States
Void PrintAllSumCombos(int[] arr, int target) - and the array shown above is passed with sum target = 7, then the output should be:
0, 3, 6
0, 5
1
2, 3
4, 6
Note: For simplicity, You may assume the array does not contain any negative numbers and also consider same set of indices with a different order as identical - for e.g. if 2, 3 is already printed, ignore 3, 2 as they are one and the same.| Report Duplicate | Flag | PURGE
Accenture Software Engineer in Test Arrays - 2of 2 votes
AnswersThe object of this exercise is to fix 3 known issue with the existing code, and add a new feature to the tool.
- Purushotham Kumar July 05, 2013 in Ireland for CPL Recruitment Team @Microsoft
The known issues to address are:
· The current implementation of the tool incorrectly ignores white space (spaces and tabs) between words, which is a bug. Modify the code so that white space differences are correctly detected
· Tool doesn't report difference if second file is larger than first file
· For large input files the tool consumes considerable RAM. Modify tool to address this performance bug
The new feature to implement is:
· Add a new command line switch -i and functionality to allow case-insensitive comparison
Running the tool requires you to supply 2 command line arguments – these will be the paths to 2 text files that should be compared. You are responsible for creating this test data.
/*
* New Requirement:
* - Add a new command line switch -i and functionality to allow case-insensitive comparison.
*
* Issues to fix:
* - The current implementation of the tool incorrectly ignores white space (spaces and tabs) between words, which is a bug.
* Modify the code so that all white space differences are correctly detected and reported along with differences in words.
* - Tool doesn't report difference if second file is larger than first file.
* - For large input files the tool consumes considerable RAM. Modify tool to address this performance bug.
*
* Please ensure you include all test files that you create for each of your test cases along with your submission.
*/
namespace CsDiff
{
using System;
using System.Collections.Generic;
using System.IO;
class Program
{
static void Main(string[] args)
{
if (!ProcessArgs(args))
{
return;
}
using (FileReader sourceFile = new FileReader(args[0]))
using (FileReader targetFile = new FileReader(args[1]))
{
IEnumerator<string> sourceEnum = sourceFile.Words.GetEnumerator();
IEnumerator<string> targetEnum = targetFile.Words.GetEnumerator();
for (int word = 1; sourceEnum.MoveNext() && targetEnum.MoveNext(); word++)
{
if (sourceEnum.Current != targetEnum.Current)
{
Console.WriteLine("Difference at position {0}: '{1}' different to '{2}'",word,sourceEnum.Current, targetEnum.Current);
}
}
}
}
static bool ProcessArgs(string[] args)
{
if (args.Length != 2)
{
Console.WriteLine("Please specify [source] and [target] file paths");
return false;
}
for (int arg = 0; arg <= 1; arg++)
{
if (String.IsNullOrEmpty(args[arg]) || !File.Exists(args[arg]))
{
Console.WriteLine("File '{0}' not found", args[arg]);
return false;
}
}
return true;
}
}
public class FileReader : IDisposable
{
string[] words;
public FileReader(string path)
{
string fileData = File.ReadAllText(path);
words = fileData.Split(new char[] { ' ', '\t' });
}
public IEnumerable<string> Words
{
get
{
return this.words;
}
}
public void Dispose()
{
}
}
}| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test - 2of 2 votes
AnswersIn an array of unsorted integers (you may assume the array may contain +ve, -ve and 0s), write a function
- Jeanclaude June 28, 2013 in United States
int returnNthMax(int[] arr, int n)
which will return the nth Max number. For e.g. if this is given array {2, -4, 5, 6, 0, 7, -1, 10, 9} and n=1, it should return the max number, 10 and if n=3, it should return 3rd max number, which is: 7.| Report Duplicate | Flag | PURGE
Amazon Software Engineer in Test Arrays - 1of 1 vote
AnswersGiven an mxn matrix, design a function that will print out the contents of the matrix in spiral format.
Spiral format means for a 5x5 matrix given below:[ 1 2 3 4 5 ] [ 6 7 8 9 0 ] [ 1 2 3 4 5 ] [ 6 7 8 9 0 ] [ 1 2 3 4 5 ] path taken is: [ > > > > > ] [ > > > > v ] [ ^ ^ > v v ] [ ^ ^ < < v ] [ < < < < < ] where ">" is going right, "v" going down, "<" is going left, "^" is going up.
The output is:
- masrur.macece June 26, 2013 in United States for Windows Hyper-V1 2 3 4 5 0 5 0 5 4 3 2 1 6 1 6 7 8 9 4 9 8 7 2 3
| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test Algorithm - 0of 0 votes
AnswersOpen two instances of Microsoft Word and print to printer simultaneously. How would the underlying printer driver work? How would you design the printer driver?
- masrur.macece June 26, 2013 in United States for Windows Hyper-V| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test Computer Architecture & Low Level - 0of 0 votes
AnswersDesign an algorithm to find all the nouns and verbs present in a book. Discuss and explain your decision as to why you chose that algorithm.
- Jeanclaude June 21, 2013 in United States| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test - 0of 0 votes
AnswersPrint the actual phone number when given an alphanumeric phone number. For e.g. an input of 1-800-COM-CAST should give output as 18002662278 (note: output also does not contain any special characters like "-").
- Jeanclaude June 16, 2013 in United States for Windows Phone| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test Hash Table - 13of 19 votes
AnswersWrite a program to find whether a given number is a perfect square or not. You can only use addition and subtraction operation to find a solution with min. complexity.
- Purushotham Kumar June 12, 2013 in Ireland
i/p : 25
o/p : True
i/p : 44
o/p: False| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test - 0of 0 votes
AnswersHow to read a large file efficiently in java
- zammer June 12, 2013 in India for QA| Report Duplicate | Flag | PURGE
Software Engineer in Test - 0of 0 votes
AnswersWrite a program to reverse a sentence in a zigzag order.
- Purushotham Kumar June 09, 2013 in Ireland
i/p: I am a software programmer
o/p: programmer erawtfos a ma I| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test - 1of 1 vote
AnswersFind the first non repeating character in a given string. You may assume that the string contains any character from any language in the world, for e.g. an Arabic
- Jeanclaude June 09, 2013 in United States for Windows Phone
or Greek character even.| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test String Manipulation - -1of 3 votes
Answerswrite a sample code to find no of 'a' words in a sentence?
- raghuram2404 June 07, 2013 in India
Eg: If a sentence is given as "I found an apple in a tree."
The output is : 1 (not 2)
We have to count no of words.| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test Algorithm - 2of 4 votes
AnswersGiven two sorted arrays, find the median of each array. The length of the arrays are m and n and we should not use extra buffer. We should find the median and time complexity should be less than 0(M+N);
- alregith June 02, 2013 in India for Chennai| Report Duplicate | Flag | PURGE
Amazon Software Engineer in Test Data Structures - 0of 0 votes
AnswersMerge the given 2 input sorted arrays of numbers into one . The merged array stays sorted .
- meek May 31, 2013 in United States| Report Duplicate | Flag | PURGE
Amazon Software Engineer in Test Arrays Java Problem Solving Sorting - 0of 0 votes
AnswersA stirng is represented using a linked list how will you find if it the string is palindrom.
- rawat011 May 31, 2013 in India| Report Duplicate | Flag | PURGE
Amazon Software Engineer in Test SDE1 Algorithm - 0of 0 votes
AnswersThere is an server which has infinite number of services s1, s2, s3,....Also there is a priority attached to it. There is one to one mapping between the services and priorities. The following mapping is stored by the server.
- rawat011 May 31, 2013 in India
p1 --> S1
p2 --> s2
p3 --> s3
p4 --> s4
p5 --> s5
p6 --> s6
.
.
.
infinite
Whenever a user logs in to the system, it assigns a service with lowest priority available to it.
Whenever a user logs out of the system, service is returned to the pool of free services.
a. What is the datastructure that you will use to store these services. You dont have to store the mapping. Mapping is already stored in the system.
b. Can you write the code for it.
c. How will you go about writing automation framework to test it
Please let me know if anyone need any more info about the question| Report Duplicate | Flag | PURGE
Amazon Software Engineer in Test Algorithm - 5of 5 votes
AnswersIf a linkedlist is having loop, how to find the last node of the loop .
- zammer May 28, 2013 in India for SDET| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test Algorithm - -4of 4 votes
AnswersA large character array is there in which there are spaces in between the character like ab c d ...etc
- zammer May 28, 2013 in India for SDET
Write a method to search any character in the above array in O(n).| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test Algorithm - 2of 2 votes
AnswersProblem: you are given 2 words with equal number of characters. Find an algorithm to go from first word to second word, changing one character at each step, in such a way that each intermediate word exist in a given dictionary.
- EugenDu May 24, 2013 in United States
Example:
Words are pit, map. A possible solution:
pit, pot, pet, met, mat, map| Report Duplicate | Flag | PURGE
Ebay Software Engineer in Test Algorithm - 0of 0 votes
AnswersWrite a function to evaluate a string that has only integers, and operators '+' & '*'. The evaluation should be done in a single pass. For example passing "3*2+5*6" should result in this function returning 36.
- jyothiprasadb May 21, 2013 in United States| Report Duplicate | Flag | PURGE
Expedia Software Engineer in Test Coding - -1of 1 vote
AnswersWrite a function fix a loop in the linked list based on the assumption that the linked list is sorted.
- jyothiprasadb May 21, 2013 in India| Report Duplicate | Flag | PURGE
Expedia Software Engineer in Test Coding - 0of 0 votes
AnswersWrite a function to find a key in Hash map if the value associated to that key is given as input. As a followup, swap key & value assuming that value is not equal to any of the existing keys.
- jyothiprasadb May 21, 2013 in India| Report Duplicate | Flag | PURGE
Oracle Software Engineer in Test Java - 0of 0 votes
AnswersWrite a function to perform string replace without using any inbuilt functions.
- jyothiprasadb May 21, 2013 in India| Report Duplicate | Flag | PURGE
Oracle Software Engineer in Test Coding - 1of 1 vote
AnswersCode to check if a given short string is a substring of a main string. Can you get a linear solution (O(n)) if possible?
- Jeanclaude May 18, 2013 in United States for Office| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test String Manipulation - -2of 2 votes
AnswersWhat is system.gc() and runtime.gc() ?
- zammer May 16, 2013 in India for SDET| Report Duplicate | Flag | PURGE
Expedia Software Engineer in Test Java - 1of 1 vote
AnswersWhich will take less time to retrieve the data if numbers are present in hashmap and sorted array .
- zammer May 16, 2013 in India for SDET| Report Duplicate | Flag | PURGE
Expedia Software Engineer in Test Algorithm