Flipkart Interview Question
Difficulty: EASYCategory: InterviewExperienceFrequency: 1Asked On 2022-05-14Added By Anonymous
Source: Link
Company: Flipkart
Role: unknown
Stage: unknown
Location: unknown
Year: unknown
You are given a range [m , n] Consider them a licence plate number. For regular customers you use numbers in sequence and for premium customers you can give out number which customer asks for and if its available. Question is you need to perform both operation in O(1). How can this be done for e.g. range is 1000 -> 5000 normal customers: 1000, 1001, 1002, 1003..... for premium customer: 1111,1221,1122 etc - it can be any number customer wants Which DS to use for this problem, only constraint is time wise it must be O(1)
Role: unknown
Stage: unknown
Location: unknown
Year: unknown
You are given a range [m , n] Consider them a licence plate number. For regular customers you use numbers in sequence and for premium customers you can give out number which customer asks for and if its available. Question is you need to perform both operation in O(1). How can this be done for e.g. range is 1000 -> 5000 normal customers: 1000, 1001, 1002, 1003..... for premium customer: 1111,1221,1122 etc - it can be any number customer wants Which DS to use for this problem, only constraint is time wise it must be O(1)