← Bitkernel Interview Insights

Bitkernel·Software Engineer·Technical Phone Screen·Intermediate

Intermediate
May 2026

Summary

Had a technical screen at Bitkernel for a software engineer role. Just one question but it was the kind that looks straightforward until you actually trace through it by hand.

Questions Asked (1)

Q1

An 18-element sorted array is searched using binary search (1-based indexing, mid = floor((low + high) / 2)). What sequence of indices does the search examine when looking for the element at position 3?

Algorithms & Data Structures
Author's notes

I almost went with 1, 2, 3 because my brain defaulted to linear search logic.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Simulate the binary search step-by-step, clearly stating the initial low and high bounds, computing the midpoint using the given formula, and adjusting the bounds based on whether the target is less than or greater than the midpoint. Continue until the target is found, and record each examined index in order.

Pro tip: Mention that you're using 1-based indexing and the floor function for midpoint calculation, and double-check that your bounds are inclusive (low and high are valid indices). This shows attention to detail and avoids off-by-one errors.

1. Initialize bounds

Set low = 1 and high = 18, since the array has 18 elements and indexing is 1-based.

2. Compute midpoint

Calculate mid = floor((low + high) / 2). For the first iteration, mid = floor((1+18)/2) = 9.

3. Compare and adjust

Compare the target (position 3) with the element at mid. Since 3 < 9, set high = mid - 1 = 8. Record the examined index (9).

4. Repeat until found

Continue the process: compute new mid, compare, and adjust bounds until the target index is examined. Record each mid in order.

5. List the sequence

After the search terminates, list all examined indices in the order they were checked.

Key Points to Mention

  • Binary search requires a sorted array and works by repeatedly dividing the search interval in half.
  • The midpoint calculation uses floor((low + high) / 2) and 1-based indexing.
  • Bounds are inclusive: low and high are valid indices in the current search range.
  • When the target is less than the element at mid, the search continues in the left half (high = mid - 1).
  • When the target is greater than the element at mid, the search continues in the right half (low = mid + 1).
  • The search terminates when the target is found or when low > high (not found).

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.