Google | Interview | Round 1
Difficulty: MEDIUMCategory: InterviewExperienceFrequency: 1Asked On 2025-10-22Added By Anonymous
Source: Link
Company: Google
Role: unknown
Interview Stage: Phone Screen
Location: unknown
Year: unknown
Original Post Content:
Given a List of ApkInfo. Return a list of supported apk Ids for a given OS range. The queries will be coming in continuously.
class ApkInfo {
int apkId;
int minOsVersion;
int maxOsVersion;
}
I suggested the approach using Segment Tree, was able to implement the base version without lazy propagation.
But could not finish the follow up of adding new ApkInfo as the time ran out.
Wondering if Segment Tree was the right solution now. If any one has any better solution do let me know