News for hackers. Stuff that matters.
Re:A note to Google recruiters (and on Google hiring practices) by nostrademons on Sunday July 24, 2011 @11:34PM (#2801215)
Side note: /&([^&;]+);/g won't actually parse character entities in HTML correctly. There're a number of corner cases in the HTML5 spec for historical reasons, and this is one of them. In some cases, it's legal (well, it's a parse error, but the parser must return the specified entity) to leave off the trailing semicolon. Except in attributes, where it depends on what the character following the last character of the entity is. The particular cases are enumerated in a table that is over 2000 lines long.

http://www.whatwg.org/specs/web-apps/current-work/multipage/...

The example is particularly instructive: &notit; is parsed as ¬ followed by "it;", but ∉ is parsed as a full entity.

So yes, even for HTML entity parsing (which wasn't the question she was being asked), the correct answer really is "use a library".

Re:A note to Google recruiters (and on Google hiring practices) by jrockway on Monday July 25, 2011 @01:11AM (#2801433)
Here's the meat of my point. The correct answer when writing software is "use a library". The correct answer when answering an interview question is code with minimal dependencies.
Re:A note to Google recruiters (and on Google hiring practices) by paganel on Monday July 25, 2011 @05:50AM (#2801977)
>Here's the meat of my point. The correct answer when writing software is "use a library". The correct answer when answering an interview question is code with minimal dependencies

Which can be paraphrased as:

"Here's the meat of my point. The correct answer when building a wooden shack is "use a hammer". The correct answer when answering an interview question about building wooden shacks is to make the hammer first".

Re:A note to Google recruiters (and on Google hiring practices) by phuff on Monday July 25, 2011 @10:20AM (#2802699)
Which can be paraphrased as:

"Performance under modern software development interviewing practices has a very low correlation with on the job performance."

Re:A note to Google recruiters (and on Google hiring practices) by roldon332 on Monday July 25, 2011 @11:16AM (#2802939)
Right, It is an academic exercise, not an attempt to understand how you would actually do the job you are applying for.
Re:A note to Google recruiters (and on Google hiring practices) by jrockway on Monday July 25, 2011 @01:04PM (#2803468)
It's an attempt to understand how you would solve problems of the class that the question is of, not an attempt to get a solution to a specific problem.

Not using a library when you should have is a problem solved by a 20 second code review.

Re:A note to Google recruiters (and on Google hiring practices) by roldon332 on Wednesday July 27, 2011 @04:23PM (#2813945)
Code reviews are normally done after the developer has spent some time on the code. That is fine that it takes 20 second to determine the code is totally worthless, but the developer has already wasted DAYS of effort.
Re:A note to Google recruiters (and on Google hiring practices) by yuhong on Monday July 25, 2011 @05:33AM (#2801936)
Except in attributes, where it depends on what the character following the last character of the entity is.

Yep, the problem here is that people use parameters starting with an ampersand without escaping the ampersand in URLs used in <A HREF=>.