News for hackers. Stuff that matters.
Re:Stop Eliminating Perfectly Good Candidates by Asking Them... by hahamrfunnyguy on Saturday June 03, 2023 @11:32AM (#36177460)
I did recruiting for Full Stack developers for a number of years. I only gave two programming problems, one to be completed before an initial phone screen and one to be completed in the first part of the interview.

Myself and another team member worked on the questions, and we gave them to the team. Everyone was able to complete the exercises in a reasonable period of time, so we knew they weren't going to be too challenging.

Pre-screen question: For the numbers 1 to 99, print the number if its digits do not add up to ten. Otherwise, print the number and its digits 91 (9,1) if it adds up to ten. Download the file quiz.txt and use it a starting point for your program, keep it simple and make sure your output matches sampleoutput.txt exactly. When you've completed it, rename it to yourname.txt and email it to [email protected] with the subject of "Your Name: Completed Exercise".

A lot of people would just use convert the strings to numbers and then do the test to see if it adds up to ten, in this case I would kick it back to them and ask it to be solved mathematically. Usually, we'd get a response back right away with the "best" solution. Candidates that completed the exercise correctly and followed the directions got 15 minute phone screen to see if they had the technical background required.

For the in-person (or Zoom) interview question, we had a problem that required modifying HTML, CSS and JavaScript to come up with a solution. We stated this up front, and tell the candidates to use web resources to look up anything they need to. It also requires using modulus which they should already know (or figured out how to use!) in the screener exercise. If someone got stuck on something we felt they probably knew we'd give them some hints and they'd relax a bit. Most people solved it within 5-15 minutes, but there have been people that couldn't do it at all event with lots of hints.

In that case, we'd usually just end the interview and thank the candidate for their time.

From here we'd do some database exercises if their role called for database, and move onto an deeper assessment of technical background. That process worked well, and they're still following it today.

Re:Stop Eliminating Perfectly Good Candidates by Asking Them... by harshalizee on Saturday June 03, 2023 @12:06PM (#36177781)
Looks like I'd fail your pre-screen test. What's the "mathematical" solution if you're not allowed to convert strings to ints? Ascii math?
Re:Stop Eliminating Perfectly Good Candidates by Asking Them... by monkeyjoe on Saturday June 03, 2023 @12:25PM (#36177969)
I think it just means taking the input as an integer and then separating out the “ones place”and “tens place” using integer division and modulo operator. E.g.,

  ones = number % 10

  tens = number // 10

  do_print = (ones + tens) == 10
Re:Stop Eliminating Perfectly Good Candidates by Asking Them... by harshalizee on Saturday June 03, 2023 @12:39PM (#36178118)
That's what my solution after the parsing would be.

OP mentioned reading from a file, which you would only be able to use after string conversion to ints.

Re:Stop Eliminating Perfectly Good Candidates by Asking Them... by ProZsolt on Saturday June 03, 2023 @02:26PM (#36179197)
Maybe they didin't calculated the digits, like this:

if toInt(number) % 10 != 0

  print number  
else

  print number + "(" + number[0] + "," + number[1] + ")"
Re:Stop Eliminating Perfectly Good Candidates by Asking Them... by hahamrfunnyguy on Tuesday June 06, 2023 @09:32AM (#36212441)
Yes. This is the mathematical solution.
Re:Stop Eliminating Perfectly Good Candidates by Asking Them... by m3047 on Saturday June 03, 2023 @01:03PM (#36178349)
Not quite sure, and I'm not quite sure I care either. ;-)

However for any multiple of 9, the digits will add up to a multiple of 9. So you're looking for numbers in [ (n+2)*9 + 1 for n in range(9) ]

Re:Stop Eliminating Perfectly Good Candidates by Asking Them... by tomjupiter on Saturday June 03, 2023 @04:59PM (#36180468)
I think hahamrfunnyguy must have meant "convert the numbers to strings" - that's the only way I can make sense of it. quiz.txt must contain code, not sample data.
Re:Stop Eliminating Perfectly Good Candidates by Asking Them... by hahamrfunnyguy on Tuesday June 06, 2023 @09:29AM (#36212402)
Yes, quiz.txt was the start of a C# program with a main method and a function that was called to do the work asked.

The common string based solution was to use a for loop, convert the counter to a string, parse the digits converting each one to a an integer and performing the calculation.

The exercise was given in C# so candidates just use string interpolation to output the result