← Questions

Which interval contains a number?

0
GoogleCodingLast asked Jun 2026

A coding interview question asked in Google's first round (coding), last asked Jun 2026. It tests intervals, binary-search and design.

Build a class that stores non-overlapping integer intervals and answers whether a number falls inside one of them, and which one. Discuss three versions with different costs: a linear scan, a binary search over the sorted intervals, and…

Sign in to unlock this question

The full prompt, the worked answer and your own canvas or code with the AI tutor. New accounts get 5 credits: each one unlocks a question for good.

Where it's asked

  • Google · First round: coding · Last asked Jun 202645 min · Coding in a Google Doc, no syntax highlighting or autocomplete · No AI

What it tests

intervals · binary-search · design

Your code and the AI tutor open when you unlock this question.