Bloomberg L.P. Interview Question: Given a matrix where all colu... | Glassdoor

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?

Interview Answer

2 Answers


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

Binary search

Xiaoge Su on Jul 15, 2013

Add Answers or Comments

To comment on this, Sign In or Sign Up.