Recruiter reached out over linkedin. Online test was skipped for me.
Got asked this question.
There are N people who want to visit the haunted house. The person will only go if at least L other people will go with him. Additionally, that person doesn't want to go with more than R other people, since it would ruin the experience for them. What is the maximum number of people that can visit the haunted house at one time so that no constraint is violated?
Sample Input:
// The number of people
6
// L R
1 2
1 4
0 3
0 1
3 4
0 2Sample Output
3Bombed this round very badly. Tried all approaches I could think of. In the last 10 mins came up with a O(n**2) brute force way, with slight hints from him. But wasnt good enough, as interviewer expected O(n) complexity.
After the round figured its asked from https://www.hackerrank.com/contests/w15/challenges/haunted-house/, and optimal approach was using segment tree.
(Verdict: Lean/No hire)
Felt even if I clear further rounds, definitely I am going to be lowballed to SDE-1 due to terrible Round 2. Hence discontinued it, as I already had better offers from other places for SDE-2. But recruiter insisted round 1 feedback is great, so continue on.
Finally, after 1 week heard from recruiter the verdict is no hire. Because round 2 feedback wasnt even lean hire. But no hire. And even if they offered me, would be lowballed over, not matching my competing offers. Because coding round needs to have atleast lean hire.
Nevertheless, it was a nice learning experience. Hope that in future I will be better practised to solve such weird DSA questions.
Competing offers:
Other interview experiences:
https://leetcode.com/discuss/interview-experience/1994403/Coinbase-or-IC-4-or-Bangalore-or-March-2022-or-Offer
https://leetcode.com/discuss/interview-experience/1962552/Rubrik-or-G6-or-Bangalore-or-March-2022-or-Offer
https://leetcode.com/discuss/interview-experience/1996706/VMWare-or-MTS-3-or-Bangalore-or-March-2022-or-Offer
https://leetcode.com/discuss/interview-experience/1996617/AWS-or-SDE-2-or-Bangalore-or-March-2022-or-Offer
https://leetcode.com/discuss/interview-experience/2001716/Google-or-L4-Reject-L3-Offer-or-Bangalore-or-March-2022
https://leetcode.com/discuss/interview-experience/2001740/Microsoft-or-SDE2-or-Hyderabad-or-March-2022-or-Reject
https://leetcode.com/discuss/interview-experience/2001782/Robin.io-or-SDE2-or-Bangalore-or-March-2022-or-Offer
https://leetcode.com/discuss/interview-experience/2001992/Nutanix-or-SDE-2-or-Bangalore-or-March-2022
https://leetcode.com/discuss/interview-experience/2002004/Enterpret-or-SDE-2-or-Bangalore-or-March-2022-or-Reject