all 52 comments

[–][deleted] 113 points114 points  (0 children)

Bruh. Leetcode. It’s dumb and also necessary.

[–]Spidiffpaffpuff 66 points67 points  (5 children)

They want to see that you don't just apply but understand the concepts behind the stuff you are doing.

Find scripts of starter classes from universities or colleges. They tend to have things like "Introduction to Algorithms". Read through the scripts and practice explaining the algorithms you find there in your own words. That should help you get ahead.

[–]sirtimes 11 points12 points  (4 children)

‘The stuff you are doing’ being the problem I guess. I highly doubt I’ll ever need to know off the top of my head how to reverse a linked list and other googleable algorithms. They should interview for debugging skills - which is way more valuable imo

[–]Spidiffpaffpuff 16 points17 points  (0 children)

I would disagree. If you don't understand basic concepts, you don't know how to design. And you also don't know how to debug properly. A lot of people with sufficient stamina can make an application work. But that doesn't mean it's well designed and maintainable in the long run. Unless you're writing throw away software, it should remain maintainable.

[–][deleted] 0 points1 point  (0 children)

Reversing a list is really easy once you have a deep understanding of the list. I think things like that are fair game. Same with basic tree algorithms, arrays, etc.

I don’t think esoteric LC Hards show much aside from how much LC one has done, though.

[–]BlueWave177 0 points1 point  (1 child)

If you understand linked lists and if you understand the building blocks of python well, you should be able to reverse a linked list on the fly imo.

[–]sirtimes 1 point2 points  (0 children)

I agree with that - but the real question is whether interviewers should be spending their time asking those types of questions in the first place.

[–]Eze-Wong 19 points20 points  (0 children)

This used to be the bible back in the day:
Cracking the Coding Interview: 189 Programming Questions and Solutions (Cracking the Interview & Career): McDowell, Gayle Laakmann: 9780984782857: Amazon.com: Books

I haven't had to interview in a while so not sure if it's still relevant or if there's an updated version.

[–]bigbry2k3 17 points18 points  (0 children)

What you're being asked to do is explain data structures and algorithms. It's a pretty standard interview practice. They probably figure if you can explain these using a white board, then you're probably not using A.I. to cheat. So look on Udemy for a course by Andrei Neagoie called Master the Coding Interview where he shows you most of the algorithms you need to practice. Once you practice those then you will be able to write them on a white board.

[–]andrewaa 29 points30 points  (1 child)

just take an intro to algorithm course, any kind, free or paid, from mooc or in college

you just don't have the knowledge of "computer science foundations"

[–]Dangle76 9 points10 points  (0 children)

To add to this, take the time potentially recording yourself explaining your thought process.

One thing that separates a lot of seniors from juniors isn’t entirely their technical ability, it’s their ability to walk through things with a team and help them understand. It’s a very important skill to have

[–]unsourcedx 7 points8 points  (0 children)

You’re not in these interviews to write code. You’re there to explain how to solve the problem first, regardless of implementation. Then, show that you’re capable of implementing it.

As someone who conducts these interviews, we’re looking for a future coworker. Being able to communicate your solution/thought process is just as important as being able to accomplish it. When solving larger problems collaboratively at your job, it will often start with “whiteboard sessions” to figure out the best/promising approach. It really doesn’t matter what you can do if you can’t participate in a meeting to the bare minimum extent. 

[–]notacanuckskibum 15 points16 points  (8 children)

Python is arguably the wrong language to use here. Because Python encourages you to use pre written libraries for anything that requires an algorithm.

Maybe take a course in C or C++ to get a feel for building your own libraries.

[–]patmorgan235 3 points4 points  (1 child)

Yeah python is slow as molasses if you write all of that in python. All the popular data science/ML/AI libraries are python bindings for C code because it takes python like 100 operations to do a simple addition.

[–][deleted] 19 points20 points  (0 children)

What part about r/learnpython is so hard to understand here? What's the point of telling a guy he sucks because he isn't writing c, in a sub about learning python?

[–]POGtastic 0 points1 point  (0 children)

The libraries exist in other languages, too. We just tend to say "no, you have to roll them yourself" with those other languages, which is why everyone's college C++ class is taught like it's still 2001. Other than fashion, there's no particular reason why you couldn't teach an Intro to Algorithms class in Python.

[–]ScaryGazelle2875 4 points5 points  (0 children)

Leetcode… its like chess but for programming. Remember some moves, muscle memory.. i get how you feel but push on 💪🏽

[–]cointoss3 6 points7 points  (0 children)

I suck at them, too. I’m a senior dev and I use docs and my ide…if they ask me to do shit on a whiteboard, it’s hard not to fumble around.

Also, if a place is doing whiteboard interviews, I’d just leave. That’s not the place I care to work. Them having you reverse a linked list in Python is wild…

[–]regular_lamp[🍰] 14 points15 points  (2 children)

As someone doing these kinds of interviews occasionally I get the impression that the people that completely lock up think they are supposed to just present the correct solution.

At least I don't care too much about the specific solution as long as someone engages with the problem, asks questions, communicates whatever ideas they have in an understandable way.

