Bloomberg L.P.

www.bloomberg.com
Employer Engaged

Interview Question

Financial Applications Engineer Interview(Student Candidate)

Given a matrix where all columns and rows are sorted and an

  integer k. How would you find k in the matrix?
Answer

Interview Answer

2 Answers

0

Compare k to the center of the matrix. Depending on the result, disqualify either the top left quadrant or the remaining quadrants. Recurse on the remaining quadrants.

Interview Candidate on Mar 23, 2013
0

Binary search

Xiaoge Su on Jul 15, 2013

Add Answers or Comments

To comment on this, Sign In or Sign Up.