Chad Perrin: SOB

15 September 2010

How bad a programmer am I?

Filed under: Cognition,Geek,Profession — apotheon @ 04:43

I’ve come to realize something today:

I think of myself as a worse programmer than I actually am.

I don’t get as much code written as I would like. I run into a wall a lot of the time when trying to get something done, and it feels a little like I’m running up against the edge of my own competence. I know I’m no expert, nor even “proficient” in the Dreyfus model, but I might be better than I tend to think when I have those moments of incompetence.

I’ve realized that one of the biggest problems I have with making progress on my own projects is figuring out how I want to build them — to some extent, even figuring out what I want them to do. Once I have a clear idea of some piece of functionality that needs to be built, I tend to build it; once I know how I want to organize the architecture, I put it together; once I have a theory for the project’s concept, I design it. Reverse those steps, and you’ve got a path from concept to completion.

The biggest problem for me is, apparently, developing that theory for the project’s concept. When working on a fairly clear-cut project, such as when doing something for a client who has more than a vague notion of what (s)he wants, everything flows easily, but a lot of the time the vague notion is mine, and it’s up to me to come up with something clear-cut from there.

I’ve never been a cubicle-based developer. My information technology related dayjob employment has always been focused on things like network administration, data center support, and on-site client system recovery. I have not had a straight-up development job, per se, though I have done a fair bit of lightweight development for clients (Web development, software tool maintenance, integration, and actual — le gasp! — consulting). It occurs to me that if I had at some point had a desk-and-beige-box, cubicle-embedded, corporate development job I’d probably have a more positive view of my own programming skills.

In a cube farm, doing development scut-work, expanding the code base of some Enterprisey bloatware system by working on some micromanaged little segment of it, I would have realized much sooner that I do seem to have the ability to churn out code to meet the well-defined goals set before me — and do a better job of it if I understand how it fits into the big picture. In short, while I’ve spent a long time rating myself somewhere around the level of a low-level Advanced Beginner in the Dreyfus model, I think I might actually land squarely in the Competent category. It’s just difficult to see that from where I’m marooned on the far fringes of development, well outside the kind of programming work most developers do.

Maybe tomorrow I’ll change my mind, but for now it looks like I’ve suffered under a delusion that is the diametrical opposite of the Dunning-Kruger effect.

I’ve been thinking about the Dreyfus model of skill acquisition a lot lately (I blame Andy Hunt, and his book Pragmatic Thinking & Learning). It is in part because of this fact that I’ve come to realize that my own cognitive bias in the case of rating my development skills lands me squarely in the self-underestimating camp.

Now I just need to spend a few more days thinking about it to make sure my epiphany is not just a flash of ignorance, rather than insight. If it turns out this realization is not, itself, a misperception, I then need to start working on believing it. Long habit of belief in my own relative incompetence will be difficult to break.

11 May 2010

15 Stupid Google Interview Questions

Filed under: Cognition,Geek,Profession — apotheon @ 12:17

Okay, so the title isn’t exactly accurate. They aren’t all stupid. Some of them are actually kind of clever. Others are obviously just designed to see how the interviewee works. Some, however, are definitely stupid.

I ran across an old article at Business Insider: 15 Google Interview Questions That Will Make You Feel Stupid. In short, they did not make me feel stupid. They did, however, make me hope that the smart people at Google are smart enough to not take someone being stumped by a single question as a black mark on their interview, since anyone can be stumped by something that might appear simple in retrospect later.

Without further ado, here are the questions:

How many golf balls can fit in a school bus?

This question is evidently asked of applicants for a product manager position.

The answer is actually really simple. Develop a mathematical expression used to estimate. If they want a more exact number, tell them “Give me a school bus and an effectively unlimited supply of golf balls, and I’ll tell you.” Otherwise, your expression should allow for variable input based on the internal volume of the school bus. You may need to tell the interviewer that you need to look up something about how roughly spherical objects pack together, and you may have to ask whether you’re allowed to grind the golf balls into dust to fit more of them inside the school bus.

How much should you charge to wash all the windows in Seattle?

This question is also evidently asked of applicants for a product manager position.

$50 per window (then pay other people $30 per window to actually do the work). Tell them you want to double-check the market standard rate for window-washing before giving a final answer, though.