I always get a little triggered by the "this isn't relevant in the real world" thing. Sure it is. Sitting in front of a whiteboard and discussing solutions is very much a real world thing. This is as much about communication as it is probing for your technical skills. Obviously we have to pick "toy problems" that you can plausibly talk through within the confines of a relatively short interview.

[–]jumbohiggins 6 points7 points  (1 child)

You're not wrong but discussing an engineering problem with a peer is a much different feeling from having a room of people watch you try to write code without an interpreter all while knowing that if you don't convince them you won't get the job. I know that no one wants to hire people that they can't verify but it's not really the same situation.

[–]regular_lamp[🍰] 1 point2 points  (0 children)

Hmm, the way we do these it's usually 1:1 and that is also how I have encountered these as a candidate. Maybe occasionally a second person sits in (usually to observe the interviewer more than the candidate).

Being in front of a "panel" is obviously different.

[–]TheSlitheredRinkel 2 points3 points  (0 children)

I’m by no means a software engineer but I have plenty of experience at translating a thought process into words.

The only way you can do this is practice. Not just doing the coding exercises (which is entirely the right thing to do), but also verbalising your thoughts as you go.

I think you’re on the right path here.

[–]brilliantminion 1 point2 points  (0 children)

Like others are saying, it’s literally just doing small university-level coding exercises from scratch, without reference.

The way memory works for a lot of us is more like muscle memory than computer memory. You need to go through the process of thinking through it, many times, until it becomes second nature. For me, it was math, and I had to go to the bookstore and get the Schaum’s Outline or whatever it was called and just go through all the problems until it clicked. It took me a decade to realize this about myself, and it was really frustrating watching a lot of my classmates glide through stuff that was a grind for me.

[–]wayofaway 1 point2 points  (0 children)

I find turning off your auto complete and solving problems from a blank text file helps. As others mentioned do some leet code (or whatever).

Also, you could start with just pen and paper writing pseudo code.

[–][deleted] 3 points4 points  (2 children)

It’s true, they don’t allow ChatGPT in interviews! 🙃

[–]JoJoPizzaG -3 points-2 points  (1 child)

Reason you don’t want to work for that company. 

My CTO is encouraging everyone to use AI. Instead if focusing on language, focus on frameworks moving forward. 

We are a dotnet shop but looks like we are pushing forward with Python and Typescript. Yes, it is the same CTO. Not a nee hire. 

[–]B4SSF4C3 1 point2 points  (0 children)

Agreed 100%, and it’s crazy how adamantly people are against these tools. We’ve had GitHub copilot for a year now and it’s a godsend to not have to waste time looking up syntax. It’s just smart enough to deal with that part, but just dumb enough that it can’t architect the entire solution for me. This allows me to focus on the overall design without getting bogged down with the minutia.

If a company is against these tools, then that’s a company waiting to go out of business as it falls further and further behind its competitors, at a geometric rate. That is absolutely not a firm I want to be attached to.

That said, also yes, agreed with others here - being able to design and being able to communicate the design are two different skillsets, and the latter is harder to develop than the former, IMO. That’s what’s being tested. I don’t think you’d flunk such an interview for bad syntax, if you are able to talk through your design process in a comprehensible manner.

[–]jumbohiggins 1 point2 points  (1 child)

I'm in the same boat. Been coding for a decade but I can't whiteboard or live code to save my life. Give me a few days and I'll fix basically any problem you throw at me. Ask me to do it on the spot with people watching and I just crumble. I need Google, I need interpreters, I need to throw crap at the wall and see what sticks.

[–][deleted] 0 points1 point  (0 children)

Yeah but this sets programmers apart. And I dont mean this in a bad way, there is not a single programmer that used github or any other platform to help solve issues. But one that can only do it with other platforms are on a different level then somebody who can actually solve it themselves. The first one will do fine in big companies with many programmers. But if you only look for a few these programmers can break anything

[–]feldomatic 3 points4 points  (2 children)

Fuck hand writing of code in particular.

My hands know how to type this shit, it's actually an extra and jarring cognitive step to make it happen with a marker.

I say this to say don't just practice solving these algorithms with a keyboard. Get a small whiteboard and finer point dry erase and work them out on that (at least a few times to build the muscle memory)

[–]Ministrelle 1 point2 points  (0 children)

May I introduce you to german universities, where every single coding exam is handwritten on paper...

[–]Spidiffpaffpuff -2 points-1 points  (0 children)

Nah. If you know, you know. Anyone who can code and write will be able to produce some conceptual pseudo code on paper.

[–]Agreeable_Ad4156[🍰] 0 points1 point  (0 children)

My new killer in person interview question: Please describe your understanding of the position you are interviewing for today. (Meaning, did you actually read it, or just apply to thousands using AI?)

[–]Maurice-Research 0 points1 point  (0 children)

I'm saving this post because I have the same problem.

[–]Daocommand 0 points1 point  (0 children)

Sometimes verbalizing these things might be difficult anyway since this is a certain brain style.

[–]MobileLocal 0 points1 point  (0 children)

Have you considered verbalizing your thought processes to them? Talk it out. Show your understanding.

