Live data from Hacker News

Python coding interview challenges

github.com

21–30 of 252 posts

Re: Python coding interview challenges

#21

I don't understand code challenges. Can you even program without Google and Stack Overflow anymore? And god-forbid being experienced in a dozen frameworks and libraries if it's not the exact combination the company uses.

Yes, you're expected to be able to write basic stuff like most of these challenges without Google or StackOverflow. There are some however here that you really shouldn't be, like remembering specific algorithms - if you're just memorizing 20 different sorting algorithm's exactly implementation, clearly that's not producing much if any value for you. If someone however was to give you this Algorithm section https://nb…

Why should I ever write a merge sort when there are libraries for that? What if I have a better understanding of some other aspect of your system that you fail to identify and which your team is sorely lacking?

Not all programmers are good explainers. Someone who speaks English as a second language might have difficulty articulating the differences between two terms despite being able to code circles around you.

One of the best programmers I know explained Object Oriented Programming as "Imagine everything is a thing".

Re: Python coding interview challenges

#22

Semi off-topic, but i am curious. How much of CS fundamentals do you expect a backend (or fullstack) developer to recite in an job interview? I did all CS theory stuff many years ago at university, but i could not pass a interview test full with these CS basics. Isn't it far more important to know how to design a modern, maintainable, scalable web application? Know how an when to cache stuff. How to design a API. How…

I think if you are fresh out of college, cute little algo challenges are OK.. because

a) You should have just learned it

b) You don't have years of experience with 12 languages

Anything past fresh college grad and they are pretty dumb...

Re: Python coding interview challenges

#25

Earlier quoted context omitted.

Yes, you're expected to be able to write basic stuff like most of these challenges without Google or StackOverflow. There are some however here that you really shouldn't be, like remembering specific algorithms - if you're just memorizing 20 different sorting algorithm's exactly implementation, clearly that's not producing much if any value for you. If someone however was to give you this Algorithm section https://nb…

Why should I ever write a merge sort when there are libraries for that? What if I have a better understanding of some other aspect of your system that you fail to identify and which your team is sorely lacking? Not all programmers are good explainers. Someone who speaks English as a second language might have difficulty articulating the differences between two terms despite being able to code circles around you. One…

> Why would I be expected to write a merge sort when there are libraries for that? That's silly.

Definitely, work samples are better, for sure and there are other puzzles on there that are probably more appropriate for a simple challenge.

In practice I'd almost never expect you to implement a sorting algorithm and I'd probably bitch in code review if you did. However, on rare occasion for optimization you may need to - if you can't implement mergesort when you are given the algorithm and offered assistance in understanding it that probably reflects poorly on your ability to implement other things too and maybe to implement in general.

> Maybe I have a better understanding of some other aspect of your system than your team does but your questions will almost definitely fail to identify that.

Maybe you do, and of course you ask these kinds of questions too, work samples should be a main focus, but I immediately get worried if someone can't solve a basic problem and can't discuss programming using shared terminology - it makes discussing these things quite difficult.

> Likewise, one of the best programmers I know once defined Object Oriented Programming as "Imagine everything was a thing". And someone who speaks English as a second language might have difficult articulating the differences between two terms despite being able to code circles around you.

I'm not expecting a specific perfect answer, just a basic answer in the right direction for a question like that. "Imagine everything was a thing" is in that direction, I'd inquire more of course, but that's a good start. As long as you have a useful understanding so that we can have a discussion that's good enough.

Re: Python coding interview challenges

#26

I don't understand code challenges. Can you even program without Google and Stack Overflow anymore? And god-forbid being experienced in a dozen frameworks and libraries if it's not the exact combination the company uses.

Yes, you're expected to be able to write basic stuff like most of these challenges without Google or StackOverflow. There are some however here that you really shouldn't be, like remembering specific algorithms - if you're just memorizing 20 different sorting algorithm's exactly implementation, clearly that's not producing much if any value for you. If someone however was to give you this Algorithm section https://nb…

I've been coding for 4 decades. There are so many different standard libraries and function calls to remember that only the people that are one-trick ponies (one ecosystem, deep knowledge) are going to be able to do the majority of these without an outside reference.

And those are exactly the people you would not want for a job because they would most likely not have the flexibility to shift away from that ecosystem if there was a need because it would take them forever to get up to speed.

It's much better to know how to use outside references efficiently and to be able to 'swap stacks' in a couple of weeks than it is to be an expert in some language that could very well be obsolete, and that's assuming that there are many jobs left today where deep knowledge of only one ecosystem will get the job done.

The time when you could spend 4 years learning a specific library and language and then make a career out of that is long long gone. What we have today is more akin to enormous libraries sitting on fairly rickety narrow foundations where - if you're lucky - the documentation of that library is relatively good, and the half-life of the whole thing is measured in months, a year at best. Today you work in Python, 3 months from now in Go and a another 6 months after that it will be JavaScript, typescript, clojurescript, coffeescript or .

So, you want to have your problem programmed in Assembler, C, C++, Python, PHP, BASIC (name your dialect), JavaScript, Erlang, Python or I don't care how many other languages that you care to name I'll accept the challenge. But I won't cut off my external memory bank in order to prove that that is something I can do.

(Well, truth be told I probably can do it in a couple of the above but that's mostly because there was a time when the world moved slow enough that you could actually invest a couple of years, but these days it is much better to know how to leverage open source and google than it is to know the gritty little bits of whatever language is in flavor this week.)

Of course, if you are looking for 'javascript programmers' it is fair to ask some questions about javascript. But in my experience it is a lot more efficient to search for programming talent and good debugging and writing skills irrespective of what language they are currently trained in.

Languages are a means to an end, programming is the skill you want, not 'a particular language programmer'.

Re: Python coding interview challenges

#27
I see these challenges as a great way for excellent experienced developers to weed out incompetent companies.

I'm a kick-ass get-things-done full-stack web engineer. I've never had to deal with one of these sorts of problems in my day to day work; and if I did, I'd just find an existing, tested, stable library that already handled them.

A company that needs someone to solve these sorts of problems doesn't want me on their team in the first place, nor would I thrive there. A company that just needs to build damn good web apps is losing out by using these sorts of questions in their interviews.

The best interview challenge I've had (actually, it was a take-home, with discussion in the interview proper) was about designing code for re-use and extension. It was a great indicator of the company's practical and mature approach to engineering, and of what they really wanted this hire to accomplish.

Re: Python coding interview challenges

#28

The advent of all of these coding challenge excercises makes not being able to do one in an interview a real show stopper. Glad there's all this material to learn from.

Not really. If anything it just makes coding challenges useless for distinguishing between people who can think, and people who can regurgitate. It's one thing to "know" how to balance a binary tree because you've read up on and practiced the most common challenges - it's something else entirely to actually think through and understand a problem, then come up with a solution. I'd much rather have someone who can desc…

>It's one thing to "know" how to balance a binary tree because you've read up on and practiced the most common challenges - it's something else entirely to actually think through and understand a problem, then come up with a solution.

There are too many things to know in the world in order to be able to know them all as deeply as we wish. For the things that we can get away with knowing the most common aspects of, time might be better spent elsewhere than to learn more about that thing.

Re: Python coding interview challenges

#29

Earlier quoted context omitted.

Yes, you're expected to be able to write basic stuff like most of these challenges without Google or StackOverflow. There are some however here that you really shouldn't be, like remembering specific algorithms - if you're just memorizing 20 different sorting algorithm's exactly implementation, clearly that's not producing much if any value for you. If someone however was to give you this Algorithm section https://nb…

I've been coding for 4 decades. There are so many different standard libraries and function calls to remember that only the people that are one-trick ponies (one ecosystem, deep knowledge) are going to be able to do the majority of these without an outside reference. And those are exactly the people you would not want for a job because they would most likely not have the flexibility to shift away from that ecosystem…

I completely agree - that's why I encourage only sticking to basic questions and accepting fairly vague answers as long as they're in the right direction. Maybe your python knowledge isn't perfect, but you know how to solve it in another language. I'm good with that. Maybe you don't know the exact name of a data structure in the python standard library, as long as you can describe what you're looking for I'll point you in the right direction.

The people who don't know when to use a hashmap instead of a list of structs are the ones who concern me. So are the ones who just can't get started at all.

Sure, platforms change, languages change, but basic data structures don't, and basic OOP doesn't either. You've probably worked with many of the same data structures on many of those platforms and have a working understanding of OOP that you can describe - maybe not perfectly, but well enough.

Re: Python coding interview challenges

#30

I'm a C+/B- developer. I've been doing this stuff for touching two decades, and these questions gave me a prickly sweat down my back. There is a part of me that feels very lucky to have plopped onto the Earth right when I did, before there was an organized process to weed me out. I'm entrenched enough that interviews are generally just culture fit interviews. I think I'd need ulcer medicine to get a job with no reput…

Consider trying Codewars. Their kata problems are a mix of algorithms but also things like standard library mastery or functional techniques. Personally I find it a lot more enjoyable than "interview style" algorithms questions.
Post reply on HN