Count Distinct Values in a Huge Sorted Array

Read the full interview experience this question came from →

Quick Overview

Count distinct values in a huge sorted random-access array without examining every element. Jump across equal-value runs with binary search to target O(d log n) time and O(1) auxiliary space when distinct values are sparse.

Count Distinct Values in a Huge Sorted Array

Company: LinkedIn

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: medium

Interview Round: Onsite

Overview: Count distinct values in a huge sorted random-access array without examining every element. Jump across equal-value runs with binary search to target O(d log n) time and O(1) auxiliary space when distinct values are sparse.

Read the full LinkedIn Software Engineer interview experience this question came from

|Home/Coding & Algorithms/LinkedIn
LinkedIn logo
LinkedIn
May 13, 2026
mediumSoftware EngineerOnsiteCoding & Algorithms
6
0
Loading...

Submit Your Answer to Earn 20XP

Sign in to leave a comment

Loading comments...