Tech IndustryDec 15, 2019

Are proper coding skills being tested in interviews ?

I started working on the LFU Cache question mentioned in this thread(https://leetcode.com/discuss/interview-experience/450361/Amazon-or-SDE2-or-US-or-Dec-2019-Reject). I consider myself a decent coder and struggled to even think of an optimized solution, given I have solved LRU cache before. Then I went through the solutions, understanding the solutions. Figuring out how the top solutions worked itself took some time. This entire thing took me an hour, without even implementing the code. Now imagine coming across this question in a 45-minute interview. It's the dumbest question an interviewer can ever come up with. Forget the bug-free implementation, how can someone come up with an optimized(O(1) time) solution for this question, without seeing it before? Either the company expects superhuman people to code for them. Or they just want to take in people who have crammed up leetcode. Putting myself in the shoes of an interviewer: Even I have interviewed New Grads in my company and I used to ask easy-medium LC questions and build on that, considering the time constraints. I make sure the interviewee is comfortable and then increase the complexity. Mind you, the questions weren't easy but I asked them the basic idea first and speak out loud what they were thinking. My favourite questions were a combination of design and algorithms. 1. https://leetcode.com/problems/design-twitter/description/ I asked them how they would implement it and asked basic approach(forget the Priority Q based approach). If they were comfortable in getting that solution, then I asked them to optimize it. My intention here was to see how they understood the complexity, the choice of their data structures and their thinking abilities. If they were clear, I rate them 7/10. Then I used to follow up with questions like Can you improve the `getNewsFeed` function if it's based on time? (Hint: Priority Queue) Ignoring time, how else can you optimize it? (Hints: Frequency? Interaction with other followers?) Can you come up with any other features that can improve the newsfeed? May be, design a `likeTweet` function which would recommend better tweets? (Well, I never went to this part. The 45-60 mins time I had usually ended up with the first follow up) 2. https://leetcode.com/problems/top-k-frequent-words/description/ Similar manner. Asked them to come up with a basic idea and iterated to the optimal solution with follow up questions(heap-based approach, quick select, bucket sort, etc..) 3. Question on graphs (Didn't get a chance to ask this but it'd be something like this) Assume a person on some arbitrary point and he has to reach a certain point. Give me all the paths for this(not necessarily optimal). I wanted to look at the approach, thinking and error-free code(+1 for this). Then I would add obstacles and rewards to the grid. Ask them to tweak the alg0rithm to accommodate the changes. Now I would make it more complex like asking to return the shortest path and most rewarding path. If we're still left with time, I would make it harder by going deeper to ask A* or other fancy algos if they mentioned it in their resume(say he/she mentioned ML projects). I would not ask them to code(but hey, I would give a "STRONG HIRE" if you could do that) but see how would the thought process be. I used to add 1 point for ideas for follow up questions and another point if they implemented a production-ready model. Okay. Do you see where I'm getting to? I would love to see the person think a lot, come up with multiple ideas, see lots of code, analyze the way he uses his data structures, understanding the complexity, see how he iterates/thinks when I add complexity to his code(read adding "features" to existing code in real SWE setup) and overall look at the ease with which he codes and assess how I'd rate him as a future colleague. What I would definitely AVOID is asking such dumb hard questions. Because if he answers, I'd either assume he worked on this earlier and knows the answer prior or if he/she didn't, they're not dumb. Any takeaways then? What I would suggest any interviewers, in general, would be to ask questions which make the interviewee think and allow them to showcase at least some of their coding skills. They're not here to show you the so-called optimal answer that you already have in mind. Please avoid questions which have a "0-1" solution, which means he either knows the answer and can code in like 5 mins or he doesn't, in this case, where he keeps on thinking and ultimately ends up feeling shitty and miserable about his coding skills. Give them some leverage. Start with a very easy question like how I mentioned and then converge onto what you want. Well, you should have multiple follow up questions whenever he gives some answer. Keep making him/her write code until the very end and let them open up with different solutions. Keep discussing trade-off after every single follow up question rather than asking everything at the start and keep staring at their code for the rest of the time. Feedback? Sure. I'm all ears :) Well, these are my thoughts on coding interviews in general and would love to know your perspectives. My assumptions might be wrong but I feel interviewing is a lot skewed with interviewer's bias and their pre-assumed optimal answers for specific questions. Let me know your thoughts too.

Add a comment
Amazon batou Dec 15, 2019

tldr ? too many junior, too few spots at * decent enough* companies. The bar for those will keep increasing. It's not about coding or engineering. It's about selecting. BTW why don't you just spend the time typing this post on leetcode ?

Citrix Systems mytechs OP Dec 15, 2019

I should have added a tldr. Thanks for the tip. And I thought of sharing the same here, after putting it in leetcode :)

Wayfair UqId35 Dec 15, 2019

Interviewers want to delude themselves into believing they found the guy who came up with the O(n) solution to whatever stupid problem they asked on the fly. No one ever got fired for hiring the dude who blasted through an LC hard. Just let people believe what they want to believe. Don't fight the system, just keep your head down, grind LC, get that 🧀 and get out.

Citrix Systems mytechs OP Dec 15, 2019

I like the way you put it. Unless ranting here, I don't think there's anything concrete that we can do. This is what blind is for :)

Wayfair UqId35 Dec 15, 2019

I like your tips though, I'll keep this post in mind.

Amazon cokediet Dec 15, 2019

I was asked LFU and another LC hard DP question in an interview with Uber. Interviewer expected me to code both of them and pass all the test cases on Hackerrank.

Wayfair UqId35 Dec 15, 2019

For a phone screen, or onsite?

Amazon cokediet Dec 15, 2019

On-site

Juniper print(‘f’) Dec 15, 2019

I think the phone screen is intentionally made hard to screen out the maximum people, considering the volume of applications they get for the top companies. My personal experience with Google, Uber, Apple and Facebook have been the same, they all asked difficult questions on phone but during onsite the questions were relatively simpler. Its all about preparation. The fb recruiter said the only difference between candidates they hire and dont is preparation. If they start inviting everyone to onsite, imagine the amount of time they would spend interviewing candidates. So take some time and prepare harder. You should be fine.

Amazon rowdyguy Dec 15, 2019

+1 It's not really possible to test proper coding skills in an interview because proper coding means developing large complex systems over time in collaboration with others. Hard but short interview questions are just a proxy for that to weed people out

Citrix Systems mytechs OP Dec 15, 2019

The question is was referring to was in an on-site round. Agree with your thoughts but asking such question boils down to " Did you do this LC hard before or not?"

Getty Images RVVd17 Dec 16, 2019

Well the next step for companies is to re-evaluate current employees at random with LC hard problems. If you fail, you’re PIP’d. 🤣

Indeed Xltva Dec 27, 2019

Was also working on the same question. My opinion: I did not like either of the python solutions on leetcode to that question. BUT, notice that by using a double linked list (that you can code from scratch) and a hash table a natural solutions pops out.