News for hackers. Stuff that matters.
Re:Luhn Algorithm for validating credit cards by justinzollars on Thursday July 02, 2015 @11:44PM (#9823326)
This was an interview question at both Square and Braintree. Its weird that interview questions trend from year to year.
Re:Luhn Algorithm for validating credit cards by easytiger on Friday July 03, 2015 @03:20AM (#9824027)
It was also on the UK GCSE IT syllabus when I were a lad. The IT syllabus was actually incredibly good. I get very sad when i see the state of the modern one.
Re:Luhn Algorithm for validating credit cards by Osmium on Friday July 03, 2015 @06:02AM (#9824584)
Speak for yourself. I found the GCSE IT syllabus absolutely atrocious (this was 10ish years ago). I do remember this though, so that's something, but broadly speaking it was awful. And I mean truly, truly awful. I find it difficult to put into words. I'm so glad they're actually starting to teach programming now.
Re:Luhn Algorithm for validating credit cards by easytiger on Monday July 06, 2015 @04:14AM (#9837558)
When did you do it?
Re:Luhn Algorithm for validating credit cards by Osmium on Monday July 06, 2015 @05:56AM (#9837923)
Around 2004/2005 I think. I'd always been interested in computing, and wanted to learn some programming. I'd seen these posters up with BASIC code on them and naively assumed that's the kind of thing we'd do, only to turn up and literally to given print-outs going step-by-step how to use a word processor. "Click Start" (screenshot), "Move the mouse to Programs" (screenshot), etc. It was completely demoralizing for someone young and curious. And the teacher had zero interest too--no desire to hold a conversation or explain anything. (Not sure what those BASIC posters were about after, maybe that was for A level students).

I understand that perhaps you wouldn't teach programming in ICT, but I'd at least have hoped to learn more about computing generally. The whole thing was just a very sad experience. No one there learnt anything new. Most spent their time playing games or being bored.

The only good thing it taught me was that I was better off teaching myself when it came to computing, at least given the alternatives available to me back then.

Edited to add: The sad thing, for me, is that I chose ICT over a foreign language (I couldn't do both in my school), while I was then top of my class in German and would've liked to continue it. But I didn't, and I'm mildly irritated about that to this day--I'm only now picking up German again. My school offered very little guidance, all things considered, but I took it for granted at the time that that's just how the system worked.

Re:Luhn Algorithm for validating credit cards by alextgordon on Friday July 03, 2015 @03:45AM (#9824125)
Huh? GCSE ICT was about learning to use Microsoft Office.
Re:Luhn Algorithm for validating credit cards by jmkni on Friday July 03, 2015 @04:46AM (#9824347)
Same here, I did mine in 2005 and it consisted largely of Microsoft Frontpage...
Re:Luhn Algorithm for validating credit cards by easytiger on Friday July 03, 2015 @07:33AM (#9824825)
yea.. in the 90s it was much better
Re:Luhn Algorithm for validating credit cards by mdaniel on Thursday July 02, 2015 @11:57PM (#9823363)
To implement it or describe what it's for?
Re:Luhn Algorithm for validating credit cards by eli on Friday July 03, 2015 @01:27AM (#9823687)
I was asked to implement it on a whiteboard for a developer gig at an ad agency in like 2009. I thought it seemed disproportionately hard compared to what the job was likely to require.
Re:Luhn Algorithm for validating credit cards by InclinedPlane on Friday July 03, 2015 @02:46AM (#9823921)
Really? It seems like a trivial programming exercise to me.
Re:Luhn Algorithm for validating credit cards by cbd1984 on Friday July 03, 2015 @05:30AM (#9824478)
It's trivial if you are told what the algorithm is. If you're expected to randomly remember it perfectly and implement it that way, it's hard.
Re:Luhn Algorithm for validating credit cards by InclinedPlane on Friday July 03, 2015 @07:12PM (#9828407)
Certainly. That's a very poor interview process.
Re:Luhn Algorithm for validating credit cards by jarcane on Friday July 03, 2015 @03:38AM (#9824097)
I've actually done it myself for fun in Haskell; it's one of the CodeWars challenges.
Re:Luhn Algorithm for validating credit cards by justinzollars on Friday July 03, 2015 @02:42AM (#9823910)
implement in both cases, after a clear definition.
Re:Luhn Algorithm for validating credit cards by mikekchar on Friday July 03, 2015 @03:53AM (#9824156)
It's one of our interview questions too... I swear we did not get it from Square or Braintree. Very wierd.

It's a nice one because it is easy to understand and you can TDD it fairly easily.