SDET Interview Questions
- 0of 0 votes
AnswersA 2d array has 0 and 1 as values. In one flip, 0's are changed to 1 if and only if any of the neighbors (left, right, top, bottom) is 1. Return the total number of flips required to convert the whole grid to 1's
- abhi.mathur.us February 11, 2020 in United States| Report Duplicate | Flag | PURGE
Amazon SDET - 0of 0 votes
Answershow would you debug a tablet with a part of its touch screen is broken.
- rakshith18n December 31, 2018 in United States| Report Duplicate | Flag | PURGE
Amazon SDET - -3of 3 votes
AnswersRemove '_' and print with 1 space separated string from "Amazon_w_e_b_services are___widely__used_acc__ro___ss_the_worl_d", output should be : Amazon web services are widely used accross the world.
- email6689 February 20, 2018 in India for kindle| Report Duplicate | Flag | PURGE
Amazon SDET - 1of 1 vote
AnswersGive all n cities the distance between them, and then you have to follow all the cities in the order of small to large index of the city, which means you must visit the cities in ascending order, and now you can choose not to visit k cities (k < n), ask choose not to go to which k cities can make the path shortest? Return the shortest journey.
- ajay.raj November 30, 2017 in United States
int findShortestPath(int[][] matrix, int k){
}| Report Duplicate | Flag | PURGE
Google SDET - 0of 0 votes
AnswersWrite all the possible numbers returned from a calculator pad where a start number move in a L direction in any directions(1-2moves)
- wingchuihk November 08, 2017 in United States
ie. From calculator pad. Start from 8 --> go in L shape (2up, 1right), and it returns 3
ie. Start from 2, (move 2 down, 1 left), it will be 7
ie. Start from 2(move 2 down, 1 right), it will be 9
ie. Start from 7(move 1 left, 2 up), it will be 2
ie. Start from 7(move 1 up, 2 left), it will be 6| Report Duplicate | Flag | PURGE
Google SDET Java - 0of 0 votes
AnswersGiven a string s, break s such that every substring of the partition can be found in the dictionary.
- ajay.raj November 05, 2017 in United States
Return the minimum break needed.
Example
Given a String CatMat
Given a dictionary ["Cat", "Mat", "Ca", "tM", "at", "C", "Dog", "og", "Do"]
return 1
we can break the sentences in three ways, as follows:
CatMat = Cat Mat break 1
CatMat = Ca tM at break 2
CatMat = C at Mat break 2
but the first way has the minimum break, thus return 1
public int wordBreak(String s, Set<String> dict) {
// Write your code here
}| Report Duplicate | Flag | PURGE
Facebook SDET - 0of 0 votes
AnswerGive a vote list = [(a, 100), (b, 150), (a, 200)] # (name, timestamp) and time T
- ajay.raj November 03, 2017 in United States
Find the highest number of votes (or anyone with the highest number of votes) at T
ex: T = 100 -> a, T = 150 -> a or b, T = 200 -> a
followup1, give one more input K, find Top K votes at T
followup2, the same vote list, K, but given the Top K votes list, find the time T.| Report Duplicate | Flag | PURGE
Google SDET - 1of 1 vote
Answersgiven an array of strings and characters, make the largest string possible.
- ajay.raj October 02, 2017 in United States
The resultant string should be a combination of the strings given in the array.
The given array
of characters may contain repeated elements.
Example – Given char array – {a,a,b,c,d,d,e,c} and given strings
– {abba, aabc, de, cde} the
ans is aabccde| Report Duplicate | Flag | PURGE
Facebook SDET - 0of 0 votes
AnswersGot Sp00ked by MS simple question..
- hprem991 August 29, 2017 in United States
Eight Ball problem, find Minimum steps to determine the heaviest one.
Anyone know the answer is 2 in case of 8 balls.. Question is code getHeavy when number of balls are not determined.
int getHeavy(List<Integer> balls){
// Your solution
}| Report Duplicate | Flag | PURGE
Microsoft SDET - 0of 0 votes
AnswersWrite second most repeating word in a string
- hello world June 28, 2017 in United States
eg aaa bbb ccc aaa bbb aaa
answer - bbb| Report Duplicate | Flag | PURGE
Amazon SDET - 1of 1 vote
AnswersGiven an unsorted array, sort it in such a way that the first
- ajay.raj April 06, 2017 in United States
element is the largest value, the second element is the smallest,
the third element is the second largest element and so on.
[2, 4, 3, 5, 1] -> [5, 1, 4, 2, 3]
can you do it without using extra space
public void sortAlternate(int[] nums){}| Report Duplicate | Flag | PURGE
Facebook SDET - 1of 1 vote
Answers/*
- kumar March 03, 2017 in United States for Advertisement
* Please come up with Class and Data Structure Design for a "metric" system to determine the top song of a
* band. Two Web Service calls
*
* void play(String bandname, String songname);
* String topSong(String bandname);
*/
// play("Lady Gaga", "Pokerface");
// play("Lady Gaga", "Pokerface");
// play("Lady Gaga", "Alejandro");
// play("Bruno Mars", "Treasure");
// topSong("Lady Gaga") -> "Pokerface"| Report Duplicate | Flag | PURGE
Amazon SDET - 2of 2 votes
Answersfind first not-repeating character by iterating through the length of the string only once and by using constant space.
- Raj October 28, 2016 in United States| Report Duplicate | Flag | PURGE
Amazon SDET Algorithm - 0of 0 votes
Answer1. If I say quick sort takes O(e^n ) on the average, would I be wrong?
- NoOne October 21, 2016 in India
2. Do you think O( f ) is a good idea for real engineering?
3.Given a choice, what other 'order of' measure would you propose to use ?
4. Do you see a real problem with the modified *order of* ?
5. If you were to sort 10 elements, what sorting method would you have used?
6. If you were to sort 1 trillion unicode characters, what sorting method you would have used?| Report Duplicate | Flag | PURGE
Microsoft SDET Algorithm Math & Computation - 0of 0 votes
AnswersThe actual problem from question?id=6289136497459200
Implement pow, with :// Assume C/C++, as of now double pow ( double x, double power )
No library functions allowed.
Should return : x^power
=== Edit ===
People took it a bit trivially, thus examples should help :
- NoOne October 20, 2016 in United Statesx = pow ( 4, 0.5 ) // x = 2.0 x = pow ( 8, 0.333333333 ) // 1.99999999986137069 x = pow ( 10.1 , 2.13 ) // 137.78582031242644
| Report Duplicate | Flag | PURGE
Microsoft SDET Algorithm - 0of 0 votes
AnswersAs you guys know, C did not have,and does not have anything called class. C++ has them. Now, C++ was written using C. In fact, C++ initially was called C with classes.
- NoOne October 14, 2016 in India
Thus, here is the problem for you.
Given you have C, and you need to implement class like behaviour, how you would do it? Specifically, implement the following in C :
1. A Simple Hello class with hello() function printing "Hello, World" .
2. A new operator which enables creating this constructor less class.
3. A delete operator that deletes the pointer.
How would you do it?| Report Duplicate | Flag | PURGE
Deshaw Inc SDET C - 0of 0 votes
AnswersLinux has this nice command called *tree*.
- NoOne October 14, 2016 in India
If you did not use it, please take a look around.
You do not have to write one. BUT, you have to do something similar. Given a file name ( not a path ), and an initial directory, you have to list all the file paths, which matches the file name, case should not be considered.
Also allow regex match.
Again, the problem is non trivial.
It was expected to ask the right questions.| Report Duplicate | Flag | PURGE
SDET Algorithm Operating System - 0of 0 votes
AnswersThere is this nice tiny *nix utility called *wc*.
The idea here is :wc file_name
prints :
- NoOne October 14, 2016 in India
character count of the file.
Word count of the file.
Line count of the file.
You have to implement your own *wc* program.
NOTE: The problem is non trivial for 3 reasons.
It was expected to ask about the non triviality.| Report Duplicate | Flag | PURGE
SDET Algorithm Operating System - 0of 0 votes
AnswersNone actually understands how garbage collection works, albeit people ask this in the interviews. Nonetheless, we are going to ask you something very similar. Here is the problem.
Take an array of bytes, perhaps 1MB in size.
Implement these two operations:ptr_structure = alloc ( amount_of_storage ) freeed = free ( ptr_structure )
Now, here is your problem. alloc must allocate contiguous storage. If it is not possible, you need to compact ( defragment ) memory. So, you need to implicitly write a :
defragment() // defragments memory
Worse is coming. Even imagining you have written a stop the world defragmenter, after you reallocate, how the ptr_structures would actually work?
- NoOne October 14, 2016 in India
Solve this whole problem.
Time allocated was 1 hour. Face to face, panel with 2 interviewers.| Report Duplicate | Flag | PURGE
SDET Algorithm Assembly Computer Architecture & Low Level Computer Science Data Structures - 0of 0 votes
AnswersImagine there are brick boulders, all of integer size.
Their sizes are stored in an array.
The figure looks something like this :
peltiertech.com/Excel/pix2/Histogram2.gif
Now, suppose someone is pouring water into it till water starts spilling.
You have to answer how much water the boulders are holding up.
- NoOne October 14, 2016 in Indiadef water_holding( arr ) { /* answer this */ }
| Report Duplicate | Flag | PURGE
Deshaw Inc SDET Algorithm - 0of 0 votes
AnswersXPATH implementation problem.
- NoOne October 14, 2016 in India
Here is the problem.
Implement XPATH expressions, given there is a DOM tree :
1. $x('//*[text() = "abc"])
How do you think it is implemented? Write code, imagine you have a general purpose tree.
2. $x('//span[text() = "abc"])
How do you think it is implemented? Write code, imagine you have a general purpose tree.
Now, explain which one would be faster, and why?
Explain from the design and the code you have written.| Report Duplicate | Flag | PURGE
SDET Algorithm Application / UI Design - 0of 0 votes
AnswerAs you know, every OS comes up with this tiny application called the calculator. It is good. Now, here is our problem. If we try to implement the function
def calculate( operand, operator, operand ) { /* Do Interviewers bidding here */ }
I have to write if upon if upon if upon if to do for all operators. Moreover, some operators are not even binary! Take example the abs() or say the negate()!
- NoOne October 14, 2016 in India
Bigger problem persists. With the if mode, we can not even add operators as we wish to without changing code!
But that is a sin. So, what do we do? That is question 1.
In question 2, as a software tester, how do you propose to test and automate the above? Writing more if than the developer is not allowed.| Report Duplicate | Flag | PURGE
SDET Algorithm Data Structures Object Oriented Design Programming Skills Software Design - 0of 0 votes
AnswersWe all know databases are very very slow. In fact they are so slow that very serious people who wants to do volumes of read operation and search operations write their own implementation. In this question, you would be asked to do the same, for a very limited operation - select.
Every item stored has this field called timestamp.
Now, here is the problem you need to solve :select items where time < some_time select items where time < some_time and time < another_time select items where time > some_time
Imagine you have millions of data rows. How to store it in HDD, and how to load, entirely your problem. None is going to insert anything on existing data - only read.
- NoOne October 14, 2016 in India
Write an algorithm that solves this problem, and a data structure that works as storage for the data.| Report Duplicate | Flag | PURGE
SDET Algorithm Database - 0of 0 votes
AnswersImagine you are given the instructions :
GOTO <LABEL> WHEN <CONDITION> NOP ; no operation
Implement the following using it:
- NoOne October 14, 2016 in India
1. If condition.
2. If else condition.
3. If else if else condition.
4. While loop
5. for loop.| Report Duplicate | Flag | PURGE
SDET Assembly - 0of 0 votes
AnswersGiven brackets, e.g. '(' and ')' as the only symbols, write a function that would generate : true, if the brackets are matching, false if the brackets are not matching.
- NoOne October 14, 2016 in India
Almost everyone can do the above.
Now, prove that it works.
Also tell which class of grammar the string belongs to.
Showcase why your algorithm is a language recogniser for the same.| Report Duplicate | Flag | PURGE
SDET Automata - 0of 0 votes
AnswersYou are given 20 questions to solve in 20 minutes.
- NoOne October 14, 2016 in India
If you successfully solve the question, you would receive 2 marks.
If you failed to solve the question, and you do not try it ( let it untouched ) , you would receive 0 marks. If you solve it wrong ( i.e. not the correct answer ) - you would receive -1 ( negative) .
With the story, here are the problems:
1. Write an algorithm, which, given an input array ( set ) of questions, and varying probability ( 0 <= p <= 1 ) of can do and can not do per question, generates a strategy for solving the paper to generate maximum expected pay off.
2. Given the question paper is multiple choice, between 4 choices ( a,b,c,d ) do a bias analysis ( e.g. if more a's are coming than 'c's ), and decide if you would like to probabilistically take risk and mark some to increase pay off.
Obviously, you can get a maximum 40, and a minimum -20.
3. Now, put yourself in the position of the examiner, and try to ensure it is almost impossible to increase payoff by random selection over the questions. Try to negate the bias. That is question 3.
In all 3 cases write an algorithm. Face to face interview, time allocated was 60 minutes. Panel Interview.| Report Duplicate | Flag | PURGE
unknown SDET Algorithm - 3of 3 votes
AnswersGiven two sorted lists and an integer k, merge the lists up to a maximum of k elements.
- codebrkr September 15, 2016 in United States| Report Duplicate | Flag | PURGE
Amazon SDET - 1of 1 vote
AnswersGiven two sorted lists (or arrays) and a number k, create an algorithm to fetch the least k numbers of the two lists.
- codebrkr September 15, 2016 in United States| Report Duplicate | Flag | PURGE
Amazon SDET - 0of 0 votes
Answerstest plan for gmail login screen.areas you test.tools you use,test cases and estimated time.
- royalprince September 02, 2016 in United States| Report Duplicate | Flag | PURGE
Amazon SDET - 0of 0 votes
Answershow do you test google translate.test plan.different types of testing and testcases
- royalprince September 02, 2016 in United States| Report Duplicate | Flag | PURGE
Amazon SDET