In a country in which people only want boys every family continues to have children until they have a boy. If they have a girl, they have another child. If they have a boy, they stop. What is the proportion of boys to girls in the country?

This is evidently yet another question asked of applicants for a product manager position, though I think it’s probably a good one for “software engineers”.

It’s time for another simple mathematical expression. This one might benefit from a little recursion. No, I’m not doing your work for you. The end result will, however, be very close to 50% each, with a negligible edge for boys — assuming a 50% gender split for birth rate.

How many piano tuners are there in the entire world?

How many of these target product managers? Here’s another one.

“I need more detail for project requirements. Let’s start with your definition of ‘piano tuner’. For instance — is every person who has ever tuned his own piano a ‘piano tuner’ for purposes of this? If you’re only talking about professionals, tell me how much money the person has to be making to be a ‘piano tuner’. Do we include out-of-work piano tuners? Details, man! I need details.”

That, or: “As many as there needs to be. There may be a few extra, or slightly fewer than there ‘needs’ to be, depending on externalities if people are trying to ‘manage’ the piano tuning economy, or something like that.”

One could always just start doing math based on assumptions of how long it takes to tune a generic “piano”, what constitutes a “piano tuner”, and what percentage of pianos actually get tuned, among other things. Such assumptions will almost certainly lead to inaccurate results, though.

Why are manhole covers round?

Hallelujah, this one is not for product managers. It’s a question for software engineer applicants. Funny how the first “software engineer” question strikes me as a “reverse engineering skills test” question.

If they were square, they might fall through the hole and kill someone working in the sewers.

Design an evacuation plan for San Francisco

Google must hire a lot of product managers. This is another question for such job applicants.

The way I thought of it was this:

“I’d just start working on details and ideas, and let them watch, since I’m sure what they want to see is how I work.” As a friend of mine put it when I posed the question to him, though, “Sure.” Poe-tay-toe, poe-tah-toe.

In any case, a number of questions would have to be asked (or assumptions made) at the start of the planning stage. I’m sure the questions you ask or assumptions you make (if questions other than basic question clarification aren’t allowed) are what they really want out of your “answer”.

How many times a day does a clock’s hands overlap?

Here we go again. Product managers galore.

“22, assuming a twelve hour circular analog clock with an hour hand and a minute hand. Let me know if the requirements differ, or if you want a mathematical expression that can take variable inputs for other clock designs.” The minute hand doesn’t cross the hour hand in the hour leading up to one o’clock, nor in the hour leading up to twelve, but it does cross at twelve. Thus, you have one overlap per hour on the clock, minus one.

Also: s/does/do/

Please make your interview questions grammatically correct.

Explain the significance of “dead beef”

Applicant type: Software engineer! There’s another one that isn’t a product manager.

I have two answers to this:

  1. Dead beef doesn’t fight you as much as live beef when you try to throw it on the grill.

  2. It’s a hexidecimal representation of a fairly big number. If you lop off two of those characters, depending on which pair (assuming you’re counting in twos rather than just picking characters at random), you also get the hexadecimal RGB code for one of several shades of nearly-gray.

The most annoying thing about this question is that they’re probably not really testing your abilities so much as your exposure to certain cultural phenomena — particularly the once-traditional use of 0xDEADBEEF as a test memory address. I’d fire the fucker asking this question of interviewees if that was his reason for asking, or at least ensure that he doesn’t get any say in who’s hired, because letting him keep good people out based on their lack of exposure to this one cultural tradition or let people in based on their exposure to it is a great way to get false positives and negatives in the interviewing process, and thus result in a lower overall value of employee pool.

A man pushed his car to a hotel and lost his fortune. What happened?

This is a question for people applying for a software engineer position.

My first question was “What the heck do these two things have to do with each other?” It occurs to me, after a little thought, that they might be completely unrelated.

You need to check that your friend, Bob, has your correct phone number, but you cannot ask him directly. You must write the question on a card which and give it to Eve who will take the card to Bob and return the answer to you. What must you write on the card, besides the question, to ensure Bob can encode the message so that Eve cannot read your phone number?

This question is evidently asked of applicants for a software engineer position.