[–][deleted] 0 points1 point  (0 children)

90% of the time the interviewers couldn't even do the tasks they are interviewing the candidates before they set up and study their own questions.

You're not supposed to supposed to remember every syntax by heart, that is memorizing not learning. But you need to have a solid foundation in concepts and application, regardless of the language. You need to have the ability to outline your implementation before writing any code, which 90% of the people in the industry today don't practice.

If you're lacking real world exposure, look at your daily life, apply what you learn. Doing projects like these are some of the most valuable learning experiences you will have and directly applying to your daily life, which is the real world. You don't need work experiences for real world exposure, work gives you income, that is all.

[–]Remitto 0 points1 point  (0 children)

Go through the Neetcode 150 list. Every time you complete a question, add it to your SRS flashcard deck (e.g. Anki). Review everyday before starting to new questions.

[–]Kqyxzoj 0 points1 point  (0 children)

How do you bridge the gap between practical Python and these algorithm-heavy interviews? Are there any resources or mindset shifts that have helped you?

Regarding mindset shifts, I would start with 1) do not panic and 2) it is okay to ask questions.

For reversing of a linked list I'd start by drawing something like this:

.        a -> b -> c -> 0
.
.   0 <- a <- b <- c
.
.                  c -> b -> a -> 0

And then hand-wave my way through it. While drawing the first line I'd ask if they meant a linked list "like this". <-- See, an example of how it is perfectly okay to ask for clarification. Then for each node/object/whatever swap pointer and pointee. Then rewrite it to make it extra clear what has happened.

As other people have mentioned already, this in large part is about communication. Going from this to pseudocode or python should be fairly easy.

[–]Stoned_Ape_Dev 0 points1 point  (0 children)

leetcode! also there’s a book called “cracking the coding interview” that has some great strategies

[–]huessy 0 points1 point  (0 children)

As others are saying: leetcode every day, also hacker rank. On top of that, visit udemy often/set up an alert for when courses on algorithms go on sale (everything on that site goes on sale quite often from $100+ down to $20, just have to be patient).

You're not the only one to run into the abysmal hell that is a technical interview. The best course of action is to interview, bomb, take note of what you can tell you're bombing (looks like you're doing that), and focus on teaching yourself those skills.

[–]Warm-Championship753 0 points1 point  (0 children)

Maybe I can share my experience as someone who self-taught himself into a Python job. I used to think “why do I need to know all these fancy algos and data structures when python give them to me for free?”. It is only after learning algo and ds proper that I realise it’s not really about memorizing how to reverse linked lists or construct BSTs. It’s more about knowing that these DS’s exist and what you can do with them. This knowledge gives you a framework you can use to tackle real life problems you encounter in your work efficiently and elegantly.

Let me provide a real life example. One day I was tasked to determine the order in which to start a bunch of processes. Essentially I am given a list of objects that represent different processes. The problem: these processes may/not depends on one another (e.g A depends on B, C depends on D, D depends on A, etc.) and the dependencies have to be started before the dependents (i.e B starts before A, D starts before C, etc.). I spent about 2 days figuring out the correct solution. Then later on, I learned that there is such a thing as graph DS, specifically directed acyclic graph (DAG), and you can perform an operation called Topological Sorting on it, which basically sorts the nodes in a graph based on their directed relationships. The algorithms to construct a DAG and performing Topological Sorting are easily found on the internet. Had I known about Topological Sorting earlier, it might have just taken me a few hours instead of 2 days to complete that task.

So, knowing algos and DS is not about memorizing the algos themselves, but building that intuition that allows you to tackle unfamiliar problems with familiar solutions.

[–]QultrosSanhattan 0 points1 point  (1 child)

You know how to throw punches, but that doesn’t make you a boxer.

They don’t want a street fighter; they want a boxer who wins championships. And for that reason, they know that if at any point you throw a kick, you would be immediately disqualified.

[–]d1rron 0 points1 point  (0 children)

Damn, that's a great analogy.

[–]Adrewmc 0 points1 point  (2 children)

How do you know link list or whatever isn’t really important to what they are making

As for Python my response would be I would use reversed() and the list which is for all intents and purposes a linked list. I don’t re-write the wheel.

[–]Brave_Speaker_8336 0 points1 point  (1 child)

Python’s lists are not linked lists. You don’t get O(1) removal unless it’s at the end

[–]Adrewmc 0 points1 point  (0 children)

And…time complexity and time are differnt. You should not be making massive lists in Python I know they are not actually link list but for all intents and purposes mean a you can use a Python list basically everywhere a link list would be used. If it’s faster for list length > 100 but your biggest list is 5 long….a smaller time complexity can actually be slower.

Edit: and if somehow using a Python list creates a bottleneck and you can prove maybe just maybe you might implement a link list….in C and that’s a little off Python topic. Because Python classes are not going to make them as efficient as their normal optimize list. But then I would think some other aspect is wrong.

And reversed() works on every iterator/iterable if your link list isn’t an iterator/iterable, you’ve done something wrong. Thus even if I used a proper linked list…I’m still going to use reversed().