E6 here. Watched til 16 min. For Problem 1-- Good: - articulated thought process - time/space complexity - solved problem & follow-up Missing: - trade-off's - edge cases - test case - bottlenecks / optimizations As a note, I'd recommend to NOT say "does this make sense?". The interviewer is well-trained and experienced, and this question can throw off the interview. Overall, it's good, I would've wanted to see more analysis of the code (trade-off's, edge cases, etc). Given it's an internship, I would give it a Hire. E4 and up Neutral or NH.
Haven't watched the video, but what would you recommend one should say to check in with an interviewer once you explain your approach? I usually also say "does this make sense?" Is there a better thing for me to say or do?
@@aytonjim6225 "if it makes sense" is a better statement. The interviewer has likely asked the same set of 10 questions to hundreds of candidates, he/she knows what they're looking at. Saying "does it make sense" might imply that the interviewer doesn't know if it does or doesn't. It might not matter or it might, but overall I'd recommend to not question the interviewers experience. So yeah, go with "if it makes sense" and they will usually agree.
I haven't seen whole video yet but I think in follow-up question instead of stack array of 26 for each character won't be efficient PS. I don't know if they used ahead
for the second question, isnt a simple level order traversal enough to get the distance of all nodes from the root, then subtract the distance of all nodes by the distance of the target node and then check for the nodes having a resultant distance of 0 or k?? this should work imo
yeh was thinking something like this. Level order until you find the level with the node in it (compute this entire level). For each level maybe keep track of which count etc. (list of list maybe?) and then after finding the node can figure out all the "parent" nodes of dist k from target. Then for children just basic dfs etc. will do right?
Funnily enough it is. By the time you get to interview day if you haven’t memorised all the top questions a company likes to ask then you’re in a bad spot. The unfortunate reality is that figuring it out on the spot is the worst for your chances of passing
While my approach to the problems may have differed, I was nonetheless able to come up with a solution on the spot. The only potential concern I noticed was the absence of clear communication, such as inquiring about the interviewer's expectations or thoughts. Or presenting more than one solution while explaining trade-offs.
on the first two problems i can honestly say yes. First problem I would of used a stack and on the second i would of used a hashmap. The third problem stump me and just made me realize i need more experience dealing with these types of graph problems (disguised as tree), but 2/3 makes me feel better because if i look back to the past, it would of been 0/3 lol. After today if asked this question i can solve 3/3@@AnonYmous-yu6hv
My read of this is quite the opposite - he obviously knew the answer to the first question. The only signal there was that he can explain an algorithm he knows and he can code quickly. It was the second question where he showed his intelligence! He was stumped and worked through it. I'm not sure why his solution with returning the distance to the target and printing (k-distance away) nodes down the opposite branch of the ancestors wouldn't work? You told him to code it another way and he easily switched mental gears and did it your way. Impressive.
It varies. Usually is 2 questions, sometimes it's 1 hard question, or sometimes even 3 easy/medium ones. You never know but in most cases it's two questions
also the interviewer saying "I could've told you to rewrite your code hahaha" No it's not funny and it's a sign of a toxic workplace, I would tell that interviewer, ok I don't want to work with you, bye.
ok sure, but he said that because he was talking about a hypothetical scenario where he didn't fully understand the problem statement, therefore he actually HAD to rewrite the code, so he can solve the real problem, and not the one he thought he had to solve. It's like solving "max subarray sum", when you should solve "subsequence sum = x". You have to rewrite the code, it's even similar
@@AnonYmous-yu6hvpeople can see your negative passive aggressive comment you know that right? Your the type to complain about everything not knowing your the problem jeez man get a grip
wow perfect, saved in my playlist, will be useful for my interviews :)
Nice mock interview, definitely learned a lot from this!
E6 here. Watched til 16 min.
For Problem 1--
Good:
- articulated thought process
- time/space complexity
- solved problem & follow-up
Missing:
- trade-off's
- edge cases
- test case
- bottlenecks / optimizations
As a note, I'd recommend to NOT say "does this make sense?". The interviewer is well-trained and experienced, and this question can throw off the interview. Overall, it's good, I would've wanted to see more analysis of the code (trade-off's, edge cases, etc). Given it's an internship, I would give it a Hire. E4 and up Neutral or NH.
Haven't watched the video, but what would you recommend one should say to check in with an interviewer once you explain your approach? I usually also say "does this make sense?" Is there a better thing for me to say or do?
@@aytonjim6225 "if it makes sense" is a better statement. The interviewer has likely asked the same set of 10 questions to hundreds of candidates, he/she knows what they're looking at. Saying "does it make sense" might imply that the interviewer doesn't know if it does or doesn't. It might not matter or it might, but overall I'd recommend to not question the interviewers experience. So yeah, go with "if it makes sense" and they will usually agree.
To clarify, yes it is a very, very small detail, but often times these $500k+ interviews come down to 1 sentence you said or didn't say.
I haven't seen whole video yet but I think in follow-up question instead of stack array of 26 for each character won't be efficient
PS. I don't know if they used ahead
I am a newbie. Did he get the answer corrected for Q1 follow-up question? I followed along coding and I didn’t get the output of “aa”?
yeah I don't think his approach was correct, surprised the interviewer missed that
@@anshchaturvedi4235 ok thank you. I am new so I don’t know if I was missing something.
could have used stack of list
it works. the output is "ca".
I followed through and I did get the answer even though IM using JS and not python
Why not just use a set
You can have multiple of the same letter, they just can't be consecutive
are the STEP internship interviews easier?
for the second question, isnt a simple level order traversal enough to get the distance of all nodes from the root, then subtract the distance of all nodes by the distance of the target node and then check for the nodes having a resultant distance of 0 or k?? this should work imo
yeh was thinking something like this. Level order until you find the level with the node in it (compute this entire level). For each level maybe keep track of which count etc. (list of list maybe?) and then after finding the node can figure out all the "parent" nodes of dist k from target. Then for children just basic dfs etc. will do right?
thank you!! this was super helpful
he knows the best answers instantly, that's not how it usually is in the real world...
Funnily enough it is. By the time you get to interview day if you haven’t memorised all the top questions a company likes to ask then you’re in a bad spot. The unfortunate reality is that figuring it out on the spot is the worst for your chances of passing
While my approach to the problems may have differed, I was nonetheless able to come up with a solution on the spot. The only potential concern I noticed was the absence of clear communication, such as inquiring about the interviewer's expectations or thoughts. Or presenting more than one solution while explaining trade-offs.
@@crackfaang you don't always know what a company likes to ask, in the real world you'll likely encounter questions you haven't seen before.
@@johnsoto7112 would you know the most optimal solution instantly for all the questions like he did? I doubt that.
on the first two problems i can honestly say yes. First problem I would of used a stack and on the second i would of used a hashmap. The third problem stump me and just made me realize i need more experience dealing with these types of graph problems (disguised as tree), but 2/3 makes me feel better because if i look back to the past, it would of been 0/3 lol. After today if asked this question i can solve 3/3@@AnonYmous-yu6hv
My read of this is quite the opposite - he obviously knew the answer to the first question. The only signal there was that he can explain an algorithm he knows and he can code quickly.
It was the second question where he showed his intelligence! He was stumped and worked through it. I'm not sure why his solution with returning the distance to the target and printing (k-distance away) nodes down the opposite branch of the ancestors wouldn't work? You told him to code it another way and he easily switched mental gears and did it your way. Impressive.
Did he get the role? How did his interview go?
He ended up passing yes
@@crackfaang that’s awesome
do you have a community on reddit?
No, just discord
1 lc easy, 1 lc hard 😭
do they always have this many problem questions on every interview or just one? cause this video have more than 2 different problem questions
It varies. Usually is 2 questions, sometimes it's 1 hard question, or sometimes even 3 easy/medium ones. You never know but in most cases it's two questions
@@crackfaang how many question does this video have? 3 or 2? does the followup question from the first one considered another question problem?
Curious about this too. I thought they were two questions + one extra question given the interviewee breezed through the first two
also the interviewer saying "I could've told you to rewrite your code hahaha" No it's not funny and it's a sign of a toxic workplace, I would tell that interviewer, ok I don't want to work with you, bye.
when did he say that??
@@isws in the end when they reviewed
ok sure, but he said that because he was talking about a hypothetical scenario where he didn't fully understand the problem statement, therefore he actually HAD to rewrite the code, so he can solve the real problem, and not the one he thought he had to solve. It's like solving "max subarray sum", when you should solve "subsequence sum = x". You have to rewrite the code, it's even similar
@@AnonYmous-yu6hvpeople can see your negative passive aggressive comment you know that right? Your the type to complain about everything not knowing your the problem jeez man get a grip