Live data from Hacker News

Can you solve it? The Greplin programming challenge

challenge.greplin.com

141–150 of 167 posts

Re: Can you solve it? The Greplin programming challenge

#141
numbers ="3,4,9,14,15,19,28,37,47,50,54,56,59,61,70,73,78,81,92,95,97].split() numbers = [int(i) for i in numbers]

def sum_eq(lst,k): total = sum(lst) if total == k or k==0:return 1 elif total def sum_all_eq(lst): total = 0 for k in range(1,len(lst)): total += sum_eq(lst[0:k],lst[k]) return total

Re: Can you solve it? The Greplin programming challenge

#142
post #23

So what languages did everyone use? I decided to try a different one on each level, so I used Python, bash (letting GNU coreutils 'factor' do the hard work), and Haskell, respectively.

k, javascript, javascript

None of my solutions were particularly elegant :-)

Re: Can you solve it? The Greplin programming challenge

#144
post #23

So what languages did everyone use? I decided to try a different one on each level, so I used Python, bash (letting GNU coreutils 'factor' do the hard work), and Haskell, respectively.

Python for 1,2 with a little bit of manual pasting into wolfram alpha

And for part 3 I used prolog. About ~6 lines or so.

Re: Can you solve it? The Greplin programming challenge

#145
Here's mine: http://gist.github.com/618459

I didn't see the point in doing this in anything but C. I tried it without cheating, and to make it as interesting to myself as possible. Also did it after a week of writing briefs, so that was a nice way to unwind from that! Pretty Fun.

Anyway, if I'm applying for a job (which I wasn't), the last thing I'm going to do is send in a bunch of one-liners.

Re: Can you solve it? The Greplin programming challenge

#146
IMHO, these contrived puzzles, while fun, are really unrealistic and don't map well to problems you'll encounter on the job which requires knowledge, experience and creativity and do not have just one answer.

Of all of the jobs-page challenges, thesixyone's is probably the most practical and I've seen:

http://www.thesixtyone.com/static/jobs

Re: Can you solve it? The Greplin programming challenge

#147
post #127
post #23

So what languages did everyone use? I decided to try a different one on each level, so I used Python, bash (letting GNU coreutils 'factor' do the hard work), and Haskell, respectively.

Perl. From the look of this thread, I guess everyone else has moved on?

I solved all three in Perl 6... ;)

Re: Can you solve it? The Greplin programming challenge

#149
Problem 1: 2 minutes for 5 lines of PHP code. Problem 2: 1 minute of Google and Google (why reinvent the wheel?). Problem 3: half a minute of brainwork, 15 minutes worth of tedious PHP snippet.

I got the impression that this particular test was not a good one for finding apt programmers. The questions and the solutions were just so very "off".

Re: Can you solve it? The Greplin programming challenge

#150
post #26
post #25

"Even if you're not looking for a job, we'd love to hear what you thought about the challenge." I would be curious how many people did you lose because of phonecall requirement (before you changed it). Also CSV for just a list of 22 numbers wasn't really necessary. If you do web puzzle, the best is to keep everything self-contained, no downloads, no using external channels, just copy and paste. FYI another Python che…

I don't think trivializing the combinations with Python's builtins, looking up the fib primes with OEIS, or computing factors with Alpha is cheating. I hope, in fact, it's the whole point of the exercise: choose the right tools for the job. If you're writing code to test primeness or generate Fibonacci numbers, I sure as hell don't want to hire you.

I wrote extremely naive Ruby algos from scratch that solved the problems in a couple seconds, or in the case of the last problem, a couple of minutes. I'm sure the whole challenge would have taken longer if I tried to use any dependencies.
Post reply on HN