News for hackers. Stuff that matters.
Re:Tech Interview Handbook by new299 on Saturday August 17, 2019 @11:10PM (#20728001)
Personally I can't see an issue with very simple FizzBuzz style programming interview questions. I used to ask a simple "count duplicate substrings" question [1]. Maybe some people consider this too hard? I never used to require exact syntax, and would have been happy with pseudo-code. Using libraries is fine etc..

I also found very few people could solve this (similar non-SF large city location). Occasionally, people who could not solve this were hired for other teams. Based on their performance, I don't think I would have been comfortable working with them.

I don't think it's unreasonable. But I'm not sure I'd use it as a screen if I was hiring now. I think I'd just have a chat and try and discuss a previous project. After that I'd move to a paid take home project (ideally representing real, useful work).

[1] Take a string, for example "ABCCABC" and count the number of times each 3 character substring occurs. In this case the answer would be 2xABC 1xBCC 1xCCA 1xCAB.

Re:Tech Interview Handbook by bradlys on Saturday August 17, 2019 @11:46PM (#20728114)
I never had any technical interview prep when I started. I could code just fine. I demonstrated that at my other jobs and in school well enough. Then I started interviewing for SF positions that did these interviews.

I froze up. I couldn't talk and think at the same time. I didn't have the skillset for doing this in a very intense scenario. In my case, I was homeless and needed a job ASAP. Every interview felt like life or death to me.

First one I was asked to reverse a string in C. I hadn't done C in a few months. I froze up on syntax. I looked like an idiot who couldn't do it.

I could imagine many people who have never experienced this format (or haven't experienced it much) would easily freak out and look stupid as bricks like I did.

I've since done over 200 technical interviews (as the interviewee) and I usually sweep. Still fail at FAANG but I always get the solutions. (Even the leetcode hard ones) Just not sure why I fail but cest la vie.

Re:Tech Interview Handbook by DavidWoof on Sunday August 18, 2019 @01:13AM (#20728373)
Whenever I ask coding problems during an interview, I emphasize any language at all including pseudocode. And if they still struggle, I ask if they could just walk me through it verbally and we can work out the syntax together.

I realize people can still freeze up, but at some point I think there's just no solution to that unless the candidate can produce a significant portfolio. Also, I read your post and it sounds to me like to gained confidence in this area as your coding skills improved, which I don't think is as much a coincidence as you seem to believe.

Re:Tech Interview Handbook by new299 on Sunday August 18, 2019 @12:25AM (#20728224)
This is a really interesting observation, thank you.

Is there anything they could have done differently to make the situation easier? (I would guess perhaps giving you more notice about language requirements?). Or is there a different interview format that you feel would have worked better?

Re:Tech Interview Handbook by mixmastamyk on Sunday August 18, 2019 @01:06AM (#20728351)
Not really, innovative thought can’t be done with a gun to your head. Perhaps if you’d written this code multiple times over the years and had it memorized. But, that won’t help with random problem #2.

Stick to the basics and a trial period.

Re:Tech Interview Handbook by new299 on Sunday August 18, 2019 @01:12AM (#20728366)
Is reversing a string not already "the basics"? What are you suggesting should be covered in an interview/screen prior to a trial period?
Re:Tech Interview Handbook by mixmastamyk on Sunday August 18, 2019 @03:14PM (#20732209)
Your question was not reversing a string. You also mentioned fizzbuzz.
Re:Tech Interview Handbook by new299 on Sunday August 18, 2019 @07:13PM (#20733554)
It’s the problem under discussion in the post you are replying to.
Re:Tech Interview Handbook by mixmastamyk on Sunday August 18, 2019 @09:19PM (#20734149)
I was referring to your [1] in this thread.
Re:Tech Interview Handbook by lacker on Saturday August 17, 2019 @11:20PM (#20728026)
Of course some people will consider that question to be too hard. But you may not want to hire those people. The point of an interview process is for you to pick the people you want to hire, not to ask questions that everyone agrees aren’t too hard.
Re:Tech Interview Handbook by new299 on Saturday August 17, 2019 @11:35PM (#20728084)
I'm curious to hear the opinions of people who think that the question is too hard (i.e. it's too complex of a question to ask in an interview situation).

Perhaps some people might feel that while they could write code to solve this problem (or similar problems) outside of an interview. However, under the pressure of an interview they would not be able to solve the problem (due to anxiety, stress etc.).

If that was relatively common, then such a question would not be a useful interview question. Or would at least not be giving an accurate estimate of a candidates programming ability. This seems unlikely to me, but I would be interested in hearing different view.

Re:Tech Interview Handbook by bpchaps on Saturday August 17, 2019 @11:47PM (#20728120)
The fizzbuzz test is not entirely about whether someone can do it. It's also about figuring out the style of the programmer. There's a surprising amount of flexibility to fizzbuzz; how is user input handled? Do they use a linter? How are variables managed/named? There's a lot going on, and it can be gamed just like anything else on both ends.

That said, the last time I had a fizzbuzz take-home test, it was infuriating -- my code is online.. what does fizzbuzz prove except to help make a company soc2 compliant?

Re:Tech Interview Handbook by DavidWoof on Sunday August 18, 2019 @01:02AM (#20728343)
No, a fizzbuzz test is entirely about whether somebody can do it. That's the definition of a fizzbuzz test. When you hear others talking about a fizzbuzz test, they're not talking about the specific algorithm, they're specifically talking about a simple single-function problem that should take no more than 5 or 10 minutes.

If you're dealing with user input or linting, then that's not a fizzbuzz test. I'm not doubting that maybe somebody asked you to do something larger than that including the fizzbuzz problem, I'm just saying that nobody else here is talking about take-home problems when we talk about fizzbuzz.

Re:Tech Interview Handbook by new299 on Sunday August 18, 2019 @12:12AM (#20728192)
I guess it depends how you use it. I started hearing about FizzBuzz in the context of "why can't programmers program" [1]. I.e. that many interview candidates can't solve this problem.

It's also my experience interviewing programmers (outside SF) that most candidates can't solve simple FizzBuzz style questions. As a take-home test, I agree I can't really see the value in it.

[1] https://blog.codinghorror.com/why-cant-programmers-program/

Re:Tech Interview Handbook by ryandrake on Sunday August 18, 2019 @01:00PM (#20731377)
Back when I did phone screens, I went even simpler: Write a program that counts from one to ten, printing each number out followed by your name followed by a newline. Do not print the line for number 4.

It’s astounding how many programming candidates can’t work their way through this.

Re:Tech Interview Handbook by james_s_tayler on Sunday August 18, 2019 @08:43PM (#20733968)
Also astounding is the number of programmers who program over the phone. Approximately zero.
Re:Tech Interview Handbook by itronitron on Sunday August 18, 2019 @01:32PM (#20731580)
a nested for loop is certainly not hard ... however ... they describe the problem as something we thought was a trivial nested for-loop problem which suggests that maybe it wasn't. if the problem was presented in a more abstract fashion, such as print all filenames 'within' a directory, then a candidate may have stalled on which approach to take.

also, someone who has only ever written code using lambda expressions might have difficulty writing a nested for loop

Re:Tech Interview Handbook by PeterisP on Sunday August 18, 2019 @05:12AM (#20729133)
Your problem actually is a good illustration of the whiteboard test problems.

I just tried it, and it was trivial to do in a minute or two on my laptop. However, I did took note of two syntax mistakes that I made in the python REPL that were immediately obvious there and took seconds to fix, but which I most likely would not have noticed on a whiteboard.

So there's quite a bunch of problems where if the acceptable "format" of the answer is "hey, I'll just pull out my laptop from the backpack and push the solution to github in 15 minutes" then it'd be okay, but it'd be hard to do it while 'whiteboarding' without access to immediate feedback and easily accessible API documentation.

For example, I work in many languages, and for many APIs I can't remember whether in this particular language the same thing is called add or append or something else; e.g. I've worked on Java code for a dozen years and would be a quite productive Java developer, but since I haven't written any new code in Java for quite some time recently, I can't remember off of my head what's the right boilerplate to open a text file for reading in Java - it's something that a Java tutorial might have in the first pages right after Hello world, but I'd still have to look up the incantation to pass the encoding properly - there's like three Reader classes to instantiate and I don't recall their names off the top of my head.

Re:Tech Interview Handbook by deanclatworthy on Sunday August 18, 2019 @08:49AM (#20729867)
Nobody is punishing trivial syntax errors in whiteboard interviews. Nobody is taking your code and checking it runs.

It’s about your approach to problem solving and your ability to communicate that.

Re:Tech Interview Handbook by JustSomeNobody on Sunday August 18, 2019 @12:34PM (#20731213)
Is this really true though? I mean, I've been in development long enough to know that people go just plumb ape shit over the silliest things.
Re:Tech Interview Handbook by davidjnelson on Sunday August 18, 2019 @03:41PM (#20732348)
A cs professor at Stanford that hired at google said they _absolutely_ care if your code compiles and works correctly. This is the “coding fluency”[1] metric. The author of cracking the coding interview also touches on this.

1. https://www.programmercoach.com/2017/04/interview-insider-co...

Re:Tech Interview Handbook by new299 on Sunday August 18, 2019 @06:14AM (#20729342)
Do you think you could rough out an answer on a whiteboard that would have roughly the right structure?

When I used this question I wasn't looking for accurate syntax. If it was a solution that looked like it would work, after some debugging etc. I'd consider that a pass.

Regardless most people couldn't answer it, which I considered surprising.

Re:Tech Interview Handbook by PeterisP on Sunday August 18, 2019 @06:33AM (#20729408)
Sure, the structure is obvious; one was an issue of a method being named differently than I remembered, the other was an off-by-one error that'd show up in testing.
Re:Tech Interview Handbook by new299 on Sunday August 18, 2019 @11:58AM (#20730973)
So, it wasn’t obvious to many candidates I interviewed. For example, one candidate tried to create a solution involving 3 nested for loops.
Re:Tech Interview Handbook by itronitron on Sunday August 18, 2019 @02:00PM (#20731757)
Assuming these candidates already made it past an initial filter it would be interesting to ask the filtered out applicants the same question and see how well they do
Re:Tech Interview Handbook by b3b0p on Monday August 19, 2019 @02:30PM (#20740375)
I also was able to solve it in a couple/few min after seeing the comment. I did have a couple issues, index was off by one, and didn't catch an issue if I had already seen the substring using a brute force nested loop, but otherwise it works (Python). Edit: I also did it without a nested loop using a dictionary. Why I didn't think of this initially I don't know.

I've also had a couple FAANG onsites and get nervous as can be, but that's just a practice more and be more confident with my abilities problem I feel. No offers though yet. Still trying and practicing.

Re:Tech Interview Handbook by tempguy9999 on Sunday August 18, 2019 @08:15AM (#20729740)
If I were with you I'd not necessarily write anything.

Id put out my fingers 3 characters wide to the first substring and step through the rest of it in 3 char 'spans' with my fingers. I'd say "extract each substring, put it into a map with that substring as the key and either 1 as the value if it wasn't already present, or if it was, increment the value"

I'd probably not bother mentioning how to extract the results unless asked.

If someone said that to me it would show the solution, and I'd be 100% happy.

I'd assume that they could then render that into code - perhaps that would be a mistaken assumption though but in my experience solving the core problem is the thing I'm interested in, not the syntax. But those with more experience may say the former doesn't always imply the latter, and the code needs to be shown.

Re:Tech Interview Handbook by jameshart on Sunday August 18, 2019 @10:09AM (#20730208)
The translation to code is important. I have seen people who can describe a solution like that but when they come to write it as code struggle with managing simple mutability/immutability, scope, iteration, and conditional execution concerns. Better basic ability tests include a problem that requires an explicit nested iteration, because some people seem to struggle juggling two loop contexts in their head at once.

What I struggle to understand is why this sort of thing still serves as a useful weed-out screen in our industry, even for people whose resumes indicate masters degrees and multiple years of experience in development organizations. But experience shows that there really are people who are ‘faking it’.

Re:Tech Interview Handbook by lifeisstillgood on Sunday August 18, 2019 @03:42AM (#20728807)
That beats fizzbuzz for me - I think I shall steal it. It's simple enough that it can be done in five minutes but it has enough edges that people could go down the wrong rabbit hole
Re:Tech Interview Handbook by kidintech on Sunday August 18, 2019 @07:45AM (#20729643)
Am I misunderstanding your problem, or would this be a valid solution: https://pastebin.com/GWKr4AQ8

If so, then the company you're interviewing for must not be attractive to first-class CS grads (top 10-20% I think) from any non-online university.

As a comparison, any FAANG + Palantir/Jane Street/Two Sigma in the UK have tougher questions as their FIRST phone interview for INTERNSHIPS. (Palantir requires you to go through 6-8? interviews before getting an offer)

If this is a job that requires actual software engineers, I think rejecting everyone that failed this question would be perfectly reasonable.

Re:Tech Interview Handbook by new299 on Sunday August 18, 2019 @09:36AM (#20730039)
Yes, that looks like a valid solution to me.

If you’re saying only the top 10-20% of CS grads can answer such questions then that would make sense. I’d guess I was getting a random selection of candidates.

Re:Tech Interview Handbook by kidintech on Sunday August 18, 2019 @09:51AM (#20730126)
> you’re saying only the top 10-20% of CS grad

I'm saying that ALL top 10-20% of CS grads will be able to answer questions at this difficulty level in an interview scenario (accounting for nerves and so on). I'm not limiting it to them (i.e. the "only" quantifier).

I know people in the bottom of CS grads (judging by GPA) that worked remote jobs or worked on personal projects during uni that are very talented and would be able to solve this in less than five minutes. But there are also people that merely "got by".

> I’d guess I was getting a random selection of candidates.

I stand by my opinion that if you were recruiting for a software eng role (and not some random front-end position), then blacklisting anyone who failed this problem would be reasonable.

Re:Tech Interview Handbook by twic on Sunday August 18, 2019 @10:21AM (#20730264)
+1. Anyone who is a programmer can solve that problem. If they can't solve it, they aren't a programmer, end of story.
Re:Tech Interview Handbook by new299 on Sunday August 18, 2019 @11:14AM (#20730639)
So the weird thing is, that people who can’t solve these kinds of fizzbuzz type problems are often employed as programmers.

And, in my experience there are definitely situations where the majority of candidates can’t solve these problems.

Re:Tech Interview Handbook by twic on Sunday August 18, 2019 @11:58AM (#20730971)
Right! I can think of two explanations for this.

One, these non-programmers are somehow not actually doing their jobs, but getting away with it. I've worked with people like that, but only a tiny number. Maybe i've been lucky.

Two, you don't have to be a programmer to be a developer. In this day and age, our tools, frameworks, and resources (ie Stack Overflow) are developed enough that you can actually get some useful things done without having to think mechnically. Knowing some obscure boilerplate (eg Spring annotations), how to use your IDE's autocomplete, and where to go for copy-and-pastable code for various kinds of problem actually makes you a useful team member! Even if you can't write a simple loop to save your life!

Re:Tech Interview Handbook by new299 on Sunday August 18, 2019 @11:12AM (#20730622)
Good to know, I would tend to agree. I’m interested in any contrary opinions (because I may not sufficiently account for anxiety, or other issues).
Re:Tech Interview Handbook by Jach on Sunday August 18, 2019 @02:00PM (#20731752)
It's not an unreasonable problem, but one way to smooth it out could be to provide a list of "potentially helpful" string functions relevant to the variety of ways one might solve this problem. Not all string libraries are equal among programming languages, and recognition is easier than recall. I guess it really depends what you want to measure with the problem though. I use a problem that at the end of the day requires them to output an edge (start point, end point) that is used to feed a line drawing routine. I provide the standard junior high formulas for euclidean distance, mid-point, slope, inverse-slope, and two ways to represent a line, since I'm not testing for remembering those, but whether a subset of them can be used to solve the problem. I've still run into candidates who seemingly had never modeled a line mathematically before, and found myself hastily trying to explain how one would do so, like I were giving a lecture to a junior high student for the first time in pre-algebra. Needless to say they weren't able to then program a solution, or anything at all really... They would have been filtered out by your problem in less time. I think your problem could also be made easier to filter out the same people faster, but from my standpoint, I'm usually mandated by policy that I'm going to spend an hour with the person, so I try to make my problem answer a bit more than just the basic "can you code at all?"

Do you get candidates that ever ask "can I assume the strings are ascii?" The usual solutions to this will break in amusing ways if you allow arbitrary unicode. I know some interviewers who actually would have as a hidden scoring criteria "candidate asked about input encoding", and a lack of asking about that is a fail even if they correctly solve the problem for ascii. I myself disagree with using such hidden criteria -- if I'm going to score something, and not tell the candidate what exactly I'm scoring, it's at least going to be something in the code like "correctly avoided the divide-by-zero case without me pointing it out" and not an expectation of the candidate to read my mind on my expectations of things I haven't told them. (I do tell them to try and write code without errors (I help fix up basic syntax quirks or if I spot a typo I'll point it out), or ask how confident in their code they are and whether they might have in mind any edge cases to try -- I'd like to get a candidate who actually writes a unit test on their own, I always point out junit is set up...)

Re:Tech Interview Handbook by lkbm on Sunday August 18, 2019 @12:28PM (#20731172)
That seems like a nice, easy puzzle someone should be able to do on a whiteboard, but I think it would work better on a computer -- my first iteration of this included a bug, as well as some print statements intended help detect and diagnose bugs. I could carefully think through the problem to ensure I get all edge-cases/bugs, but I do better playing with it interactively. (In this case, my first iteration included 'BC' and 'C' as substrings each occurring once.)

You see my process better if you watch me write and correct this program on a computer. If my tasks is to think up a fully correct solution without iterative trying incorrect solutions, you're missing an important part of my process, even with a trivial FizzBuzz. (Though with this one you could probably just act as the interpreter and point out the errors for me.)

Re:Tech Interview Handbook by abhishekjha on Sunday August 18, 2019 @08:31AM (#20729805)
>Take a string, for example "ABCCABC" and count the number of times each 3 character substring occurs. In this case the answer would be 2xABC 1xBCC 1xCCA 1xCAB.

Can be done in O(n) time with a hash table.