Live data from Hacker News

Python coding interview challenges

github.com

41–50 of 252 posts

Re: Python coding interview challenges

#41

Earlier quoted context omitted.

sum([5,6]) ?

The sum built-in is still using the addition operator with syntactic sugar though (as is the other child comment). I think the intent of this question is to solve it with bitwise operators ie, [1]. [1]: http://stackoverflow.com/questions/17342042/why-this-code-fo...

If you're going to have to argue about the 'intent of the question' then you've already lost.

Really, the question should be 'add these two integers' and any solution that produces the result in a transparent and straightforward way should be honored with top marks.

Trick questions, especially those where only the interviewers pet solution is permitted are a sure sign that this employer is best avoided because they care about form and ego more than they care about getting the bloody job done.

Re: Python coding interview challenges

#42

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…

It's not about actually having to implement these algorithms in your practical, day-to-day work. It's a challenge to test your reasoning and problem-solving ability in abstract, that you can administer in 15 minutes. You can't really test a candidate with real-world workloads, can you.

Re: Python coding interview challenges

#43

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…

> 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 do you do that without some basic understanding of computer science-y stuff?

How do you define "scalable", how do you measure it? How can you have some intuition about a design before we spend 3 months and many sprints building it first?

How do I know when to cache stuff? Does it matter if I have calls to a remote cache in a tight loop? Should I be using an in-process, out-of-process, or remote cache for a particular piece of data?

Here's one that comes up A LOT with junior and mid-level developers: floating point numbers aren't magically precise things.

There's a balance here, somewhere. I personally would never use the trivia questions in the OP. But the idea that you don't need to know even basic computer science-y type things, seems crazy to me.

I can't see myself hiring a computer programmer who is offended by being expected to have a casual acquaintance with computer science.

Re: Python coding interview challenges

#44

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…

I agree that these interviews are often just an annoying rite of passage, and they exclude many very talented programmers, but dismissing companies that use them as 'incompetent' seems like a stretch to me.

Learning basic data structures & algorithms is an immensely useful thing for a programmer, and completely essential in many cases. The best of these puzzles are based on problems which people have had to solve in the real world. For the companies, there are many benefits to conducting algorithms interviews:

- setting a minimum standard to make sure there is a shared language and knowledge that you can expect any engineer in company to know.

- making sure you are able to do more than trivial optimisation and go beyond the abstractions that libraries / frameworks provide

- giving you a simple problem to solve in 30 minutes to see if you can program at all.

Re: Python coding interview challenges

#45

From what hear about some startups, the challenges are for the general candidate pipelines the company wants to weed out w/o fearing legal repercussions. The inside-track, friends, and frat candidates often get to skip right through the process or have copies of the problems/answers from insiders. (Illusion of merit.)

I think this view is a little bit cynical. Hiring your friends which usually happens in the early stages is often more about having worked with them before or having them come in based on a recommendation / knowing they're a culture fit ahead of time etc. It's a way for small startups to spend less time on hiring, and increase their chances of getting talent that they couldn't necessarily attract on the broader market in the early stages.

Re: Python coding interview challenges

#46

In a way I prefer this to "how many ping pong balls can fit in a school bus" that was all the rage in the 90s and early 2000s. But... man... I have a computer science degree, I've been coding for 20 years, and I've held (and kept) a CTO role at two mid-sized startup companies. Currently I'm considering looking for a job at a larger company (where I wouldn't be CTO but I'd be hopefully paid more) and these kind of que…

I agree. To find out if one is actually competent, open questions that allow the candidate to elaborate on his previous problem solving experience are much more useful.

Some examples:

1) Explain how and why you would implement authentication on a HTTP API. What other authentication methods do you know and why would you not use them?

2) Tell us about a scaling-up challenge/problem you had on your last application and how you solved it.

3) What technology stack would you use for a browser-based P2P file sharing application?

4) Name a library you recently discovered. What problem did it solve?

5) What mobile app on your phone right now has a bad user experience in your opinion? How would you make it better?

Re: Python coding interview challenges

#47
post #42

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…

It's not about actually having to implement these algorithms in your practical, day-to-day work. It's a challenge to test your reasoning and problem-solving ability in abstract, that you can administer in 15 minutes. You can't really test a candidate with real-world workloads, can you.

You absolutely can test a candidate with real-world workloads. It takes longer than 15 minutes, though.

I have no idea why anybody cares about the 15-minute thing. Each person you hire adds thousands of hours to your available labor. So even if I spend 100 hours finding the right candidate, I'm still way ahead. And the better my working environment is, the lower my turnover, in which case I can spend even more.

Re: Python coding interview challenges

#48
post #42

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…

It's not about actually having to implement these algorithms in your practical, day-to-day work. It's a challenge to test your reasoning and problem-solving ability in abstract, that you can administer in 15 minutes. You can't really test a candidate with real-world workloads, can you.

> You can't really test a candidate with real-world workloads, can you.

But you can test a candidate with imaginary non-workloads?

Re: Python coding interview challenges

#49

Earlier quoted context omitted.

Indeed. A couple of weeks ago I had a recruiter from Atlassian send me an email saying they were interested an could I complete these 6 problems on Hacker Rank and each challenge has a time limit. Its not enough to outwit a Burmese Python but you need to do it while a clock is ticking. We all know the best performance and indicator of skill always comes from coding with an egg timer or stop watch. Oh and did I mentio…

These companies carrying water for Hacker Rank and their ilk ought to be totally ignored. Programming is only a competition sport when it is voluntary, no need to turn access to a job into some kind of Christians versus the lions spectator sport. If someone were to approach me with that kind of offer I think the response would not be much longer than one line (and I'd try hard to keep it polite).

>"These companies carrying water for Hacker Rank and their ilk ought to be totally ignored."

Yeah, I just deleted the email.

In the case of Atlassian and some others I have seen recently, the job of the recruiter now seems to be sending out links to hacker rank challenges after a successful key word search on a candidates C.V. I imagine recruiters love this because it means they now have to understand even less than the little they understood before.

Re: Python coding interview challenges

#50

Earlier quoted context omitted.

I agree 95%. However, inevitably there will be a developer that will want to implement a trie for reasons. It's hard to be able to reason with her (or technical leadership when appealing the decision) when advocating for an off the shelf alternative if you can't explain why this isn't a brand new problem. On the flip side, one actually does need to create a new data structure on occasion, and obviously there we would…

If I need to convince another developer that a particular path is well-worn and that they are drifting towards NIH syndrome I have the benefit of time to develop an argument and resources with which to do so. I do not have 45 minutes, no resources, and just a whiteboard. To pre-counter an expected objection, if your company makes significant decisions like that in a single 45-minute (or any length, really) meeting yo…

> I have the benefit of time to develop an argument and resources with which to do so.

One would assume so. That's not always the case in my experience. Improvisational discussion of design tradeoffs and costs happen a lot. YMMV, I guess.

Though I agree that no-google, closed-book, no-IDE whiteboard development is very unnatural.

> ...if your company makes significant decisions like that in a single 45-minute (or any length, really) meeting you need to change your design process, not your hiring process.

I'd agree with that, but design processes on the whole tend to more dysfunctional than organizations realize. There's still a lot stuff running on deprecated OSs, dead languages, and mountains of technical debt.

Post reply on HN