[Rejected] Razorpay | Lead Software Engineer | Bengaluru | Sep 2024
Difficulty: MEDIUMCategory: InterviewExperienceFrequency: 1Asked On 2024-09-16Added By Anonymous
Source: Link
Company: Razorpay
Role: Lead Software Engineer
Interview Stage: Machine Coding Round
Location: Bengaluru
Year: 2024
Original Post Content:
Machine Coding Round
Problem Statement:
Your organization has started a new tech blog with interesting tech stories and you're responsible for designing and implementing an in-memory search engine, supporting the search functionality on the blog content.
Requirements:
- It should be possible to create a dataset in the search engine.
- It should be possible to insert documents into a given dataset. Each document is simply a piece of text.
- It should be possible to search through documents for a search pattern in a given dataset.
- It should be possible to order the search results
- Search Pattern: Initially search pattern would be a sequence of words, but can be extensible for different search patterns: Sequence of words containing words Sequence of words containing words maintaining the order Sequence of words containing words maintaining the order in sequence (substring)
- Ordering Logic: Initially ordering pattern would be the latest published article, but can be extensible for different search patterns: Ordering can be recently published articles Ordering can be recently updated articles Ordering can be recently searched articles Ordering can be done based on Author.
Personal Feedback
- Interviewer wanted to get O(1) fetch during query.
- Interviewer also wanted not to make too much memory consumption (during initial preprocessing of the blog content).
- The 30-40 minutes discussion went for Algorithmic/DSA related discussion on how to store/fetch the documents.
- For efficient read/write queries discussion went around map, sorting, hashing, hash collisions, array manipulation, 2 Pointers, Trie implementation - which wasn't really scope of this interview. Is this normal?
- Got only 20 minutes for actual coding, probably didn't do much to clear the round.
- The interviewer seemed very inexperienced on how to navigate the interview.
Any hint on how to approach this problem?