Wayfair | SDE2 L2-4 Onsite Virtual | Coupon category
There were total 4 questions (1 main question and 3 follow ups on the same). It was conduted on hackerrank pair programming portal. Time provided was 1 hour. The interviewer just gave me the questions and asked me to explain the solution and then code it.
https://assets.leetcode.com/users/images/059e7720-ad69-4d1e-9c13-dcdf010977ea_1704190253.1898038.png
https://assets.leetcode.com/users/images/e8b36c03-afd2-4ce7-ad9f-d867c27135fc_1704190269.371634.png
https://assets.leetcode.com/users/images/dec8a0f4-e92e-45a6-84c7-c2c6be008182_1704190300.0770319.png
https://assets.leetcode.com/users/images/d86fc823-3c4c-464c-afd2-46ce8ba37a6f_1704190300.122709.png
https://assets.leetcode.com/users/images/d7e69cc0-2c9d-4908-8156-9bd50758d5c2_1704190300.4274063.png
https://assets.leetcode.com/users/images/3ca59c18-7295-4ab9-9962-d792beb48308_1704190300.7620792.png
https://assets.leetcode.com/users/images/26c0bb26-d531-42de-aa5f-481e6bccc09d_1704190301.0086656.png
I was able to code the solution for the problem using union and find approx. Passes 5/5 test cases. He was expecting something O(1) for the follow ups which I couldn't answer in the given time. I came up with O(n) approach for the follow up question.
Verdict: Got an instant mail with rejection in 1 min.