Technical Interview Preparation

Get hired by top tech companies with our comprehensive interview preparation.

Get Started

Category: Divide & Conquer

Divide & Conquer

Unbounded Binary Search

Given a monotonically increasing function f(x) on the non-negative integers, find the value of x, where f(x) becomes positive for the first time. In other words, find a positive integer x such that f(x-1), f(x-2), … are negative and f(x+1), f(x+2), … are positive.

Do NOT follow this link or you will be banned from the site!