Software Developer Mock Interview

Master 30 Software Developer interview questions covering algorithms, system design, and coding challenges.

Question 7 of 30

What is your experience with implementing a Binary Search Algorithm without recursion?

  • How to Answer 1

  • How to Answer 2

  • Example Answer

  • Community Answers

Tom Dushaj
Tom Dushaj

Tom Dushaj is a business and technology executive and the author of 'Resumes That Work.' Tom has vast experience providing solutions to Fortune 500 companies in the areas of Information Technology Consulting, ERP Software, Personnel Management, and Intern

The way I approach a binary search is to locate the position of an item in a sorted array. Going a bit deeper, I compare input values that sit in the middle element of the array. I can make a good comparison to determine whether an element equals the input, is less than input or is greater than an input. When an element is being compared, the search stops and typically returns the position of the element. That's the way I see it working. If an element is not equal to the input by chance, then a comparison is made to determine whether the input is less than or greater than the actual element. It can be argued, and I have seen it done where an algorithm starts repeatedly, but only searching the top or a bottom subset of an array's elements.

Unlock All 30 Software Developer Questions

Unlock expert responses to technical and behavioral questions interviewers ask developers.

Get Started