← Microsoft questions
CodingReported in a candidate post, Feb 2026

Find the duplicate number in O(n) time and O(1) space

Filed under Microsoft

You are given an array nums of n + 1 integers where each integer is in the range [1, n] inclusive. There is exactly one repeated number (it may be repeated more than once). Return this repeated number…

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

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