Round 1: HackerRank Assessment
Questions:
- Group Anagrams - 30% points
- Variation of Grid: Instead of one step, we can move to k steps (1 -> k) in all four directions. Find the minimum steps from (0,0) to reach (n,m) with obstacles of infinite height that cannot be processed in that direction. - 70% points
Candidate scored 75% and cleared this round.
Candidate's Approach
The candidate attempted the first question on Group Anagrams and scored 30%. For the second question, they successfully navigated the grid variation and achieved 70% points.
Interviewer's Feedback
No feedback provided.
Round 2: DSA
Questions:
- Given heights of buildings and distance k, find if there exists a building of the same height at most k distance away. Return True if it exists, else False.
- Follow-up: Same question but with the condition of at most H difference in height. The expectation was to solve this in O(n log n).
Example:
- Input: height = [1,5,6,2,5,4,6], h = 1, k = 3
- Output: True (as abs(height[3] - height[0]) = 1 <= h and 3 - 0 <= K)
- Input: h = 0, k = 3
- Output: False
The candidate was unable to solve the follow-up in O(n log n) and was rejected in this round.
Candidate's Approach
The candidate solved the first question using dynamic programming and sliding window techniques. However, they struggled with the follow-up question, which required a more efficient O(n log n) solution.
Interviewer's Feedback
No feedback provided.