Those of you peeps who are python programmers, how do you solve certain LC problems that seem to be designed for C. Example linked lists, or other pointer ones like string reversal etc? To be clear, I am not saying you can't do a linked list in python, but does it have any use, perhaps not. Pointer questions like string reversal becomes a joke: def reverseString(self, s): return s[::-1] Assuming you really don't know any other programing languages.
Interviewers don't care if you know a fancy method/function to do the stuff. Most of the stuff you are asked in the interview won't be implemented by you in a real life. Having said that, it's a test to see if you can come up with a logic. I straightforwardly ask the internal implementation of the method the candidate is using, if they act smart. If they don't know, then I ask them to implement, given that is the main part of the question. Voila! One more question! Lesson: don't use a library function if that's the main thing to do in a question. Q: sort the array A: arr.sort() Q: implement sort function and use it A: -_-
Sort the array, arr.sort() Hahahahahaha.. I'd think candidate is trolling me
You missed the point. As an engineer who only knows python, and is LCing hard for a job, he doesn't know that there is anything better than are.sort() as the language restricts him from exploring that option. The example of strong reversal I have is good for demonstrating the problem. As am engineer I will assume his is the essence of the problem. But in the interview that won't work
Like if its the point of the question youd do it the c way, however if sorting an array is a step of the problem then its okay. Afaik
Cars
Yesterday
1061
Why are Americans obsessed with SUV?
Tech Industry
7h
1661
Go woke, go broke: Google fires 28 employees involved in pro-Hamas protest
Tech Industry
Yesterday
16887
Goog Employees Arrested
Software Engineering Career
Yesterday
3432
28 terrorist worshipping idiots just got themselves fired and I've never been prouder to work at Google.
Layoffs
Yesterday
20203
Google CFO confirms "large-scale" layoffs today (Apr 17)
It is indeed debatable how much merit the problems like ones related to linked lists hold for someone interviewing with Python background, but like it or not you very likely will get a C/C++ SWE or similar as your interviewer at some point, and linked list problems ( reversal, loop check, middle value to name a few favourites ) will have a very good chance to appear there. So IMHO it is better to byte the bullet and practice those problems with custom defined classes designed by yourself.
Well LL might be a bad example as it still has some merit. But string reversal like things, which really tested your pointer skills become a joke. def reverseString(self, s): return s[::-1]
Well I think the interviewer can always require you NOT to use certain things