Software engineer in test Interview Questions | Glassdoor.co.in

Software engineer in test Interview Questions

213

software engineer in test interview questions shared by candidates

Top Interview Questions

Sort: RelevancePopular Date

Assume a matrix of integers they are sorted in boh row and column vice .. how do u find a given number from the matrix in a optimal way?

10 Answers

Let the matrix is n*m matrix. Then O(n log m) solution is trivial (binary search in each row). There is a easy O(n+m) solution too. The idea is to start from upper right corner (mat[0][m-1]) and traverse toward lower left corner (mat[n-1][0]). On the way check each entry and depending on whether larger go left or down. If there is a solution you will find it on the way. Or you will arrive to a point where you can no longer move without going out of the matrix. Either way you will check at most O(n+m) entries thus the solution in O(n+m).

I think it could be done even better than in O(n+m). Instead of starting at the upper right corner do a binary search on last column and find the biggest element that is still smaller than the given number. Say it's gonna be A[i, m-1]. Now we could throw away all rows up to an including i (since A[i, m-1] is larger than all of these elements) and the last column. Repeat everything for a smaller matrix of size (n - i, m - 1);

To elaborate a little on dp's idea and add my take on it I would do a binary search on the last column to find the interval where the number is in. This interval will be one row within the matrix (assuming the value is not in the last column) and to find the interval should be O(log n). Then I would do a binary search on the row that remains which should cost O(log m). Combined that would be O(log n) + O(log m). Let me know what you guys think of this solution.

pgm for string length? and explain each part. of program.

3 Answers

Public int compareTo(object o) { Employee emp = (Employee)o; return this.id - e.id; }

3 Answers

Do you know programming? If so, demonstrate the problem given.

3 Answers

One or more comments have been removed.
Please see our Community Guidelines or Terms of Service for more information.

1. What is the testing process in your previous company? 2. Difference between Build and Release

1 Answer

Generic questions from selenium, Java, mobile automation, framework etc..

1 Answer

High level design for a system with few features

1 Answer

Write a program to reverse string containing special characters with their position retained after reversal

1 Answer

What is parent interface of WebDriver is it extended or implemented

1 Answer

Selenium - system test to login into web application with combination of username and password reading excel

1 Answer
110 of 213 Interview Questions