← SAP questions

Binary search algorithm

Filed under SAP · Also reported at Deutsche Bank, Oracle, PayPal, Vdart

Given a sorted array of integers `nums` and a target value `target`, return the index of `target` if it exists in `nums`. If it does not exist, return `-1`. Your algorithm must run in O(log n) time…

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related SAP questions

Collected from public candidate posts and coding forums. Updated Nov 2026.