Thursday, February 23, 2017

code review - Hackerrank stone division

Feb 23, 2017

Introduction

Julia always chooses a topic to study, today her topic is about Google recruiting.

She came cross the article on Hackernews about Google interview, and she likes to put some number together to help her analyze the situation: (hypothetical skills)

Recruiter goes over millions resume, and start from 2000 people, try to fill 3 positions:

1: 2000 for 3 positions 

resume screen - 100,000 resume -> 2000 resume
phone screen   - 2000 people, each 30 minutes 
code screen     - ?
phone screen   - ?
in-person interview - 1 in 10 or 1 in 20 from that point
hire


and then read the comment from an ex-googler 1825 days ago, probably in 2011: 

With all that said, I haven't found any degree (at least from any school I've interviewed applicants for) to be a reliable signal for programming. Even if they went to a really good school, there's a good chance that they spent all their time learning network protocols and low-level mechanisms, and will happily write up a sliding-window implementation for me, but will stare at me blankly when I ask for a simple recursive algorithm. It's just tough to find people that spent time studying and practicing general-purpose computer science.

An googler's comment on onsite interview more than 5 years ago, Julia is the first time to get the idea:
"So what you are saying is that for me to not have made it through I must have equally messed all my interviews or at least a majority of them. I surely didn't feel like that after the interview, but who knows, since I still don't have a way to know if that is the case. Then this really sucks."
Just a comment from another Google engineer who does interviews (and didn't do yours, since I haven't done any for a couple months now): your own feeling at the end of an interview may not at all reflect your actual performance in the interview, because you have no visibility into what questions weren't asked.
I like to interview candidates by asking them to solve a simple programming problem and then modifying the specification little by little, having them adjust their solution to implement new functionality. There are about 8 steps in my question, and frequently I'm gauging the quality of the candidate by how long it takes him to get through the first N stages; we fix bugs in earlier stages before moving on to the next stage. To calibrate myself, I've tried this question on several of my coworkers, and they were universally able to get about halfway through the question with bug-free code in about 10 minutes. Only one required prompting on my part to fix a bug. Most every candidate I've interviewed has taken 20-30 minutes to get to the same halfway point; by that time I've only got 15-25 minutes left in my interview, and the candidate seems so far like a "no hire", so I move to a different question to find out if the candidate has other strengths to counterbalance his weakness at solving this (simple) coding problem.
From the candidate's perspective, he only sees me ask a series of programming questions which he answers satisfactorily with a little prompting from me. If he answers another question or two satisfactorily, he may think he's done well, but he doesn't know that I wanted to delve more deeply into every question I asked him, and just didn't have time because the pace of his solutions was too slow.
I wish I could give this feedback to the people I've interviewed, but sadly, I can't.

So, Julia searched her blog using keyword: recursive function, and then she read the first blog through the search results, and the blog is about the fact that she failed to deliver recursive function design, code in Nov 24, 2016, after so many years Ph.D. study and 7 years full time work in the city of Vancouver, and then she did some research to catch up. 

More detail, she worked on stone division more than a few hours in the contest - hackerrank woman codesprint, a medium level algorithm, maximum score 50, Julia overcooked the solution, had weak muscle on recursive thinking, and out-of-her-control, scored 0. The algorithm is called stone division.  

Here are five blogs about stone divisions, documented her experience in the hackerrank woman codesprint, series from 1 to 5, failed to score any thing from a medium level algorithm, maximum score 50, over a few hours (5 hours?) in the contest in Nov. 24, 2016, and then she took action to do some research on recursive function, and then she found code review on stackexchange.com. As a matter of fact, she got used to isolate herself so long, and in order to improve hackerrank contest performance, she seeks the change. From a lone coder, work ass off, she barely stays afloat (not in financially), so she decided to find her new schools one by one, the 3 months old new school is called codereview.stackexchange.com, she found the site just after the Nov. 2016 woman codesprint contest. 

So, she spent one hour to review the algorithm, wrote a more readable C# version this time, with 3 months experience with the code review school, with top-rated teachers from JavaScript, C#, algorithm help her to code review her code line by line, debate on basics - hash function, coding style, API design, and numerous rich experience. 

Code reivew

C# code for stone division is ready to be posted to stackexchange.com for a review. And code review link is here



No comments:

Post a Comment