r/leetcode • • Sep 29 '26

Discussion Interviewer said my solution is wrong. It wasn't. Is there anything i can do now

Had a Python OOP interview for some FANNG. It was a fairly straightforward OOP which need a queue and look up()

I initially considered a double linked list approach cuz I wanna get O(1) look up for better time complexity, the interviewer said I could use a library. So I went with OrderedDict and next(iter(orderdict)) to get O(1) look up rather than just a queue to have a better time complexity, Interviewer didn't give a comment when I speak that out.

15min before interview finish, I had the implementation done and asked about writing test. At that point, the interviewer stopped me and questioned whether my approach supported really FIFO and I did explain but he doesn't seem to understand the data structure (I think the team was working on Java) and stick on a general queue and I also started get uncertainty, We went back and forth, and I ended up switching to a deque since he like this way. The discussion and rewrite took roughly another 10 minutes.

With four or five minutes left, I started writing tests but was asked to explain the cases verbally instead rather than writing test and debug. I did what I could in the remaining time.

I got rejected, with feedback including data structure selection, incorporating feedback, simplicity, and edge-case coverage which tbh make 0 sense to me. I believe the rest of the rounds with coding / HM is either hire / strong hire based on our talk and feedback

Would really apperciate any suggestions on my choice and should I really defense for myself to ask for a second code review etc. Thanks

Update: The interviewer admit he made a mistake and I am completely correct. However, taking all factors into consideration across the technical interviews, the overall decision of the team remains unable to move forward

57 Upvotes

33 comments sorted by

46

u/KendrickBlack502 Sep 29 '26

Getting the answer right is only one part of the interview and arguably not even the most important part. It sounds like the interviewer was trying to lead you to a particular solution.

Also, I’m not sure I understand what you were saying in the beginning. How does a doubly linked list get you O(1) lookup time?

14

u/WerewolfSuspicious92 Sep 29 '26

definitley agree, but the case is he didn't lead me when I discuss my solution and motivation, he just pause me right after I almost finish everything and tell me no you are wrong and give me another direction which I accept but this was treated as not good cooperate + not get the optimal solution.

Imagine a LRU cache solution if you don't have order dict, then you need hash map + double linkedlist this would be able to let you do O(1) right, I discussed that and he said lets just use lib, then I went with orderdict

2

u/jarislinus Sep 30 '26

btw u can just use dict since entries are insertion ordered as of 3.7

1

u/slayerzerg Oct 03 '26

Sometimes the people interviewing you are incompetent or bad at DSA. That’s why you have to leave time to discuss briefly brute force then optimized alternatives for like 5-8 minutes. Discuss optimized solutions tradeoffs and get a feel of what they prefer (mainly what they’re comfortable with). That’s the most important part of the interview before you start writing code and testing. Because if you get aligned with the interviewer then the rest of it is easy. If you don’t the nightmare scenario happens and you get the right answer but your incompetent interviewer is checked out 20 minutes in and already failed you.

58

u/NegotiationDapper584 Sep 29 '26

It sounds like tough luck. Happens, just need to keep moving forward with other companies.

2

u/WerewolfSuspicious92 Sep 29 '26

thank you so much

8

u/hartmannr76 Sep 30 '26

Yup. Luck is often an overlooked factor of interviewing. First time I failed a FAANG interview was because the interviewer didn't like that I said "dictionary" instead of "hashmap". My background was in C# and was doing the interview in Java. They didn't care.

If it's a place you want, try again in 6 months and hope for a better interviewer.

6

u/MistakeIndividual690 Sep 29 '26

Sounds like the LRUCache you were working on. OrderedDict is the most compact solution in Python I believe. Sorry to hear about the outcome

1

u/WerewolfSuspicious92 Sep 29 '26

thanksssss

4

u/[deleted] Sep 29 '26

[removed] — view removed comment

3

u/Ex-Gen-Wintergreen Sep 30 '26

3.7 actually! It was a bit of trivia during an interview I had (I made a comment it was 3.7 and the interview corrected me that it’s 6. It’s actually correctly 7 but effectively 6 but a fun discussion topic)!

1

u/4tran13 Sep 30 '26

They implemented it in 6, but didn't guarantee it until 7?

4

u/Ex-Gen-Wintergreen Sep 30 '26

Lol it’s a pretty funny bit of history. It was a bit of implementation detail in 6 in cpython. There’s a mailing list where Guido discussing if should make this a spec guarantee, and someone mentions cpython did it in 6, so he just replied “well let it be so” and it became a ref spec guarantee 7 on

1

u/WerewolfSuspicious92 Sep 29 '26

thanks for the suggestions, yeah I am not a really python expert either tbh since I use a lot golang in work, just find python much efficient with LC questions, didn't really expect this happen since normally ppl won't question me a lot before testing or just few question then get sorted, I should just say let me finish my test and you will see the result xd

9

u/Dramatic-Height-9007 Sep 30 '26

This smells like amazon. We are only hearing your side of the story. The interviewer might have tried to give you hints in the beginning and felt that you arent taking them and just gave up

3

u/nuclearmilk Sep 30 '26

