## Google Interview Question for Software Engineer / Developers

• 0

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

Comment hidden because of low score. Click to expand.
0

Good complement to the upvoted answer.

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).

Comment hidden because of low score. Click to expand.
0

Right.

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)}

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.

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???

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

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).

Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
0

provided both rows and columns are sorted

Comment hidden because of low score. Click to expand.
0

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

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.

### 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.