Live data from Hacker News

Project Euler

projecteuler.net

101–110 of 138 posts

Re: Project Euler

#102
post #63

Earlier quoted context omitted.

When I was conducting quantitative interviews I ended up doing the same thing. One of my favorite problems to give was 267 ( http://projecteuler.net/problem=267 ). It has a few "aha" moments but also requires coding to get it done.

Is there a list with Project Euler problems that focus less on number theory like this one?

A lot of Project Euler is very "mathy", requiring you to read up on some mathematical shortcuts - I think https://www.hackerrank.com/ is a bit more CS-focused, i.e., there's always a specific data-structure or algorithm that solves the problem.

Re: Project Euler

#103
post #89

Earlier quoted context omitted.

I liked the sound of leetcode, but I see the way to answer is with code (C++/Java) instead of a value answer. That ruins it for me. I want to play with new programming languages, and see if the output is correct while I'm at it.

That's true. Another one mentioned in this thread is hackerrank: https://www.hackerrank.com/ - this one offers way more languages, except for rust, the one I'm actually learning :(

I saw that and just registered/tried.

Although it has Clojure (my target language), you still send code instead of an answer, and you get problems like not knowing what's available in terms of libs and whatnot.

Re: Project Euler

#104
post #70

Earlier quoted context omitted.

What we need now is more focus towards females. Men are already sufficiently saturated in the maths/CS fields. What we need is to market the idea of maths as fun to more females.

As a female math grad and CS postgrad, I would like to say firstly that you have successfully trolled me. I do hereby take your bait. Now for the points I would like to make, primarily for the benefit of the few who actually think as you claim to think: Women are actually similar to men in a number of novel ways. We have eyes, and those eyes are intricately connected to very powerful and compact organic computers—cap…

Seems like you're promoting some myths as well.

Kids don't magically decide that math or science or computer programming is fun. They're heavily influenced by what they're exposed to and what they see other people they respect doing. Yes, that's "marketing" or perhaps better call it education.

And no, giving a kid the "C programming language" isn't going to cut it unless they've previously had enough exposure to math or engineering to understand why it's interesting. (Based on what I've heard, Minecraft seems to be working a lot better.)

Re: Project Euler

#105
post #70

Earlier quoted context omitted.

What we need now is more focus towards females. Men are already sufficiently saturated in the maths/CS fields. What we need is to market the idea of maths as fun to more females.

As a female math grad and CS postgrad, I would like to say firstly that you have successfully trolled me. I do hereby take your bait. Now for the points I would like to make, primarily for the benefit of the few who actually think as you claim to think: Women are actually similar to men in a number of novel ways. We have eyes, and those eyes are intricately connected to very powerful and compact organic computers—cap…

[deleted]

Re: Project Euler

#106
post #70

Earlier quoted context omitted.

As a female math grad and CS postgrad, I would like to say firstly that you have successfully trolled me. I do hereby take your bait. Now for the points I would like to make, primarily for the benefit of the few who actually think as you claim to think: Women are actually similar to men in a number of novel ways. We have eyes, and those eyes are intricately connected to very powerful and compact organic computers—cap…

Seems like you're promoting some myths as well. Kids don't magically decide that math or science or computer programming is fun. They're heavily influenced by what they're exposed to and what they see other people they respect doing. Yes, that's "marketing" or perhaps better call it education. And no, giving a kid the "C programming language" isn't going to cut it unless they've previously had enough exposure to math…

Okay, perhaps I am being subjective. I got into this stuff on my own, maybe exposure makes a difference for some. But let's face it, there's no objective reason why math/compsci/engineering should be interesting even after you understand it. It's not like you can just explain it x many times and suddenly a girl will be like "wow it's so amazing and deep and clever." You and I may appreciate it, but can you say why? Can you give me the fundamental reason why it should be interesting as a matter of fact? Besides, we're in the 21st century. Girls can expose themselves to whatever they want. I don't think programming and calculus are terribly obscure.

Re: Project Euler

#107
post #85
post #29

The best technical interview I ever had involved picking a random Project Euler problem in the hundreds and pair-programming our way through it. The CTO wrote his version in Python and I worked in Perl . . . he was astounded mine ran 8x faster. The same company also had regular hack night where everyone drinks a lot of Tecate, agress on a Project Euler problem and a language no one knows, and races. Fun times.

Sounds neat, but doesn't sound like pair programming to me. Sounds like you designed a solution together and then went and coded it separately? Or did you each code up the solution in front of each other? If so, a fairly interesting thing there would be if the person coding in Python was driving the other, and vice versa for Perl. Then again, that could be very annoying if the person didn't know how to type the langu…

We were pair programming with myself in the driver seat, so to speak. I didn't code Python fluently and he didn't code Perl fluently, so we just implemented the same logic in our respective dialects.

Edit: http://projecteuler.net/problem=98 was the problem, so it wasn't in the 100's like I misremembered.

Re: Project Euler

#108
The best and worst thing about project Euler is the binary feedback they give you: either you pass or you fail.

On the one hand, it is a good lesson in how hard it can be to write correct code.

On the other hand, real world problems aren't black boxes where you try an integer until you get the right one. Problems with multiple tests needed to pass (like topcoder) are much more realistic.

Re: Project Euler

#109
post #99

Earlier quoted context omitted.

> a large time commitment No. Solving the first 12 PE problems should not take a competent programmer more than 30 minutes.

Well, I just did it. It took me about 35 minutes. I am terribly, terribly old (43 years) but I'm pretty sure I am a more than competent programmer and I have a very strong mathematical background. I was working on a laptop but a reasonably decent one, in an environment less distraction-free than an interview room but still not bad. I didn't particularly go all-out for maximum speed but wasn't gratuitously slothful. I…

I had almost the same exact result as you. It did take me a little over 30 minutes. I finished with 125 lines.

Duly chastened, I take it back. But if the numbers were changed to 8 problems, and 1 hour, I still don't think that's unreasonable.

Re: Project Euler

#110
post #29

The best technical interview I ever had involved picking a random Project Euler problem in the hundreds and pair-programming our way through it. The CTO wrote his version in Python and I worked in Perl . . . he was astounded mine ran 8x faster. The same company also had regular hack night where everyone drinks a lot of Tecate, agress on a Project Euler problem and a language no one knows, and races. Fun times.

When I was conducting quantitative interviews I ended up doing the same thing. One of my favorite problems to give was 267 ( http://projecteuler.net/problem=267 ). It has a few "aha" moments but also requires coding to get it done.

It surprises me that there's a unique 12 digit answer to this. If you bet proportion f of your income every round, then if you win n coin flips, shouldn't you have (1+2f)^n (1-f)^(1000-n) £? For a given f, it takes a certain number of heads for this value to exceed 1B£, but I'd expect a range of f values that all require the same minimal number of heads results to break 1B£. Unless there's a value of f that produces exactly 1B£ for the minimal needed number of heads (or the set of such f differ only after 12 digits). That seems unlikely...

EDIT: Just realized that the problem asks for the odds of being a billionaire, not f. So there are probably a good number of f that work, but they all produce the same odds.

Post reply on HN