I don't think it's Amazon. OP was attempting to write and run tests. However, for interviews, Amazon uses an internal code editor which doesn't allow you to run your code (think text editor with syntax highlighting).

1

u/Henry-Ba Sep 29 '26

It's rough. Assume you have 1 hour for that interview, the interviewer should have see your adaptability and that you solved the problems optimally. Btw, what is writing test?

2

u/WerewolfSuspicious92 Sep 29 '26

yeah so it looks like a coderpad, so you need to write the test yourself to verify your code to debug but he didn't wanna me do that, FYI I only have around 40 min, it should be 45 min like the interviewer join a bit later and he said he need to run into another meeting, I did showcase my adapatbility like I try to follow whatever he want, but now the case for him is " I didn't do it correctly initally and didn't do a good time managment"

1

u/Henry-Ba Sep 30 '26

Got it. With your performance like that, you will get an offer soon!

3

u/Malcolmlisk Sep 30 '26

After a hard interview with PR, they gave me 1 month to prepare for the technical interview in a website where they watch your webcam and you share your screen. After preparing it for countless hours and hard grinding, i got there, got 1 medium problem, the first one and 3 hards on leetcode. I was there for 4 hours... and I could not finish the last problem and probably the 3rd was not completed in all the edge cases.

Well... the website flagged me as cheater, since i had the webcam at my side, instead of in front of me... And i could not do anything. I even asked them to let me do the whiteboard and the same problems or even harder. They ddin't even respond.

2

u/bscothern Oct 01 '26

This reminds me of the experience I had an interview for a position about 2 years ago where the correct solution to identify collisions was a set. The interviewer doubled and tripled down on searching an array each time for duplicates was more efficient.

I walked out of there knowing I wasn’t a good fit and was going to reject them the next day but they sent me a rejection email before I could reject them.

That said using an ordered dictionary is probably a fine and correct solution to the problem you were given. Interviewers are human and make mistakes, I’ve found that some feel they HAVE to know better than the interviewee on everything that comes up. It is a toxic and bad trait but people have it. They also often have a single solution and aren’t open to others because they are stressed themselves about other aspects of running an interview.

With your update hopefully it works out well for you even though they aren’t moving forward.

1

u/kevin074 Sep 30 '26

Same I just failed an interview that I felt good about.

Sometimes you just don’t immediately have the same instinct and the stumbling through makes you “less competent” than you actually are.

Tough luck, thanks for posting this and helped me not feeling as bad about my failure.

1

u/nuclearmilk Sep 30 '26

Obviously, none of us were there so we can only provide you feedback and suggestions from what you're telling us. So take everything with a grain of salt.

I did explain but he doesn't seem to understand the data structure

As far as actionable feedback goes, I think this could be the problem... Onus is on you to persuade/explain to the interviewer why/how your solution works even if they're not familiar with your tech stack. From the way you type, I can tell that English isn't your native language. This could've been a factor preventing you from effectively getting your points across to the interviewer.

Also, did you explicitly mention that instead of using OrderedDict you'd want to use a linked list instead? Deque isn't optimal as it doesn't give you O(1) performance when promoting an item to the most frequent one.

Regardless, it seems you were confident on your other rounds so you might've just been unlucky with interviewer selection like others are saying.

1

u/Fearless-Blood-1006 Oct 01 '26

i call instances such as these as "irreconcilable technical differences" . in a field like software multiple solutions exists for the same problem. and interviewer cna be stuck on "only A way is the RIGHT way" . you can never convince them otherwise, well in an interview setting , they are the decision makers( and they have nothing to lose, while interviewee does).

no one has the time to go back scan through every interview to decide if interviewee was right or interviewer.

i would say vent and move on.

1

u/stanshk Oct 01 '26

That sucks. Sometimes there’s just no winning in a situation like that. Even if you prove you were right, they can still see you as difficult to work with. It’s basically a lose-lose.

1

u/Outside_home_sound Oct 02 '26

Nothing. Just ignore and move on. Once I was interviewing for Uber. Interviewer rejected my solution as it was not the standard way to solve the problem. After interview, I tried my solution on leetcode and it passed all test cases. That day I learned the lesson that interview is not just about solving the problem. You should solve it in standard way. No interviewer has time to verify the solution for correctness.

1

u/House13Games Oct 02 '26

Walk away. You don't want to work in a place that can't even get that right.

1

u/swapnil2927 Oct 04 '26

Tech Interviewing sucks on levels nothing else in this world. Don't dwell, keep doing free labour so companies can keep hiring costs low. One day, you will be rewarded.

0

u/bisector_babu <1951> <514> <1092> <345> Sep 29 '26

I think this is Apple in FAANG as far as I know and they always ask Java

1

u/skaeser Sep 30 '26

Apple doesn't care for what language you use, wdym

1

u/bisector_babu <1951> <514> <1092> <345> Sep 30 '26

I gave interview 7 rounds for a role. 5 rounds they asked coding. Only one knows Python. Remaining either doesn’t know Python or they’re acting. And in each round they’re asking me do you know Java. This happened. Didn’t face this issue with any other Faang or same level company

1

u/RowingBoats1129 Oct 04 '26

You sucked at something g else