Hacker News new | ask | show | jobs
by rfreiberger 1684 days ago
So I'm a mostly self trained low level programmer and found Project Euler is great but there is a level of math knowledge that left me more puzzled on the formulas than actual coding. Is this something I should focus on as someone learning to code, or the other coding puzzle sites with "linked list" type of challenges are just as good.
5 comments

No, you shouldn't focus on this. PE is _mostly_ a math site, which if you want to learn that is great, but it's not the same as programming.

What other sites are you looking at? I don't actually know that I'd recommend any puzzle sites to a new programmer. The ones I know of are for fun, not for improving your software dev skills.

A friend of mine applied to Amazon, and they told him he should do the first ~100 problems of Project Euler to prep for the interview. As someone who is not at all advanced in math, I found this to be fairly discouraging. I feel like I’m a reasonably strong programmer without advanced math knowledge, and not sure why it would be necessary for a general dev job.
You don't need a lot of math knowledge for the first 100 problems of Project Euler, but you do need some aptitude and problem solving ability (rather than knowledge per se). I think getting all 100 has to be pretty hard even if you are good at math. The first 20 or so are pretty doable. They get harder after that. I do know of some people who have gotten them all way beyond 100. I lost interest long before that.
You're likely to get stuck on https://projecteuler.net/problem=66 if you don't know about https://en.wikipedia.org/wiki/Pell%27s_equation.

As someone with a math background, that was the only problem in the first 100 that I didn't find pretty straightforward.

Thanks, I think I see how to do this, but I haven't tried coding it yet. It is a cool problem and a quick script shows the dumb brute force approach starts failing at d=61. I will try coding my trick to see if it works, if I get some time.
Haha true. I got stuck on that problem for a few months before I gave up and started researching the math behind it.
That sounds like pretty bad advice. Does Amazon really ask interview questions based on those? I'd be very surprised if they did. Competitive programming problems as interview requirements are bad enough (don't get me wrong, I find the problems fun, they just don't have much to do with software dev).

But yeah, as a good programmer with a job at a large company, you _definitely_ don't need to do 100 PE problems, and any company asking for that (for general software dev role) has lost their mind.

I would say if you take a room full of programmers and select only the ones who managed to do the first 100 PE problems, you'll lose a lot of good ones that way. But all the ones you do select are almost sure to be pretty good, so in that regard it is an effective filter, plus then you get to complain about a lack of candidates and lobby for more tax breaks or whatever.
I think it’s more that the good ones you lose would be perfectly capable of doing the first 100 PE problems, they just have better things to do.
Maybe true, but you only have to worry about that if there are none left after your filtering operation. You are not trying to mine gold (find as many small nuggets as you can of a very rare substance among millions of tons of dirt). You are trying to find exactly N nuggets for some small N, that is the number of open slots you are trying to fill. If you can replace megabucks of excavation equipment (time-consuming interviews) with a simple screen (solve 100 PE problems) and N nuggets get through, you have saved yourself a lot of trouble.

Add to that, FAANG interview processes are mostly risk avoidant. They are more aimed at avoiding hiring bad candidates, than avoiding ignoring good ones. It is very often possible for a weak candidate to bullshit their way through interviews etc. Solving PE problems is harder to fake, at least without faking on purpose (by reading up on spoilers).

From my understanding, Amazon's teams have a lot of autonomy so I wouldn't be surprised if a team took that approach.

Also (and this includes Amazon) I've never had anyone on a loop/hiring manager tell me how to prep for an interview. That has entirely been the recruiter.

Maybe it’s more about culture than skills? I’ve solved 80 PE problems (78 of which are in the first 100) because I enjoy it, and I’m pretty sure that I would get along very well in a team full of others who enjoy PE enough that they voluntarily solved >50 problems. Maybe the goal of that advice is to discourage people?
That’s awful actually. If it’s actually relevant to the job that’s one thing, but if it’s about selecting for areas of extracurricular interest it’s inherently excluding qualified people and implicitly harming your team by limiting present perspectives.
For SDE? This seems like strange advice to me.
I hope they’re paying him for all the time he’s gonna spend doing these exercises
You may find Advent of Code a better fit than Project Euler if the intent is to focus on coding rather than math.
Definitely, though some of the AoC challenges are pretty mathy too, or at least benefit from some basic knowledge around combinatorics, factoring, etc.
Or contribute to Hacktober fest.

Or meet fellow devs at meetups and get into open source.

Or meet people at a local hacker space.

Basically, developing requires people to inject interesting projects and perspectives at you.

Yes. Coding requires social skills. I'm not taking that back.

They seem to be interested in short-form programming puzzles, I don't really see how your comment applies to that.
Open source projects and hacker spaces offer just so much more than short-term projects.

I expect you to tell me you're well versed in both, but don't expect me to believe you.

I don't know why you've decide to compare these things and get immediately hostile about it.
Eh, not a lot of hacker spaces here in Silicon Valley. Don't know about the state of affairs in OP's location.
If you’re learning to code try build stuff (unless you enjoy project Euler style challenges - enjoyment is the priority). Trying to model the inventory system of Skyrim or something is more useful in the long run than puzzles, IMO. When you find something feels wrong with your design; that’s when you start identifying new and better data structures.
I agree it’s more fun creating your own little games or problems to solve. Someone posted an elevator coding game here a couple months back[0]. Those are more fun to me. I found Euler too math-heavy and I spent most of my time in Wikipedia trying to understand the question.

[0] https://play.elevatorsaga.com/

There's no real need to know so much math for most professional programming jobs. Math problems tend to be over-represented on challenge sites because they are easy to implement.
Maybe checkout Advent of Code instead. Less mathy, more fun (IMO).