Summary
The candidate faced an unexpected rejection from Uniswap Labs following a coding interview where they refined their solution to an optimal approach, receiving feedback about 'disconnects between the initial solution and how it came together in code'.
Full Experience
I’ve done many interviews as a candidate and an interviewer, and I would never expected a rejection after the performance I gave, which is why I was kind of stunned and want to hear what they said?
Here’s the breakdown:
A problem with X object has Y sortable property and can be reserved or available, and needs to maintain sorted order for querying
How interview process went:
proposed using a set to track reserved or available using a heap to maintain sorted order for the filter functions, aka top 5 cheapest Used a dictionary with key on collections for part 3 filter, with value being a heap Using a heap with all values, in all collections for part 4 filter Then also explained the filter function, could use the set in/out property to filter out if X is reserved or not while getting top 5, and worse case it needs to iterate on all of them
That solution is still linear time for filter, but a worst case scenario run time than one that can remove the items from that list in LogN time so only a constant amount of O(1) (loop limit at 5) needed instead of worst case O(N)
Updating the heap without using the sort criteria, woud be inefficient and building a custom binary tree from scratch would take way longer than time would have been possible in that interview duration, so I proposed using SortedList from python, which then solved it in the most optimal way that is possible
Final solution:
Insert/Remove -> log(N) time (worst case) or O(1) if trying to insert/remove an invalid option aka already reserved or not due to the set.
Search by min filter on Y -> O(N) time reduced to -> O(1) due to limit of 5
Using SortedList in python, after first trying to see if a heap option could work, but it would have been O(N) for removing from set not based on the sorted criteria, and N*log(N) to reheapify.
I didn’t finish every single part of the initial solution proposed, aka the set checking in the filter, since they indicated before I coded it that it wouldn’t be efficient enough. So why would I code it up anyway in full, vs keeping the base logic that I can change the data structure on? Why is coding the best solution instead in full, not good enough?
They responded:
while your overall approach was solid, there were some disconnects between the initial solution and how it came together in code
So literally the feedback reduces to, you didn’t solve it with the most optimal solution on the first try, arriving at the best solution possible by the end of the interview and explaining it verbally the entire time, is no longer enough.
Not a serious company, don’t bother wasting your time interviewing here. What they are looking for is an AI generated output that you then feedback to them, so if you do decide to interview here, make sure you cheat.
Interview Questions (1)
A problem with X object has Y sortable property and can be reserved or available, and needs to maintain sorted order for querying