First, I’d offer to rewrite the question so the interviewer doesn’t embarrass himself when giving it to other applicants. Then, I’d probably just send Bob a note that said something like “Call me on my cell, or have Eve tell me if you don’t have my number.” It’s not technically a question, but I suspect the interviewer wouldn’t complain. If he would, I probably don’t want to work for him. This is problem solving, not Jeopardy. Anyway, out-of-band confirmation if you’re trying to avoid letting Eve in on the secret seems like the most reasonable answer, so I’m pretty sure I win the prize here.

You’re the captain of a pirate ship and your crew gets to vote on how the gold is divided up. If fewer than half of the pirates agree with you, you die. How do you recommend apportioning the gold in such a way that you get a good share of the booty, but still survive?

This question is evidently asked of engineering manager applicants.

“Figure out how to give everyone exactly even shares — but don’t do it. Now take the money from the shares for a number of crew members equal to half minus two, and spread that money amongst the rest of the crew, so that more than half of them are happy with you. Take the share from the last guy, and put it in your own pot, just for a CEO golden parachute. Since we’re apparently being asshole CEOs about this, follow that up by asking Uncle Sam for TARP funds, then retire.”

The answer they actually want is probably to split the dough evenly amongst the smallest number of crew members that is more than exactly half. That’s slightly safer than my answer, but I think the difference is negligible and if you’re going to be an asshole about it you might as well make out like a bandit.

I wouldn’t give anyone who answered this question this way as if it’s how he actually does his job any kind of management position. Sociopaths need not apply. Nobody who actually believes they should conduct their personnel management duties like this should be let within a hundred miles of an engineer manager position.

You have eight balls all of the same size. 7 of them weigh the same, and one of them weighs slightly more. How can you find the ball that is heavier by using a balance and only two weighings?

This question is (again) for project manager applicants.

Ooh, sorting algorithm stuff.

  • Weigh three of the eight balls on each side of the balance.

    1. If one side is heavier, weigh one of the three on each side of the balance.

      • If one of them is heavier, you win.

      • If they’re the same, it’s the other ball, and you still win.

    2. If neither side is heavier, weigh the other two balls, one on each side of the balance.

      • One of them will be heavier. You win.

No matter how it works out, you’ve only done two weighings. I notice, after writing this answer, that it’s damned near pseudocode already.

You are given 2 eggs. You have access to a 100-story building. Eggs can be very hard or very fragile means it may break if dropped from the first floor or may not even break if dropped from 100th floor. Both eggs are identical. You need to figure out the highest floor of a 100-story building an egg can be dropped without breaking. The question is how many drops you need to make. You are allowed to break 2 eggs in the process.

Get ready for something different: a question for project manager applicants.

I really hope the problems with the clarity and grammar in these questions is a Business Insider problem, and not a Google problem.

This is another sorting algorithm kinda thingie. I’m less certain of this one, off the top of my head. I guess I’d start by dropping one from either the 13th or 14th floor, depending on which I figured would take less time to get to my goal (I’d have to do math for that, or guess based on my mood at the time, and I’m not doing much math today). Then, I’d do something like this:

Given N = (14 or 13) and n = N:
until N > 100,
set N = (current + (n -= 1))

Thus, if we assume N is 14, we drop first from the 14th, then from the 27th, then from the 39th, and so on, until the egg breaks or we get to 100 without it breaking. If it never breaks, our answer is 100. If it breaks, take a step back to the last floor where we dropped it and it didn’t break and start going up one floor at a time until the second egg breaks. Intuitively, I’d say that with either 13 or 14 as the starting value we shouldn’t end up with more than about 15 tries before we figure out which floor, and we’d end up breaking either two eggs total or no eggs. I think.

Explain a database in three sentences to your eight-year-old nephew.

Why does a product manager need to explain a database to his eight year old nephew?

“Say you have a bunch of checkerboards and a crapton of checkers, each of which has a different piece of information on it, and you store your checkers with their information in the squares of the checkerboards. Each board is sort of a categorical topic area, with each column and row corresponding to a value type so that when you combine the value types you get unique values that correspond to each piece of information. There, I did it in two.”

