HNHacker News
TopNewBestAskShowJobs

club7g

6 karma · joined January 30, 2014

submissionscomments
club7g··on Results of the SQL Performance Quiz
I took the test twice so I'm guilty of skewing the stats. My reasoning - first time I got 4/5 and it told me 'you know a little bit about SQL performance tuning.' I was curious about what the 5/5 message would be. It's interesting on many levels that the message was the same.
club7g··on Interviewing a front-end developer
Yep 2 spaces was the intention, where as the original implementation yields 3 spaces. My codes failure is that it appends a blank space to the end... I guess the real take away here is that there are many ways to achieve the same outcome. Knowledge of quirks is not essential. I would think the most important first step is understanding the requirements, what sort of performance is acceptable given the intended usage, coding for maintainability and ease of usage. For example, the solution for ensuring getCount has the proper context requires knowing how getCount was implemented then taking extra steps. A better solution may be something like this: var User = { count : 1 }; User.getCount = function() { return User.count; }
club7g··on Interviewing a front-end developer
I don't mean to be pedantic; well actually I do. The spacify solution is incorrect as the sample suggests that a blank space is not replaced with 2 blank spaces.

A correct solution would be:

function spacify(input) { return input.replace(/([^ ])/g, '$1 '); }