Google Interview Question for Software Engineer / Developers


Country: India




Comment hidden because of low score. Click to expand.
19
of 19 vote

A: min(max of rows)
B: max(min of columns)

------------------------------------------
                           |      |
------------------------------------------
A                          |   X  |
------------------------------------------
                           |      |
------------------------------------------
                           |      |
------------------------------------------
                           |   B  |
------------------------------------------

X>=B, since B is min of the column
A>=X, since A is max of the row
Therefore, A >=X>=B ==> A>=B

- RedMouse August 01, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

Good complement to the upvoted answer.

- Anonymous August 01, 2012 | Flag
Comment hidden because of low score. Click to expand.
8
of 8 vote

Consider the intersection element.

Min (Max elements of row) >= the intersection element >= Max(Min of columns).

- Anonymous August 01, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

Right.

- Anonymous August 01, 2012 | Flag
Comment hidden because of low score. Click to expand.
1
of 1 vote

you can explain like 2D matrix{ max(row1,roww2,row3,row4) = min(col1,col2,col3,col4)}

- kamal suthar August 01, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Let us assume "min(max of rows) ==> minR is less than max(min of columns) ==>MaxC" --- (1),
Now let MaxC is from the jth column of matrix A and MinC is from the ith row of matrix A. Then all the elements along column j must be > MaxC which implies A[i][j] > MaxC and from (1) we know MaxC > minR ==> A[i][j] > minR, which is not possible. this contradicts our supposition.
Hence minR is not less than maxC.

- Alzheimer August 01, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

I cant understand the problem...Can someone please explain what the problem is???

- Varadh September 24, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

[[a,b,INFY], [a,b,INFY], [a,b,INFY]] .. this is a counter example, obviously :P

- random_coder October 16, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

True.Consider an array sorted by rows and columns. Min entries of columns would occur in the first row. The maximum of these values would be (0,matrix[0].length-1). However, this value would also be the smallest entries across the maximum entries in each row (these entries would occur in column mat.length-1).

- divm01986 September 15, 2015 | Flag Reply
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
0
of 0 votes

provided both rows and columns are sorted

- cobra August 01, 2012 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

It is exactly the one of the convention for determining saddle point of a 2-d array/matrix.....!!

- souro August 02, 2012 | Flag


Add a Comment
Name:

Writing Code? Surround your code with {{{ and }}} to preserve whitespace.

Books

is a comprehensive book on getting a job at a top tech company, while focuses on dev interviews and does this for PMs.

Learn More

Videos

CareerCup's interview videos give you a real-life look at technical interviews. In these unscripted videos, watch how other candidates handle tough questions and how the interviewer thinks about their performance.

Learn More

Resume Review

Most engineers make critical mistakes on their resumes -- we can fix your resume with our custom resume review service. And, we use fellow engineers as our resume reviewers, so you can be sure that we "get" what you're saying.

Learn More

Mock Interviews

Our Mock Interviews will be conducted "in character" just like a real interview, and can focus on whatever topics you want. All our interviewers have worked for Microsoft, Google or Amazon, you know you'll get a true-to-life experience.

Learn More