Yes, any eight year old nephew of mine that would get my explanation of a database would be pretty smart. If he was dumb, I’d say “It’s like a well-organized bucket that you fill up with things you know.”

Note that nobody said it had to be a relational database, and I went beyond the call of duty assuming it was a technical implementation of a database as one uses with a DBMS anyway so that there’d be something to explain (otherwise it really is just a bucket of information).

I’m sorry. This is really just an incredibly stupid question. Maybe I should have used one sentence: “Here’s the URL for the Wikipedia page for ‘database’.” Yes, a question that tests one’s ability to explain technical things in simple terms can be very important, but there’s not nearly enough context here to actually give an answer that will suit the needs of whatever scenario the interviewer has in his head.

You are shrunk to the height of a nickel and your mass is proportionally reduced so as to maintain your original density. You are then thrown into an empty glass blender. The blades will start moving in 60 seconds. What do you do?

What do questions like this have to do with being a product manager?

Considering the dimensions I’d have at that point, I might just try lying down and letting the blades whir over my head. I’d hold on tight for good measure. This is assuming I couldn’t disable the blender, of course. This is a terrible question. Maybe they’d be happy with the answer “fire the guy who shrank me and put me in the blender, and get his replacement to get me out,” since this question is so stupid.

The Rest of the Story

I looked at the provided answers after I wrote the rest of this SOB entry. The answer to the question about the guy pushing the car is an even stupider, more culturally dependent answer than the thing about dead beef, and if getting hired depends on the answer to that, there’s something deeply fucking wrong in Google’s hiring process. Seriously. What if I pushed my wookie, instead of my car? Maybe I’m playing the Star Wars Edition, numbnuts.

Before the list of fifteen questions from Google interviews that are supposed to make you feel stupid, the Business Insider article offered three criteria for getting hired at Google that have nothing to do with these questions:

  • Google prefers Ivy Leaguers.
  • It cares about your GPA, even if you’re in your 30s.
  • It wants people who want to change the world.

I’m okay with the last item in that list, but the first two are ridiculous. Seriously? This is another case of that tendency hiring managers and HR people have to believe that something that narrows the field is good even if it doesn’t actually test for something particularly relevant to job performance. Sure, a higher GPA may correspond to a slightly higher tendency toward good job performance, but by throwing out anyone whose GPA sucked (or may not have attended college at all), you may be ignoring a completely different, more directly relevant metric that could have a much more important and reliable impact on your ability to hire the very best. Don’t even get me started on the Ivy League school preference. Remember that correlation does not imply causation, and you’ll avoid these asinine mistakes that major corporations all seem dead-set on making.

I’m also not sure the last item on the list has led to good things. How exactly do these people want to change the world? Judging by Google’s performance, this requirement has resulted in better-than-average outcomes for the “don’t be evil” motto, and for the corporation’s success, but “better-than-average” for a major tech corporation isn’t saying much when you’re comparing it against examples like Microsoft and Oracle. If average is somewhere south of -85% on the Goodness Scale, I don’t think a “better-than-average” result of -80% is a “good” outcome. Maybe Google should change that motto to “Don’t be as evil as Microsoft.” At least then it’ll probably correlate more strongly with results.

11 November 2009

The Tolerationist Manifesto

Filed under: Cognition,Liberty — apotheon @ 10:28

This morning, I drove the SigO to work — a departure from our usual routine. Normally, she drives herself, and when driving to and from work each day she has about thirty-five minutes during which she listens to the radio. Like me, she is highly skeptical of the biases, propaganda, and sensationalism of both mainstream and “public” news sources, but also like me she realizes that despite all that, one needs to stay in touch with mainstream and “public” news sources from time to time to keep abreast of a particular category of news: the slanted, inaccurate, and obfuscated concerns that most people tend to think of as “news”.

Unlike me, she listens to NPR on a semi-regular basis on those trips to and from work. Her news input has a somewhat higher percentage of mainstream slant than mine as a result, though I often get to benefit from her exposure when she tells me about the latest bit of ludicrous off-target reporting. Often enough, the most interesting thing she shares with me when she gets home from work is the news items she has particularly noted were not covered by NPR.

