Search
⌘K

Leetcode 704. Binary Search

Given a sorted (ascending) array of unique integers and a target value, return the index of the target or -1 if not present; the solution must run in O(log n) time (i.e., implement binary search).

Asked at:

Amazon

Amazon

Google

Google

Meta


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Mid November, 2025

Meta

Senior

Mid April, 2025

Meta

Manager

Late October, 2024

Amazon

Amazon

Junior

Binary Search problem

Comments

Your account is free and you can post anonymously if you choose.