Experience - 4.5+ YOE
Education - Tier 1 college.
Recruiter reached out to me in the month of April'24. Scheduled telephonic Interview after 3-4 weeks.
There will be a total 5 rounds -
One Telephonic Round
3 Technical Rounds
1 Non-Technical Round(Googlyness round)
Round-1: Telephonic Screening Round
Telephonic round was virtual. No much introduction, directly jumped into the problem.
Interview Duration - Strictly 45min
Ques - Given a range of IP Addresses and Country associated with it. Input will be an IP address and return the Country to which it belongs to based on the ranges ?
Eg.
Range of IP address - Country
{ 1.1.0.1 - 1.1.0.10 } - IND
{ 1.1.0.20 - 1.1.0.30 } - FR etc.
Input(IP address) - 1.1.0.5
Output(Country) - IND
Explaination - As the input IP falls in the Range of 1.1.0.1 to 1.1.0.10 which is mapped to IND
I was able to provide a solution with O(n) and clean code. Follow up question was to provide if any faster solution, I tried to explain the solution with Binary search approach(with some assumptions of the given range to be in sorted) which brings down the time complexity to O(logn) but unable to code as we are out of time.
Provide your approach and solutions below in the comments section, it will help those who are preparing for the interviews. Thank you.