Today, however, I listened to NPR with her on the way to work, and some more after I dropped her off. There was a fair bit of the usual bias, propaganda, and sensationalism, of course. One thing that caught my attention, however, was a brief discussion with Krista Tippett, who hosts an American Public Media program called Speaking of Faith. I had never heard of the woman before, but she identifies the program as not so much proselytizing and opining and doing much of the rest of what one might expect from a program with a title redolent of religious subject matter. Rather, she talks about how her aim is to bring many of the important topics of the day, over which people on both sides of many divides in religious opinion tear at each other, into the light so they may be honestly addressed and discussed. She talks about seeking understanding and common ground.

I have met people who believe that Christianity is the only solid foundation upon which a libertarian worldview may be built, and others who believe that the tenets of any religion must inevitably undermine any otherwise solid foundation for liberty. In a world where militant fundamentalism has been proven to be the basis for almost everything that can lead to harm and hatred, including both left- and right-wing politics, militant fundamentalist atheism and monotheism are occasoinally found to be at each others’ throats in arguments over what libertarianism really means.

The truth is that both sides of that particular argument have some good points behind them. There is a kernel of truth behind each fallacy.

On one hand, as Krista Tippett pointed out in that brief discussion on NPR today when talking about the contentious issue of same-sex marriages and the rancorous disagreement over how the law should treat such matters, the Bible is suspiciously lacking in explicit guidance on how secular law should deal with the problem. Every argument for legal prohibition against same-sex marriage is based in large part on inference and interpretation, which leads to a vast divide between those Christians who oppose any and all recognition of same-sex marriage under any circumstances and press for legal prohibitions against it in no uncertain terms, and those who support secular tolerance and religious compassion for those who want legal recognition for their relationships even while aiming to not only understand their struggle, but help them achieve a state of grace through kindness rather than censure and insult. As she put it, Krista Tippett seeks to bring not only the valid disagreement within Christian communities over the subject of same-sex marriage to light, but to shine that light on the fact that what it means to be Christian can itself be subject to differing valid interpretations.

Compounding the problem of a lack of explicit guidance on the matter of how the law should handle such controversial subjects as same-sex marriage is the fact that the New Testament in particular is rife with explicit guidance on the matter of learning to love one’s neighbor, to love one’s enemy as oneself, to love the sinner but hate the sin. This is really the foundation of a Christian understanding of liberty, where the Word of God is clear that some things are sinful and, perhaps, inspired by Evil — but we must still find within ourselves love for the individual who has been seduced by that Evil, because that way lies not only our personal paths to grace, but those of our erstwhile enemies, the people who consciously pursue a life of sin that they simply may not recognize as sinful. It is, in large part, upon such a foundation of tolerance and love for one’s fellow man that the people whose influence upon the birth of the United States is still felt today chose to explicitly mandate freedom of religion as one of the nation’s founding tenets. Tolerance, and even mutual understanding, of disagreement over answers to the deepest questions of our lives is a necessary component of a nation founded in liberty, and the words of Jesus Christ as related to us by the apostles in the New Testament exhort us toward such tolerance.

On the other hand, the strong monotheistic religions of the world speak of salvation and damnation at great length. While the path to salvation as navigated through the examples of holy scriptures seems long and arduous, the paths to damnation are many and often very short and direct. Despite instruction to tolerate and even love our brothers and sisters despite their sinful ways, we know that if one accepts the word of the Bible (and similar works such as the Koran and the Tanakh — let us not leave out other monotheistic religions) there are many specific acts and motivations that are anathema, which damn those who avail themselves of such acts and motives. There may be paths to redemption, depending on the act or motive, the official doctrine of one’s denomination, and the personal interpretation, but the threat of damnation is ever-present and of greater peril than any other danger in our lives, for there is nothing more terrible than damnation. For the most religiously fervent, there can be little, if anything, more desirable than to protect one’s loved ones from damnation.

