PracHub
QuestionsCoachesLearningGuidesInterview Prep
|Home/Software Engineering Fundamentals/Bitkernel

Count binary search steps for specific keys

Last updated: Mar 29, 2026

Quick Overview

This question evaluates understanding of binary search mechanics, counting comparisons during a specific execution, and competency in algorithmic analysis and control-flow reasoning.

  • medium
  • Bitkernel
  • Software Engineering Fundamentals
  • Software Engineer

Count binary search steps for specific keys

Company: Bitkernel

Role: Software Engineer

Category: Software Engineering Fundamentals

Difficulty: medium

Interview Round: Take-home Project

You have the sorted array: `[22, 34, 55, 77, 89, 93, 99, 102, 120, 140]` Using standard binary search with `low` and `high` indices and `mid = floor((low + high) / 2)`, how many comparisons are required to find each of the following keys: `77`, `34`, and `99`? Provide the triple (comparisons for 77, comparisons for 34, comparisons for 99). Options: - A. `3, 3, 3` - B. `3, 3, 4` - C. `3, 4, 3` - D. `4, 2, 4`

Quick Answer: This question evaluates understanding of binary search mechanics, counting comparisons during a specific execution, and competency in algorithmic analysis and control-flow reasoning.

Related Interview Questions

  • Evaluate C for-loop execution count - Bitkernel (medium)
  • Trace first pass of heap sort - Bitkernel (medium)
  • Find minimum two’s-complement value with three ones - Bitkernel (medium)
  • Identify incorrect statement about sockets - Bitkernel (medium)
  • Solve cups logic puzzle with one true statement - Bitkernel (medium)
|Home/Software Engineering Fundamentals/Bitkernel

Count binary search steps for specific keys

Bitkernel logo
Bitkernel
Oct 24, 2025, 12:00 AM
mediumSoftware EngineerTake-home ProjectSoftware Engineering Fundamentals
4
0

You have the sorted array:

[22, 34, 55, 77, 89, 93, 99, 102, 120, 140]

Using standard binary search with low and high indices and mid = floor((low + high) / 2), how many comparisons are required to find each of the following keys: 77, 34, and 99?

Provide the triple (comparisons for 77, comparisons for 34, comparisons for 99).

Options:

  • A. 3, 3, 3
  • B. 3, 3, 4
  • C. 3, 4, 3
  • D. 4, 2, 4
Loading comments...

Browse More Questions

More Software Engineering Fundamentals•More Bitkernel•More Software Engineer•Bitkernel Software Engineer•Bitkernel Software Engineering Fundamentals•Software Engineer Software Engineering Fundamentals

Write your answer

Your first approved answer each day earns 20 XP.

Sign in to write your answer.
PracHub

Master your tech interviews with 8,500+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • AI Coding Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.