Google India | Onsite Question

Difficulty: MEDIUMCategory: InterviewExperienceFrequency: 1Asked On 2024-11-12Added By Anonymous
Source: Link

Company: Google
Role: unknown
Interview Stage: Onsite
Location: India
Year: unknown

Original Post Content:

Given a sorted array, find the maximum frequency of a number.
Eg: [1,2,2,3,3,3,3,4,4,5,6] : Answer: 4 (3 is repeated 4 times).

O(N) is a straightforward solution. Asked if the performance can be improved.

Comments