To those who allow themselves to consciously recognize this fact, and do not shrink from such knowledge or waver in their faith in the truth of its basis in divine revelation, personal damnation may even be preferable to allowing loved ones to be damned through seduction of their wills by a corrupt, perverse, sinful world. While we are exhorted to love our neighbors and tolerate their differences that we may save both our own souls and — God willing — theirs, we are similarly reminded of the great peril the influence of those already damned represents for our closest loved ones. It is difficult to love one’s neighbor when one’s own son or daughter is daily subject to a mainstream tolerance for the sinful ways of our neighbors. That tolerance may too easily be mistaken for acceptance, and understanding might too easily be mistaken for agreement. Perhaps worse, given time, tolerance and understanding might become acceptance and agreement for many people. With such examples all around us, any who believe in the perils of damnation for sinful acts with an unassailable faith may find the insidious influence of such tolerance and understanding abhorrent. Combining the most literal faith with the most altruistic devotion to one’s closest loved ones, it is difficult for me to imagine one failing to choose to reduce such influences on one’s loved ones by any means possible, including hurtful propaganda, twisting the laws of a nation founded in liberty to serve theocratic oppression, bombing abortion clinics and shooting the doctors who perform abortions, and even launching terrorist attacks against centers of sin and iniquity that kill thousands and plunge entire nations into mourning.

It is not, in fact, about punishing the wicked. Rather, the key to understanding many of these acts of intolerance and fear is to realize that, by some literalist perspectives on religious faith, they are necessary acts of defense for the people one loves most dearly. Note that, for the moment, I am ignoring the case of people who are simply ignorant of the true implications of the tolerance and love we are instructed to show our neighbors.

Each of these two understandings of the Christian faith is equally valid. In fact, in many respects, they are the same perspective. The difference is between personal obedience to the kinder, gentler teachings of the divine Word, and sacrifice of one’s own salvation to defend that of others. Many may choose to avoid thinking about the fact they may be damning themselves, of course, but they surely seek the salvation of those they love and are clearly willing to at least risk danger of damnation to their own souls.

Sam Harris’ book The End of Faith focuses on the logical necessity for killing unbelievers until there is no longer any substantial danger of their corrupting influence damning those one loves, and suggests that for this reason any faith that sets forth guidelines for salvation and damnation the way the major monotheistic faiths of our world do so must eventually vanish from the Earth before there will cease to be danger of religious, terroristic violence in the world. In his book, he suggests that religious moderates are, perforce, the least faithful of their fellow congregants.

I do not agree with this assessment that religious moderation is necessarily a product of weak faith. In fact, in at least some cases I believe that the strongest guidance a given divine revelation offers is to love one’s neighbors as oneself, to pursue tolerance and understanding that the sinner may be guided to a state of grace by compassion and by the example of the faithful. I believe the willingness to take the approach of tolerance and understanding to faith is to place great trust in God that one’s loved ones will not be damned due to the influences of the wicked, that damning oneself is not a necessary step toward protecting those one loves.

At the same time, I can see that for many the lure of logical necessity to treat the chronic, conscious sinner as an enemy who must be vanquished by any means at hand, by fire and blood even, is not likely to evaporate any time soon. Perhaps Harris is right about that other assessment of the influence of religious faith on our world, in that freedom from terrorism and violence inspired by religious beliefs is impossible so long as such religious beliefs exist in the world. Even if that is the case, however, we simply must not allow ourselves to be seduced by the countrary evil. To turn the danger that some of the faithful present to the rest of us into motivation for an attack on all the faithful is to adopt the intolerance, willful ignorance, and unconscionable, self-contradictory methods of violence we deplore, and in fighting the monster to become the monster ourselves.

The “moderate” stand, where one dedicates oneself to principles of liberty, where individuals are judged on their merits rather than membership in overly broad categories of stereotype, is the one faith to which we should all subscribe; that becoming wicked in pursuit of the wicked only perpetuates the mechanisms of evil in the world. Accept alike both Monotheist and Atheist lover of liberty, with open arms. It is the determination to respect one anothers’ rights, and to live together in peaceful acceptance and understanding of our differences, that most tightly binds us together as brothers and sisters. Christian, Muslim, Atheist, Jew, Asatru, Buddhist, Agnostic, Nonspecific Secular Humanist, or even confused Taoist like me — the common ground we should all be able to find is that of understanding for each other as individuals, and an idealistic desire to live together in peace and liberty. Let our differences be damned, not ourselves.

Older Posts »

All original content Copyright Chad Perrin: Distributed under the terms of the Open Works License