Hacker News new | past | comments | ask | show | jobs | submit login

>I have prompts that test very basic concepts and nearly everyone fails. Resume fraud is rampant.

It is crazy how many people will fail a question that boils down to 'write a for loop' despite going to college for 4 years in CS.




I'm a little bit more demanding. I want people to write a loop with a loop in it. I've had too many candidates that can write a single for loop, but get so beyond mixed up when there's a loop inside a loop.

I do a fairly simple encode/decode problem (run length encoding). I describe the basic encoding concept, provide a sample input that should have byte savings with any reasonable encoding, and have the candidate come up with what the output should be. There's lots of ways to do the encoding, mostly anything works (and I'm clear with the candidate about that)... I allocate about 15 minutes for this stage; I've got lots of hinting strategies to keep clients from getting stuck here... but if it's not clicking, I'll give them a simple format to move on.

Then the candidate writes the decoder; decoding is easier; some candidates get really stuck on the encoder and I'd rather have a code sample than a stuck candidate. Some of my worst candidates have already forgotten the encoded format that they just designed, and they write a decoder that might work on some other encoded input, I guess. Hopefully this takes 10 minutes or less, but if you can't write a loop in a loop, you might get pretty stuck. I don't care about the language used, it doesn't even need to be a real language, it just needs to be self consistent and reasonable; i/o comes as easiest for the candidate.

If we've got 15-20 minutes left, the candidate can work on the encoder. The encoder trips up a lot more people than the decoder; so I stopped having people work on that first.

There's plenty of options for discussion at any point. Could you make the format better for some cases, could you make it work in a resource constrained system.

The specific problem isn't really day-to-day work, but it's approachable and doesn't require much in the way of data structures or organization or prior domain knowledge. Some candidates express that they had fun doing my problem, and especially for junior candidates, if they've never done compression exercises, I hope it is an opportunity to see that compression isn't always magic; simple compression is approachable.


I'm genuinely curious about what this challenge looks like exactly. I know you probably can't share it but are there any analogous code challenges/problems out there that you can? It sounds interesting.


It's very similar to this https://www.geeksforgeeks.org/problems/run-length-encoding/1 Although I present it a little differently, and don't provide a format / don't require the value, count format (although it's fine enough)

I'm happy to answer more questions via email in the profile.

Example input would be something like

    55 55 55 55 20 32 56 3F
    3F 3F 3F 42 42 61 61 61
Values chosen "randomly" by me, not intended to have any meaning. Pattern is more intentional, although this isn't my best pattern; I haven't run my interview in a long time, I had a nicer pattern I think, but can't remember it. All of my input happens to be bytes less than or equal to 7F (although in the interview setting, I don't mention that unless asked...) and not equal to 00. If candidates don't understand hex bytes, that's fine, even if it makes me a bit sad inside. When they get to coding, I'll give them in() that returns the next value from the input, and out(...) that outputs the next value. Etc.

To set people up, I tell them we're going to do some compression today with an encoding called run length encoding; in run length encoding we encode the length of a run and its value. (If they're familiar and ask questions, I tell them today, we're focused on bytes... you can do it with bits or larger than bytes, whatever, but keeping it focused on bytes makes the problem fit into a 45-minute interview slot)

There's lots of ways to make an RLE format, if you go with the basics like (count, value), or (value, count) and we have time to explore, I'm going to ask about the sequence 20 32 56; it doubles in size with that format, so what can you do to make that better while still doing a good job overall on our example stream. Lots of options, all of them are fine as long as you can decode it correctly. The basic one is fine too, if we don't have time to explore.

When using this problem, I feel like I give more thumbs up than others on my teams; but I feel really confident in my thumbs downs, and I feel I gave everyone a fair chance. I've had a few people do really poorly that just seemed nervous, and I tried to pivot towards more of a buddy problem / build their confidence / try to get them less nervous so they can do a bit better for the rest of their day.


Thanks, I'm going to work through this just because I'm curious about it.


Sounds good. If you get stuck for more than a few minutes, take a break and come back or send me an email. There's lots of small hints available to get you unstuck. (Benefit of using the same problem for a long time)


I have a pet problem that is also solved with a pair of nested loops. I had one candidate use infinite loops and a bunch of convoluted logic to manually move the index around (a single index).


This problem sounds interesting. Is the implementation language C? Given the constraints that’s my first guess.


Whatever language you want. I don't care as long as the syntax makes sense, or you can explain it enough to get me through.


Why does the implementation language matter?


If a CS grad can't write a 'for' loop you should write to the CS department chair or dean and the career services office at the department and let them know that you're disappointed in the quality of graduate that they are turning out and that you'll be thinking twice before hiring their graduates in the future.

Colleges and universities are lowering standards and accepting anyone with a pulse to get their tuition dollars.


Speaking about Germany: This is because many CS degrees do not include sufficient practical projects. If you get some degree concluding practical project, you can already be happy. The real practice most CS students get, they get "off the job", in side projects. Or on the first job they somehow manage to get.


Netherlands also, although it depends a bit on which master's they did.

If you want people able to do stuff off the bat, hire those who did MBO or HBO (in DE, HBO=Fachhochschule, but DE doesn't have an MBO equivalent I think: that would be Ausbildung level afaict, except MBO doesn't require you to have a job at the same time). In English, my HBO translated their name to "University of Applied Sciences"; my MBO did not give a English translation of the degree


There should be a 4 year Computer Science degree and a 2 year programming trade school, both equally difficult but in different directions, and companies should be aware enough to know which graduate they need.

Of course the best hires would be those willing to do both, if they're capable of a 6 year commitment.

Apprenticeships and on-the-job training is also an option, but nobody seems to be willing to do that anymore.


There are a (very) few coding boot camps that offer something resembling the practical model.

Check out Turing School. 40 hours/ week of classroom instruction, including 6 weeks of just programming before you get introduced to a framework.


I wonder how much the context of being in an interview screws this up.

They might be able to solve it perfectly if encountered in the wild, but if you see it in an interview part of you is thinking “there’s got to be a trick to this that I’m not seeing”


Yeah, the first time I interviewed after working at the same place for over ten years I was totally thrown off, because I was expecting to have a discussion about my experience and not have to whiteboard a method to list all files in a directory.


What’s the question?


FizzBuzz?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: