Interview Street (YC S11) streamlines the search for great programmers
techcrunch.com
techcrunch.com
In the years following my first job out of school (decades ago) I can't recall any work that I have gotten by going to these sites, or dealing with monkey tests. Work comes because of my reputation and experience which speaks for itself. At conferences people give me their card and tell me to call them if I am looking to 'move up', which generally means "pay more than the last guy". Any time one contract or job ends, I look through these cards. Most of the time I get several phone calls from people I have met of the sort: "Hey Bugsy, I heard rumors of ABC Corp having layoffs. You looking to get out? We have a position..."
It's bad enough when the interviewer wastes more than 10 minutes of time with puzzles. Having it be automated so it can waste hours and hours without any human feedback is extremely offensive. Whoever designed this system knows nothing about acquiring talent.
The note in the article that in the future the site is going to be augmented with "real world tests" that force the user to design entire sites or otherwise labor for free borders on criminal since they are forcing you to do real work and you're not getting paid for it, in violation of state and federal labor laws.
If you haven't already seen examples of someone's work before you contact them, maybe you shouldn't be hiring them. Or maybe you need recruiters who know what they are doing.
Again, I have no doubt that desperate people who are unemployed because of their incompetence or lack of skill will not have any problem devoting the hours needed to google answers, or to hire third parties to help them complete these tests. I am sure complementary businesses will now open up that sell test answers to desperate applicants for a fee.
This happens even if one is fairly isolated doing "heads down coding" for much of the year. There are times when you meet with clients in meetings, or talk to customers, and talk to competitors at industry conferences, standards meetings and the like.
People who are competent recognize other people who are also competent just by talking to them. People either know what you are talking about and can respond intelligently, or they don't. When people don't know what you are talking about, you downgrade the conversation and talk about gardening, the weather, sports. This is just normal everyday human interaction. It's strange reading some of the replies here, it sounds like some of the people on this discussion board don't know about how that is done. They seem to not have face to face interactions with other people in their field.
In the cases where you connect with someone who is likewise competent, you both remember the encounter. You trade business cards. And if you have an opening at your job for the sort of work the person does, when the position is mentioned, you pull out his card and say "What about this guy? I met him at the XYZ conference. He invented the ABC protocol that is used in GHI devices, just like the thing we are looking to get into."
Connections made don't have to be with management. Typically it is another engineer, a peer relationship. If you know what you are doing, then you get recommended when there is an opening. That is how most jobs at good companies get filled. It's not "nepotism" as someone below claims (apparently he is lacking a dictionary.) I have never worked for a relative. If I do in the future, they will have tried to hired me not because I am related, but because I am the best. And should that happen I would turn them down since I wouldn't want to mix up family relationships with work, that can be a disaster. In any case, if you are good, even the most reclusive and introverted developer/designer/inventor is going to have some people he talks to. And if he is good some of those people are going to talk to others about his work. If that is not happening for someone, the likely reason is they are not all that great. There is no shame in being incompetent nowadays, but the article under discussion is about hiring "excellent" people, not incompetent ones, so it is relevant for the specific topic at hand.
That said: this site clearly doesn't look like the right way to do it.
Here's our hiring process (we're hiring!):
http://www.matasano.com/careers/
I think we're extraordinarily careful to be respectful of people's time. We've learned through difficult experience to put practical problems in front of candidates, but to avoid Aspie-type alpha-geekery in those problems, and to be appreciative of the time people give us to go through those problems.
Running the puzzle gauntlet doesn't sound respectful to me. There are great programmers who get off on solving puzzles and this process may not weed them out, but there are lots of other great devs who will walk if they see something like this. Caveat emptor.
I think that is an excuse. Speaking as the person you are claiming doesn't understand, I am highly introverted and awkward. I hate interacting with people in public, it is exhausting. I throw up after having to do public speaking. Yet, I do talk enthusiastically about my work and the field with other people, and I have learned over the years, as introverts do, to be sociable, just as I have learned over the years how to write compilers, design microchips, do web design, etc. (Little of which was covered in depth at all in the university classes I took at a pretty good engineering school.)
We've found some success by trying to make the problems really interesting; perhaps some people jettisoned but others came back and said they had a really great time trying to solve them.
Maybe for software you could ask a question like: describe a little piece of software you'd like to build, you could build in an evening and would be useful/entertaining for you or someone else. describe how you'd do it.
and then...
show us, one week from now. :-)
> They seem to not have face to face interactions with other people in their field.
That has very much been my experience, and the whole meeting-strangers-at-trade-shows thing seems similarly atypical to me. I've never known anyone who does that who wasn't dedicated to sales or marketing or biz dev full-time. I've been looped into maybe a dozen phone conferences and three in-person meetings with customers and partners in the last four years, and there's one guy (from our first API integration) who I could reasonably expect remembers my name without a CRM search. Dunbar's number doesn't leave room for very many of the semi-celebrities you're describing, and they're all going to be extroverts anyway, so I just get recruited by former coworkers (and the obligatory headhunters).
[1] http://www.codinghorror.com/blog/2007/02/why-cant-programmer...
And is it any wonder? Threads like this are filled with comments saying things like "80% of programmers can't code their way out of a paper bag", so is it any wonder that the folks who can program adequately get big heads about it?
A month or so ago I met some people from a company at a networking event. They were looking for people with my kind of skill set and seemed quite enthusiastic. I made it clear that I was only interested in freelancing but he said they were out to "get the best, whatever it takes, so freelancing is fine". So the guy I'm speaking to gives me his card and I email a few days later.
I get an email back, not from him but from HR so not a good start! And the email basically says "build us this trivial demo application just to prove you can program before we interview you" and to make it even more insulting links to tutorials in case I don't know what I'm doing.
I couldn't think of anything nice to say so I never replied :)
I've never been particularly desperate or unemployed (though I did not have a job while I was in university), and I think that the few minutes necessary to solve any of these problems is a reasonable use of time if it can signal a potential employer that you are more likely to be competent than a huge majority of their applicants. You are correct to say that nepotism is a better way of getting places, but I don't think it is reasonable to expect everyone to do it.
Also, if > 80% of the programmers can't code, who the hack has been employing them all these years?
I don't think >80% of programmers can't code. I think that programmers who can't code are much more likely to be applying for jobs than programmers who can code, which makes the pool of applicants look much worse than the pool of all programmers would look.
Most of the programmers looking for a job suck. If you're truly good and have a reputation, you don't need to interview (unless you want to work for a very specific niche where you don't have connections).
Because obviously all great programmers are expected to have built their online cred before applying for a job, right? I'm sure candidates with background in, say, HFT love sharing their work on their blog, or enjoy hacking on their pet projects after toiling away at their 60+ hour work weeks.
Your company is a web app, I can write web apps; why am I solving problem sets from undergrad Discrete Math to demonstrate competence? Why not have the tasks be like "Use AJAX to pull down a users last 10 tweets and display them on a web page"?
Maybe it's because the only samples are generic and not submitted by the companies, but I was hoping for a bit more relevance to the intended job duties than yet-another-interview-puzzle.
To the downvoters: Do you disagree? If so please tell me why.
In my experience, the ability to leverage those skills into delivering mature, stable, maintainable and generally high quality software is considerably rarer than the skill to solve puzzles. And don't even get me started on non-technical skills, like being able to organize and plan the work, communicate with non-technical people etcetera.
Basically, I don't see this kind of testing covering more than 5% of the screening effort.
* do you thoroughly document your code without nagging?
* do you value simplicity over cleverness?
* do you think communication is a chore?
* do you enjoy human interaction?
* do you have empathy?
* are you creative?
* do you have good taste?
Googrosoft-style interviews are great for selecting people with raw intelligence, a competitive streak and some level of arrogance. They're not quite as hot at selecting reasonably smart people who are personable, creative and tasteful. And that's a huge portion of the job when you're writing software in a group. Very little day-to-day software work requires raw brilliance, but nearly all of it requires communication, empathy, creativity and taste.Well, first, it's not like I just ask someone if they enjoy documenting code, and expect them not to lie. That would be stupid. It's much easier to just ask coding questions than to figure out if someone is creative. That's why the problem is hard.
Second, how do you focus on the other important factors, and still manage to test for coding ability? You ask coding questions -- you just don't devote the entire interview process to them.
Last year I interviewed at two YC companies, AirBnB and Heroku. At AirBnB the interview went great, but then I was given a 3 hour programming challenge that including a written analysis of my code. The challenge was not at all related at all to building web apps, and even the use of a database was not allowed to be used to solve the problem.
At Heroku, we discussed a real issue they were having and halfway through the interview we were both up at the whiteboard bouncing things back and forth, drawing things up. At the end of the Heroku interview we both knew how the other worked and how we would work together.
I find this kind of odd and correct me if you think I'm off because I'm not a programmer.
But for any company to give you a problem that they are having and for you to help them solve it... shouldn't you get compensation for that (outside of a job position)? That's basically free consultation. It's like how some companies give design tests for designers, which is basically spec work. Even if they don't choose you, they could still take some of the ideas and implement it.
It's one thing to give a general problem and analyze your problem solving skills and knowledge (as well as to verify your resume).
Is there?
You are giving your expertise with the intention of improving their situation and potentially saving them time. It's not uncommon to get paid to consult about problems that a team is facing without actively implementing it yourself. How is this any different?
http://blog.indextank.com/1030/interviewing-engineers-enough...
TLDR: Most companies put too much emphasis on testing IQ and don't know how to evaluate what makes people great at building stuff that the company needs.
1) This will simply encourage people to develop offsite and submit when they have working code. On their site they allow recruiters to see what applicants are typing in real time, and pushing people off site will render this function useless.
2) In interpreted languages like python my work flow usually is incremental change and test, so very high numbers of submissions will not be unlikely. I don't think that kind of programming should be discouraged.
There should be a Test button as well as a Submit button. The employee understood my concerns, so hopefully they get that worked out soon.
Another criticism: The problem desctriptions seemed poorly worded to me.
It is a good looking site either way. I'll be keeping my eye on it.
I think this kind of extra testing could be detrimental because it's going to stress people out. Give a hacker a fun challenge and set him to work, he'll probably do it better and faster than if you set him in an empty room with a big timer and people scowling at him.
I also happen to hire and if the candidate does not have an open source project I give them a meaningful challenge (add value to the community) and tell them to create a github acct and share a link to the repo. At least by the end of the process they have something to walk away with
> I also happen to hire and if the candidate does not have an open source project I give them a meaningful challenge (add value to the community) and tell them to create a github acct and share a link to the repo. At least by the end of the process they have something to walk away with
Could you be any more silly and condescending? Right back at you: Unless your nickname is a literal and accurate description of your programming abilities, I will take a bet of dollars to donuts that every programmer in my office has more raw coding acumen than you. But guess what? None of them has a GitHub account and that is unlikely to change. Neither do most of the other top-tier programmers I know. One of my coworkers has put out numerous public domain libraries (http://nothings.org), most of them developed on RAD's dime, but he'd probably be appalled to be considered a member of your "community".
I actually have an old, effectively defunct GitHub account that I continue paying $8/month for because I like what those guys are doing. The problem isn't GitHub. GitHub is great. The problem is you, and people like you.
Don't be a GitHub Douche.
None of them has a GitHub account and that is unlikely to change
I'm surprised your so proud that your team will never have a free account on the largest repository of open source. Regardless if you contribute, why wouldn't you take advantage of FOSS instead of re-creating the wheel.
I will take a bet of dollars to donuts that every programmer in my office has more raw coding acumen than you
Thats a rather baseless statement. What would you know about my ability to code or not to code. On the other hand, your team's apparent anti-open-source position (based on above comment) seems to indicate they are not as awesome as you describe.
The problem is you, and people like you
You mean people that are passionate enough about programming to voluntarily write code on evenings and weekend and share it for the broader community of developers for the sole purpose of being proud of something you create and sharing it so others can benefit? I'd be happy if there were more problems like me
dont be a github douce
Honestly I don't care if you use github, bitbucket, codeplex, or your blog
> I'm surprised your so proud that your team will never have a free account on the largest repository of open source.
I'm not proud of it. When I say it's unlikely to change, I'm making a considered prediction. Don't confuse 'is' and ought'.
> Thats a rather baseless statement. What would you know about my ability to code or not to code.
It's not baseless. It's Bayesian statistics. They are enough sigmas above the mean that I feel comfortable making that bet. If you were to reveal your identity and it turned out you were, say, Guido van Rossom, I might lose the bet and have to update my prior.
> You mean people that are passionate enough about programming to voluntarily write code on evenings and weekend and share it for the broader community of developers
Nah, I mean people who assume anyone who isn't exactly like them must be a second-rate human being or at least a second-rate member of their profession. This is the same personality flaw that turns enthusiastic, inveterate puzzle solvers into the kind of puzzle-mad interviewers you seem to hate with a vengeance. Isn't it nice to find out you have something in common?
Also, another tidbit for folks here - Yuvi is following the startup lifestyle by taking a break from college and joining this startup. Which is a big, big deal in India. I'm very impressed
I know there are domains which call for Project Euler solutions.
Really. I do.
But I only run into "CS" problems about once a month right now. The rest of it is code cranking, talking with people, and working on deadlines.
I'm not saying that this is drek in the stream. It's not. It's just... not even close to a demonstration of what I can do for the company I work for.
Yes, I could work out these solutions. But (these days) I'd rather work on writing software rather than developing one-off algorithms.
(And of course this sort of thing tempts me to submit in Haskell or Lisp, because hey, more mathematical notation. And you probably don't want to read >>= or ))))), do you? ;-) )
I'd rather share my open-source code (it's on github and bitbucket!), talk about my prior projects, and present my ability to work with other human beings to get the task at hand done.
Yet- all that said - Best of luck, Interview Street. Anything that helps people connect with jobs they are suited for is a good thing in my book.
They're probably not the new LinkedIn but I think they're into something.
Your test consists of 1 programming problem to be solved in Java, C++, C#, C, Javascript, Pascal, Perl, PHP, Python, Ruby or VB.NET,
The biggest problem I have with job interview style 'coding puzzles' - is that the code that is optimum to solving the solution is actually not code I would want to write day to day and wouldn't be code I would want to work with day to day.
The reason is because in my line of work, we are working with good clean, maintainable code, using good OO principles. This includes naming of variables, naming of functions and accounting for extendibility and maintainability from the ground up.
However, most of these coding puzzles, will be looking for people to write the 'simplest' / 'most elegant' solution to the problem, often leaning towards efficiency or using the least number of lines / characters.
For example, the variables will be 'x', 'y', 'a', 'b', everything will be manipulated through integer 'index' and complex reg exp's may often feature as short cuts to longer code.
- Now there's nothing wrong with the solution this produces. However, overall coding style I prefer is maintainable and easily readable. Variable names have meaning, we work with concrete objects and each piece of complexity is broken into separate functions / classes.
Neither solution is wrong, but the approach to either is completely different and for a interviewee it's often hard to know which path I should be treading when writing the sample code.
On the one hand, the interviewer may think I lack any forethought of maintainability / readability, if I just hack together something quickly using single character variables.
On the other hand, the interviewer may think I'm adding too much bloat / taking too long by using full naming and creating my objects to handle what I want to achieve.
Ok - I only spent 15 minutes on this, and I'm not particularly interested in finding a job with any of the companies that are listed. Still annoying though.
...ruined by the ever-spreading concept that everything should be solved using web apps. I mean, heaven forbid that they actually have a physical center with employees testing people.
I'm genuinely interested since I'm not sure if startups or big corporations will use something like this.
Please log in with google.
Never mind.
I'm surprised we haven't seen any sort of public awareness campaign geared towards learning computer science. Only recently is it starting to be "cool" and equivalent to lawyers/doctors.
- Copy problem on the main challenges page: "Solve challenging programming questions and land -on- your dream job."
- On the challenges page "Solve This" buttons, the text is too high within the button, isn't centered.
- "Are you a great company for hackers?" box on the challenges page has weird stray space at the bottom of the box. Either vertically center the contents of the box or cut off the bottom.
- Typing error in the FAQ: "No worries, the remaining invites automatically get-s- added for the next month." Sort of awkward anyway, maybe "automatically roll over to the next month" is better?
- On my laptop, the live chat tab covers up the "All Rights Reserved" line, which doesn't matter but is a little visually annoying.
- The check marks and X's on the pricing page aren't aligned correctly with the row labels. They're aligned by the bottom of the text to the bottom of the icon, but the icons are bigger so it looks off. You should align the center of the text to the center of the icon.
- "Buy Now" buttons on the pricing page aren't centered correctly within the columns
- This is a small one, but maybe "Recruit" and "Challenges" don't match very well as the two halves of your site. They aren't the same part of speech and don't perfectly convey the two areas. Maybe something like "Get Hired" vs. "Recruit" would more clearly convey the split?
- The "About" page could do with being re-worked in a lot of ways. The spacing is pretty messed up (for example, YC branding has tons of space above, none below), and the paragraph format makes no sense for the information you're conveying. If you want to include companies you've worked for, why not make them a list. Overall, this page doesn't seem to serve any effective purpose beyond being a placeholder for some eventual page. There are also a ton of copy errors:
"At Interviewstreet[Isn't the 'S' capitalized in your brand?], we are looking to change the way the recruitment industry works. We are a team of five hardcore hackers and our Hall of Fame reads as[This is really unclear and awkward language. A Hall of Fame is usually comprised of people, not their accomplishments. If you want to keep it, change "reads as" to "includes," but it might be better to say something like "with experience at companies like"] MediaWiki, GNOME, Firefox, Libreoffice and Hadoop hackers, multiple Google Summer of Code participants, ex-Yahoo!, ex-Amazon and ex-IBM . Having worked in top Silicon Valley firms, we understand what hackers look for in their perfect job and[New sentence here?] with InterviewStreet, we hope to match programmers with the best jobs out there[Needs punctuation]"
and
"We are always online - just hit an e-mail["hit an e-mail" is a strange phrase; maybe it's lingo I don't know or something but I've never heard it. What's the advantage over "send?"] to team@interviewstreet.com (or) call us at 512-800-3815,[New sentence?] we will get back to you! save[Capitalize] the precious time of your employees[Maybe "Save your employees' precious time" is better, but I'm not sure what you even mean by this, or why it's here.] :-) Hiring is fun from now on!"
- "Contact Us" page is also a little weird. If I'm in "Challenges" and click on the link in the footer, it takes me to the "Recruit" tab for some reason. The spacing is strange: there's a ton of vertical space in between "Recruit" and "Contact Us," but the fields and field labels and submit button are all jammed together. My eye loses track of which field labels apply to which fields unless I start at the top and move down.
Oh, and, by the way, if you think that it's unprofessional to be funny, then I'm sorry, but you just don't have a sense of humor. (Don't deny it. People without senses of humors always deny it. You can't fool me.) And if you work in a company where people will respect you less because your specs are breezy, funny, and enjoyable to read, then go find another company to work for, because life is just too damn short to spend your daylight hours in such a stern and miserable place.
Edit: No offense intended.
Clojure, however, is coming soon.
Arc. Obviously. :-)
Edit: downvoted. Two possibilities spring to mind:
1) Downvoted by a feeble mind not capable of constructing an intelligent retort.
2) Downvoted by a relatively strong, yet ultimately scarce mind that wants to prevent access to the truth.
E.g., for the first, really serious, substantive error, in the first problem, the largest possible size or absolute value of each of the "N numbers" was not specified. Without any such specification, it is not possible to write solid code to solve the problem.
The problems look like rotten bait on rusty hooks. I'm not biting.
The third problem does have some cute contact with convexity that can be exploited to give a relatively fast algorithm.
Will I write out the code? I will not! The problems suggest that writing the code is the main challenge, that if I could write the code then I would, and if I don't write the code then I can't and am shown to be unable and should be embarrassed. This suggestion is nonsense and an incompetent insult, and I'm not falling for that insult.
My work in computing and computer science has passed reviews with competence far, far, FAR above that of what the problems show for Interview Street. Net, Interview Street is promising that its really bad house painters are the ones to pick someone to paint the ceiling of the Sistine Chapel which is insulting nonsense.
Besides, more important than the code would be the documentation that explained why the code is correct, but the problems are not seeking such explanations. So, the problems are a bad example of how to work in computing and a 'bummer'.
Today I'm writing code to get a use of Windows Communications Foundation (WCF) working for the asynchronous 'remote procedure call' communications I need for the server farm for the Web site for my project.
Yes, the third problem has some math, but my startup has at its core much more math, much more advanced, powerful, and valuable, and some nicely original. Besides, I have all such math for my startup in code ready for production so that at this point I just need to get code using WCF to connect together the asynchronous parts of my server farm and write a few more, simple Web pages to have code ready to go live. That is, WCF will so help me go live assuming, still open to question, that WCF is the 'right stuff' for my project; else I'll just write a TCP/IP sockets application. So, I have no time for puzzles with convexity with no business connection.
Besides, who at Interview Street would actually understand the convexity exploitation? From the writing of the math in the questions, likely no one would! That is, people who write math as badly as in the problem statements have little chance of understanding the convexity math of the third problem. That is, the writing of the math indicates solidly that the writers know far too little math to understand the role of convexity in the third problem.
Instead, it looks like Interview Street got the third problem from a textbook on, maybe, facility location and, then, made a mess of copying over the problem.
So, the third problem is in facility location: Maybe I should call up one of my old facility location profs, J. Cohon, now President at CMU, or just get out my class notes! Or, with convexity, maybe I should get out my old notes on optimization. Besides, what employer would appreciate the role of convexity? Likely none.
So, writing the code is a fool's errand. Life is awash in fools' errands to be avoided.
No, to solve the third problem well, the main issue is actually not writing the code but exploiting the convexity; that I have noted this is likely a better 'solution' than most of what will be submitted.
Indeed, any good solution will have to address the math of the convexity carefully and otherwise be just a lot of gibberish with no reason to believe in its value. Net, the third problem is not in computer science but in applied math; once again, computing, out'a gas, is looking to applied math for 'content' and is making a mess.
My background is in applied math, especially for business problems. Given the math, the computing is routine! The coding ain't the main challenge, guys!
Interview Street is illustrating a serious, fundamental problem with current computing: It doesn't know the difference between applied math and software. In particular, a good solution should not be in C, etc. but in TeX and is not 'code' but theorems and proof. Sorry 'bout that!
I didn't say that your "making applicants solve problems" was bad, just that the problems, especially the third, in this thread are bad.
"Unless you can make a convincing argument that the tests will decrease the fraction of qualified applicants, your post just smacks of arrogance and entitlement."
I believe that others on this thread have made such an argument. Again, I'm considering just the three problems on just this thread.
For how to sort through "1000 candidates", I do have an improvement: Don't use the test of this thread!
So, that takes us back to what we had last week.
You want to move forward from there? For that, I'm lost; I don't see the severe problem. I've been in computing for a long time and have interviewed and been interviewed, done projects and supervised projects. Once I had made some progress in my career, I never thought that recruiting or interviewing was very difficult.
Here is a way to improve the situation: Return to the early days of Java, when it first came out. Then the job ads were awash in requests for persons with "two years of Java experience". So, why not just call up Gosling since he was the only one who was qualified! That example is from a very general pattern: Pick some highly specific, improbable combination of 'skills' and demand that an employee have all those 'skills'. Nonsense. So, the first step forward is to quit recruiting for specific 'skills'. Just STOP it. Don't do it anymore. Drop it. Give it up.
Next, mostly what recruit for is general technical talent. A BS, MS, or more in math, physics, or computer science (in that order!) from a good university should do fine. If there is more evidence that the person is 'bright', then fine.
Next, recruit for some basic computer 'skills'. We're talking declare and allocate variables, assignment statements, if-then-else, do-while, and call-return. How difficult is that?
Next, recruit for interest in the work.
Next, recruit for general presentation of self.
Then, hired, expect that the person will get 'trained' on the job. The person will need a few months to become useful to the organization. The training can be self-taught, mentoring, routine supervising, some video materials, some presentations within the group, some training programs, maybe even with tests and grades, etc.
I've seen plenty of just routinely well qualified people dive into a new computer with a new operating system with new hardware devices with new programming languages, etc. and do just fine. E.g., when I was Chair of a college computing committee, I led an effort to get some new computing for the college. When it arrived, the existing staff jumped right in. One project was an application to contact, track, send mail, and get responses back from alumni. The guys just did it! Soon the college was sending boxes of mail daily to alumni. The software project quickly, uh, 'paid for itself'! Soon the university took over the project, rewrote it from just the high level description, and rolled it out to all the colleges on campus. Likely it again 'paid for itself'!
Where's the really big problem?
The main guy who did the alumni system? He worked for the college, but he didn't have a college degree and had had no courses in computer science. Not a problem.
I'm in the Mid Hudson Valley and hope to hire. I will be able to pick from people from community colleges, four year colleges, various development labs, and, of course, maybe Yorktown Heights. I don't see a problem.
If you see a problem, make sure you are not looking in a mirror.
The problem is essentially in the field of 'facility location' which is a topic in essentially optimization.
The problem statement is a mess, so bad we should not even address the problem. But to start to clean up the problem statement, consider the set of all points in the plane, points with coordinates (x,y) where both x and y are integers. Let's call this set of points the 'grid'.
The problem statement mentioned a "grid" but didn't give a solid definition. Bluntly, the people who wrote the problem don't know how to write math. The problem also mentioned "cells", without even defining them. Even we give a definition, we don't need or want "cells". Uh, guys, it is just 100% absolutely, positively necessary to give precise definitions; intuition just doesn't work as a substitute!
So, for some positive integer n, there are n houses at distinct points in the grid.
Now the problem defines a 'distance' on the grid. For grid points P_1 = (x_1, y_1) and P_2 (x_2, y_2), the 'distance' from point P_1 to point P_2 is
d(P_1, P_2) = max(|x_1 - x_2|, |y_1 - y_2|)
Then easily enough, d( P_1, P_2 ) = d( P_2, P_1 )
If we work at it, then we should be able to confirm that d is a 'metric'. For the main point left to show, that is the triangle inequality. A serious solution would show that we have a metric; e.g., a serious solution has some theorems and proofs and is not just some code. Sorry 'bout that!Here let's just assume that d is a metric.
Next, let's assume that d can be extended to a metric on all of the plane. Yes, that would take more theorems and proofs.
Next we argue that for points U, V in the plane d(U, V), with V given and fixed, is a convex function in U.
So, what is a 'convex' function? Consider R as the set of real numbers and the plane as the set R^2. Suppose function f: R^2 --> R. Then f is 'convex' provided for all X, Y in R^2 and all t in [0,1],
f(tX + (1-t)Y) <= tf(X) + (1 - t)f(Y)
Here tX is multiplying the 'vector' X by the scalar t; similarly for (1 - t)Y. So, convex means, intuitively, that the function value is <= a straight line interpolation.It's easy to show that every convex function on R^2 is continuous. Maybe in a good solution we should show this!
If f is convex and a >= 0, then af is convex. If f and g are convex, then f + g is convex. So any non-negative linear combination of convex functions is convex.
The 'epigraph' of f is the subset of R^{n + 1}
{ (x, f(x) + a) | a >= 0 }
and is a convex set (yes, I omit the definition of a convex set!). That is we just draw the graph of f and take the surface of the graph and everything above it; we get a convex set. Since f is continuous, this set is closed in the usual topology.If function f is convex, then there exists linear p: R^2 --> R so that for all h in R^2
f(x + h) >= f(x) + p(h)
So, p is a 'subgradient' of f at x. So, we have a linear function that is thet same as f at x and otherwise is <= f. This linear function defines a 'supporting hyperplane' of the epigraph of f.Also, if t > 0 and p(h) >= 0, then
f(x + th) >= f(x) + tp(x)
which means that if we leave point x in direction h following f and find ourselves going uphill, then as we continue in direction h we will continue to go uphill. So, if we want to go downhill, that is, to minimize, then continuing to go uphill won't get us there.More generally we can show, from a subgradient at x, that there is a line in the plane through x so that one side of the line is downhill and the other side is uphill. So, with several such lines, we can get a convex polyhedron in the plane that has our solution.
Continuing, suppose, for i = 1, 2, ..., n, house i is at point P_i. Then we seek j = 1, 2, ..., n to minimize
S(P_j) = \sum_{i = 1|^n d( P_j, P_i )
(yes, here we are using the syntax of TeX). So, an easy solution is to try each j. For each j, the computational effort is proportional to n so that the whole solution has computational effort proportional to n^2.We can evaluate S(Q) for any point Q in R^2. Then S(Q) is convex. So, we are trying to minimize a convex function but limited to n given points.
Let's move more quickly now (we'd need some theorems and proofs): We start with a rectangle that covers the n points. We know that our solution is inside this rectangle. This rectangle is a special case of a convex polyhedron. [We assume that the polyhedron has positive area and otherwise handle the case in a different way by a standard unidimensional search.] For such a polyhedron, we can use linear programming to find the center of the largest inscribed circle inside the polyhedron (if the radius is zero, then we know we can change to a unidimensional search). At this point, we find a subgradient of our convex function. This subgradient cuts our polyhedron roughly in half. We pick the half that goes downhill. If there are one or more houses in that half, then we let this half be our new polyhedron. If there is just one house in this half, then that house is our solution and we are done. If that half is empty, then we pick the other half as our polyhedron.
So, this is a 'central cutting plane' algorithm for minimizing a convex function, See Elzinga, Nemhauser, etc.
Okay?
I don't quite understand why this solution is preferable to a solution which simply evaluates S(P_j) for each j and returns the minimum in O(n^2) time. I'm also not sure why I would prefer it to a solution that is faster.
One O(n lg n) solution requires that we convert the "Minimum sum of distances at a house for houses on lattice points in 2-space under the square metric" problem to an equivalent "Minimum sum of distances at a house for houses on lattice points in 2-space under the taxicab metric" problem, at which point we can consider the two dimensions independently. With some trickery we can find the sum of distances to other houses for all houses in the 1-dimensional version of the problem in linear time plus the amount of time required to sort the houses.
To do this, we begin at the house with the lowest coordinate and calculate its sum of distances. From the the sum of distances for one house, we can calculate the sum of distances for the next house in constant time: S(P_j) = S(P_j-1) + |P_j - P_j-1|(j) - |P_j - P_j-1|(n-j). This is not the most compact form and is an abuse of the notation considering that it refers only to the 1-dimensional problem, but I think it conveys its meaning well: Once the houses are sorted, the sum of distances for a house other than the first is the sum of distances for the previous house plus the distance between them for each house with a lower coordinate than this house, minus the distance between them for each house with a higher coordinate than this house. The phrasing of that is not quite right for houses that have the same coordinate, but that doesn't particularly matter since the distance between them will be 0.
After that we can calculate S(P_j) as the the sum of distances for P_j along one dimension and along the other. Finally, since we've calculated the sum of distances for each house, we can just print the least of these. We could also solve the problem in linear time if we were willing to use radix sort, but we probably wouldn't want to do that.
The n^2 algorithm is simple enough to be solid. If your code does not give their answers, then their answers might be wrong!
My work with convexity is an effort at faster code, but actually programming all that would be a bit much. I've done such things, but I got the linear programming from the old IBM Fortran Optimization Subroutine Library (OSL) and, then, wrote the code in Watcom Fortran so that I could use the Fortran OSL OBJ files. Using the OSL for the problem in this thread would be a bit much.
As for the justification, it shouldn't be too hard to show with a little algebra that
TaxicabDistance(x1+y1, y1-x1, x2+y2, y2-x2)/2 = ChebyshevDistance(x1, y1, x2, y2)
where
ChebyshevDistance(x1, y1, x2, y2) = max(|x1-x2|,|y1-y2|) and
TaxicabDistance(x1, y1, x2, y2) = |x1-x2|+|y1-y2|.
http://news.ycombinator.com/item?id=2865396
So, we have a linear transformation from R^2 into R^2 with matrix
1 1
1 -1
So, the rows are orthogonal! And the columns! It's not quite an orthonormal matrix where its transpose is its inverse because the length of each row, column is not 1, but it's 'close' to orthonormal.So, except for a scalar multiple, this linear transformation has to be an 'isometry', that is, preserves lengths and angles, lengths in the usual metric in R^2. So, this linear transformation starts to 'smell good'!
Looking, for the given metric, consider the 'unit circle', that is, all points distance 1 from the origin. Then consider the image of these points under this linear transformation. That 'circle' is a square with diagonal (1,1) to (-1,-1). Then its image is a 'diamond', that is, a square with diagonal, say, (-2,0) to (2,0). So, except for a scalar 2, we have preserved distances. That is, our linear transformation is 1-1 between a 'circle' in one metric and a circle in the other metric. That's close enough to a proof for gumment work!
Nice.
Be wise, generalize: So we have taken a nasty problem with an n^2 solution, or some tricky, solution iterating with convexity, and with a simple linear transformation turned the problem into a 'decomposition' on the two coordinates separately. So, where else can we take a challenging optimization problem, stuff a linear transformation inside the problem, and get a much simpler problem? Hmm ....
Else use just the n^2 approach or, if really want to struggle for something faster, then use my convexity approach.
There may be another approach if can find a cute way to exploit the special properties of that special metric.
One way to get to the taxicab metric verson of the problem is to take w = x + y and z = x - y. From then on all the distances you calculate in wz-space under the taxicab metric will be precisely twice the distance between the same points in xy-space under the square metric.
Math is crucial for your startup and I hear that, but not all of the companies need intensive math.
I do agree that those questions wouldn't sufficiently test real-world problem solving skills. But i guess companies could still do interviews after people passed the questions on the website.
Gads. Some parts of coding are easy. Some parts, say, understanding and having good experience with 3000 Web pages of .NET documentation at MSDN, can be more challenging! But even .NET is not difficult conceptually except in the many cases where the documentation sucks and the reader has to guess at what is going on to see how to use .NET.
So, in simple terms, coding is easy. More generally, everything it takes to code a significant application now is challenging in several respects; even if all the respects are just routine, they can be a LOT of work.
"Math is crucial for your startup and I hear that, but not all of the companies need intensive math."
That's right: But the third test question is really about math, just math, instead of computing. So, as I said, the third question is an example of computing being out'a gas and looking at applied math for content. The third question has some cute applied math content but, in nearly all of current computing, not much relevance to getting a significant application running. My work, using math, is an exception: Still, I'm not tempted to do some applied math to get a solution to 'prove something' to Interview Street. So, point: The emphasis on math by Interview Street is not good, not even for me who likes math. Indeed, as I explained, likely the people at Interview Street are in over their heads and would not understand the math of a good solution to the third problem even if I programmed it and documented it.
"I do agree that those questions wouldn't sufficiently test real-world problem solving skills. But i guess companies could still do interviews after people passed the questions on the website."
The questions are worse than that: In my business, I'm into a lot of math, but even I don't like the questions for selecting people. For businesses not so into math, the questions are still worse.
Net, the questions are just to 'select out' some people for no good reason. Indeed, there is good reason good people will refuse to answer the questions! So, the questions are dysfunctional and destructive.
In slightly more advanced terms, common in testing in the social sciences, the questions have no 'validity', that is, don't accurately measure what we want measured!
'Validity' is a big, HUGE deal: E.g., the SAT and CEEB tests are supposed to be 'valid' measures of ability to do well at college work. The GRE tests are supposed to be the same for graduate work. Etc. for GMAT, LSAT, etc. Establishing 'validity' for these tests was NOT easy. Generally establishing validity is not easy.
More likely 'valid' is what several posts in this thread have mentioned: Show me the working significant, practical, valuable application!
Once get validity handled, then we have to move on to 'reliability' which is essentially the 'variance' or 'accuracy' of the 'estimator' being considered. Or, in terms of mathematical statistics, the 'test' is an estimator of something we want to know, and 'validity' is the statistical 'bias' of the estimator and 'reliability' is it's variance (or the square root of the variance, that is, the standard deviation, if we prefer).
Here is the ugly side of Interview Street:
(1) The programming of their Web site sucks. We wouldn't want to hire the people who developed that Web site.
(2) The writing and the math in the presentation of the questions sucks. We don't want people evaluated in such content by people who have shown such low quality work with such content.
(3) The questions are heavily from just applied math (done poorly) with next to no 'face validity' at anything important for the intended purpose of recruiting 'rock star' hackers or whatever was the coveted goal.
(4) In the applied math, especially in the third question, they are likely in over their head and would not understand a good solution if they saw it.
Interview Street needs to clean up their act: Clean up their Web site, clean up their problem statements, make the questions relevant to the stated recruiting goals, and pay at least some attention to at least 'face validity' of the questions.
Really, these questions are the same song, second verse, of some Google HR nonsense as in
http://news.ycombinator.com/item?id=2801226
For the companies recruiting, recruiting challenges are well known: The 'HR' people want to be central in recruiting, and there my analogy of the absurdity of having house painters looking for Michelangelo to paint the ceiling in on target.
As a broad rule, under no circumstances should anyone in HR ever, on threat of immediate dismissal, mention anything technical to an employment candidate! Instead, HR people can smile, be nice, talk about the weather, offer coffee, tea, and soft drinks, help with travel and lodging reservations, help make reimbursement or cash advances easy, help with names and titles of people the candidate meets, explain the interview schedule, offer names and titles of people in HR for continuing contacts, be sure the candidate has enough rest time and a nice lunch, try to get the candidate a meeting with someone the candidate might know, pass out a benefits packet, indicate where the rest room is, smile, be nice, offer some fancy snacks, smile, be nice. Did I mention smile and be nice?