← Samsung questions

Binary search in a sorted array

Filed under Samsung

Given a sorted array of integers and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in order. You must write an algorithm with…

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 Samsung questions

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