Thursday, August 30, 2007

Interviews

I just don't understand it. Almost everyone I interview is pretty clueless. It's very frustrating to go into an interview with a list of questions and have the candidate strike out on nearly every one.

My group is looking for a person who would be a good lead developer for the GUI portion of one of the Calibre tools. So, obviously a NUB probably wouldn't qualify. But to be honest, the recent grads probably know more than the two ... um ... candidates (biting my tongue here) I've had the ... joy of interviewing.

The first was someone already working for Mentor. He'd been there for 7 years. Turns out he had a masters - of mechanical engineering (I didn't notice the area of study until after the interview). I lined up my standard line of questions, the first couple of which I'm embarrassed to even ask. Because the the first set of questions are embarrassing, I begin by saying something to the effect that I always ask these questions and if they seem too simple, we'll blow right through them, it's not to be taken as an indication of my first impression of the candidate.

Here's essentially what I ask:

  • Name some basic data structures. What are the trade-offs of using one over the other?

  • Define the following C++ terms:
    • inheritance
    • virtual functions
    • static functions/data
    • abstract base class
    • pure virtual function
    • operator overloading
    • templates
    • polymorphism

  • When do you use templates and when should you use inheritance?

  • First programming question, complete the following:
    int string_to_int(char *str) {
    /* convert string representing a number into an integer */
    }

    Restrictions come in as appropriate: (can't use atoi, strlen, exp, use only O(n) multiplications.

  • You are given a long line and are told to cut it up into pieces.
    The restrictions are:
    .) No piece can be shorter than some MIN length
    .) No piece can be longer than MAX length
    .) Every cut must be on a unit boundary
    .) There are locations that cannot be cut, presume the function can_cut(x) tells you whether or not you can cut at a location x

    Describe how you would do this.
    Can it be done in linear time/space?
  • A design question from my brother: design a messaging system to handle arbitrary messages of a variety of types, with listeners and senders who may be geographically diverse.
  • And lastly, because we had a little time:
    Write a function `samepattern' that takes two string arguments, 
    and returns true iff the strings have the same pattern. Two strings
    have the same pattern if when elements are equal in the first string,
    the corresponding elements in the second string are equal, and vice
    versa.



Well, the first guy barely answered the data structures questions - which is a bad sign. He did marginally better with the C++ questions, and then we hit the first programming question. He had a horribly difficult time realizing that 123 is 1*10^2 + 2*10^1 + 3*10^0, and finally, after I provided that information he had a tough time figuring out the solution (we never went through refinements, I needed a break). The rail-cutter problem simply baffled him - he had no idea where to start when his algorithm reached a point where he couldn't make a cut. The design question was abysmal, I got a couple of class names out of him, but I had to hold his hand to get each one. I forget how I ended things, but I tried to keep a smile on my face.

The second guy I interviewed did better. He got a little flustered with an impromptu virtual function question I wrote, but it was obscure. He had written string_to_int sometime in his long history (he'd graduated college before I was born), so he nailed that. At that point I noticed he didn't write anything down - no big deal as he nailed the question. We moved on to the rail cutter question and he had some trouble. His code (once I got him to write things down) was horribly ugly and showed he had no idea how to actually return the results. Furthermore, he had NO confidence his program would work, and simply guessed at the runtime. The design question was like pulling teeth, he didn't seem to like talking about design, nor did he seem to think about the scaling implications of a large system. Then, with the few remaining minutes I thought I'd throw him a softball, the 'samepattern' function, so we could end on a high note. He stared at the problem (only responding by saying he understood it) for 8 minutes before giving up.

The first guy just bombed, the only feedback for him would be to go back and study your CS101 and other introductory courses. He, at least, was eager and energetic and put forth a great effort.

The second guy, well, he's been around long enough to know better.

First, be confident about what you're doing, and if you're not, have an idea where the problems might be. He literally told me he didn't think his solution would find all the test cases. Ok, that's honest, but it tells me he really didn't understand the problem he told me he did, nor can he recognize the exhaustive search he just wrote (which did cover all cases).

He then said it'd run in polynomial time, which covers most everything. I asked him to refine that, b/c that covers everything from linear to N^100000 and beyond. He had no idea, letting me know he'd just guessed. His solution ran in exponential time, much worse than polynomial.

Third, write stuff down. It's fine to talk, I encourage people to talk, talking is good because it lets me know your thought process. But if the interviewer passes you a piece of paper and a pen and asks you to "write a solution" then you'd better do that. Hand-waving only gets you so far and I, as an interviewer, am going to ask specific questions to get through your hand-waving.

Lastly, never simply give up on a problem. Try talking through it, brainstorm, do something. Staring at a problem for 8 minutes w/out saying anything is a sure way to lose the interview. Especially when the problem was literally taken out of an introductory CS course.

Lastly, at the beginning of the interviews I ask candidates how they think they rate on a scale of 1 to 10 (clueless to expert) for each of their programming languages. People seem to respond 7 or 8, regardless of their actual background. For C++, I find it very interesting that someone would answer that high of a number when they either don't use STL, or have only used STL. Now a scale is rather arbitrary (and the geeks who're reading this far are thinking, "well, is is the scale linear, logarithmic, what?"), but still. If you've never done template programming, nor can you explain *why* you'd want to do template programming, you're likely not an 7, surely not an 8. And if you stumble horribly on a virtual function question, you don't rate above a 6.

Ironically I think I'm a 7 or 8. At least I can answer all my questions.

iBike WW34 & WW35

Two rides happened this weekend. The standard "go to farmer's market" on Saturday, only this time Tom joined us, riding on my single speed. You could tell Tom really grooved on riding a single speed by his constant praise, "um.... why?"

And on Sunday, the Wyatt's came down to see us and ride. We went down town, then through campus, over the covered bridge, and back on 53rd. It was a beautiful day for a ride, and we finished by picking a quart of black berries to make dessert. yum!

Wednesday, August 22, 2007

NPR Touts Pro-Nuke 'Environmentalists'

I remember hearing the NPR piece about nuclear power which talked with David Whitford. When I got to work I briefly tried Googling him to see what his ties were, but didn't get much past the fact he is a writer for FORTUNE. And I couldn't remember the 'environmentalist' mentioned in the piece, Stewart Brand, who turns out to have strong ties to the nuclear industry.

I'm glad FAIR did a little critique of the piece and of NPR's coverage of nuclear power, as even I found it to be woefully one-sided: NPR Touts Pro-Nuke 'Environmentalists'

Tuesday, August 21, 2007

The Problems With 401ks

I'd heard the same logic applied to Bush's plan to privatize social security, namely that it'd be a horrible idea because it ultimately would just give Wall Street incentive to skim money off the top, and puts the onus on Joe Blow to properly invest that money (which is *exactly* what pensions/social security was to solve). If you look at the stats, over 80% of actively managed funds fail to beat the S&P 500. A big portion of that is the fees involved are often 1% or higher of the the value of the funds (not just off the profits). That has a huge impact on the returns you'll make in the long run.

So, it seems obvious to me that when investing, you should invest in the index funds (perhaps S&P 500, maybe a mid or small-cap fund, a european/asian fund (to diversify outside of the U.S. market)). Do you really think you're going to do to better than people whose job it is to invest? And given the fact that 8/10 of them cannot reliably beat the S&P 500...

And you can always find short-term winners. I know people who are gung-ho on AAPL because it's done great things for the past couple of years, and that's great. But like others who I know who are still heavy into INTC and MSFT (which have essentially been flat for 10 years), all quick risers come to an end. The regression toward the mean is really strong.

Anyway, that's a long intro to the same analysis of 401ks done here:

Joe Ponzio's F Wall Street

And he agrees with me, invest in index funds with low overhead.

Saturday, August 18, 2007

6 Years!

6 years ago Mary and I tied the knot on a beautiful August day at Belknap (holy cow, they have a web site). Today we went out to a movie (Once - thumbs up) to celebrate.

Hoping the next 6 years are just as good (or even better).

iBike

Three weeks of updates here.
Today I took a nice ride toward Philomath, cut across Bald Hill, and back over Witham Hill. 45 min

Last week, Simone and I took a beautiful ride on a Friday (was working from home for the first time @ Mentor). 45 min

And the week before we rode downtown as a family and played in the fountain. Lovely time had by all.

Thursday, August 16, 2007

Pollution is Bad

Ok, this is kind of a 'no duh' article, but to carry any weight with the "the market solves everything" crowd, you need to quantify how much of an impact bad environmental policies have. Turns out that nearly half the deaths world wide are caused by pollution. The researchers are from Cornell, so it must be true (Go Big Red!!!!), but even if they're off by a factor of 2 or 4, that's still a heck of a lot of deaths attributed to pollution.

Check it out: ScienceDaily: Pollution Causes 40 Percent Of Deaths Worldwide, Study Finds

Wednesday, August 08, 2007

Do Biofuels Mean Inexpensive Food Is a Thing of the Past?

Ok, so it seems I was a bit wrong about the connection between farm subsidies and food prices. A new study is out that explains things in plain English: Do Biofuels Mean Inexpensive Food Is a Thing of the Past?

Tuesday, August 07, 2007

Nine in 10 Americans say ban texting while driving - Yahoo! News

There are studies out there showing that talking on the phone while driving is equivalent to driving drunk. Some states are legislating against driving while talking on the phone. Turns out people are pretty unanimous in wanting texting while driving to be banned.

What I find ironic about all this is that almost everyone you talk to seems to agree with the above statements, but will say that they think they're an exception to the rule. "Oh - yeah, that's true, but I'm really careful when I'm talking on the phone."

Ha ha ha, right.

I'll go on the record and say I'm sure I'm not as safe when I'm talking on the phone while driving.

Nice Math Proof

I was never very good at math proofs (I could do math classes, but I'm sure I never came up with anything that wasn't an answer to a textbook question). This proof is pretty neat in that it's solving something relatively complicated, but the math works out so beautifully.

Polymathematics: Trekking Into the Desert

The New Math Of Global Warming

The math geek in me + the environmentalist just can't resist this set of slides:

The New Math Of Global Warming

Saturday, July 28, 2007

iBike WW29 (1) (2)

Double the bang for your buck, two biking posts in one.

Last Sunday was Da Vinci Days, and we took part in the festivities by watching the mud bog portion of the kinetic sculpture race, and walking around the main area checking out the booths. Fun was had by all (Tom, Mary, Simone and me). Mary and I rode our bikes (Simone jogged alongside), and I'm sure we rode at least half an hour.

Today, Simone and I took a nice long ride toward Oak Creek on the single speed. We rode around some of the neighborhoods out there - neat houses and yards. Simone napped for over half an hour (probably a little bored). Stats for the ride: 1h50min, average speed just over 10mph, for a total of nearly 18.5 miles.

Friday, July 27, 2007

Sleep and Jogging

I went for a jog last night with Simone. She decided it was her turn to ride in the Burley and I had to push her, so it was to be.

As she's not much of a talker, and I have trouble breathing, let alone talking, while running, I usually listen to my MP3 player. Last night's selection was an
episode of Radio Lab on sleep. A fascinating listen I must say. Did you know that birds, aquatic mammals and reptiles can put half of their brain to sleep at a time? Imagine 4 ducks sleeping on a log, the two in the middle sleep with both eyes closed, the ones on the ends sleep with one eye open, and after a chunk of time, the ones on the end stand up, turn around, and sleep with the other eye open.

I highly recommend giving it a listen. Radiolab in general does interesting stories and mixes the stories in a very unique and interesting way.

Duck!

Bad news for my grand kids (or perhaps their kids).

July 16, 1862: This Comet Has
Earth Written All Over It


Don't forget to duck come August 14th, 2126.

Saturday, July 21, 2007

iBike WW29 (1)

Another Simone ride. We kind of perused around the outskirts of town today, going over the hill by the country club, then back along the duck pond, out the midge cramer trail to oak creek and back. Simone slept for 45 minutes, and if she hadn't woken up when she did, we would have gone over Witham hill too.

Time: 1h15min

Monday, July 16, 2007

Smart Simone

Wanna know how smart Simone is?

She made a meta-rattle the other day and played with it.

And you probably don't even know what one is...

(a rattle made from another rattle)

iBike WW28 (1)

Last Saturday was another ride to the market with Simone, though we took the longer route (via Walnut) to get there. We picked up some berries to eat and played in the fountain - which she loved. A nice day all in all.

Ride stats: time: 55min, distance ?

Innovation at Risk

I've had many a discussion with friends about patents (specifically whether or not they should be applied to software). Here's an interesting book that's about to come out that looks at patents from an economic point of view - basically, are they adding to our economy or dragging it down.

Innovation at Risk

Three chapters are available on-line. The first is the introduction (worth reading), and I imagine that I should read the ninth so I can win the next debate.

Popcorn prices popping up

The demand for ethanol is forcing up prices for ice cream (b/c dairy herds are fed corn), and popcorn.

globeandmail.com: Ethanol demand sends corn prices popping

Of course, nobody seemed to care when Mexico complained their tortilla prices went up...

But rising food prices kind of misses the point. We now spend less than half of our disposable income on food than we did 75 years ago. The other day I saw an ad for meat at Safeway and beef was selling for $1.50 a pound. That's simply ridiculously cheap. It takes 10 times the energy and resources to grow a pound of beef than it does to grow a pound of produce, yet I can buy it for less than much of the fresh fruit at the store. Between 50% and 70% of the total cost of a beef cow is feed cost, and since most of the beef in the US is finished with corn, the price of corn will have a definite impact on the price we see at the store.

Needless to say, corn-fed beef isn't as healthy for you as grass-fed beef (higher CLA and Omega-3 fatty acids). Corn-fed beef have much higher of bacteria in their guts - requiring them to be fed antibiotics.

Anyway, considering the health impact of beef in general, and the environmental impact of growing beef (corn is a very petroleum-heavy food b/c of pesticides and fertilizer), I'd be happy if beef costs were higher in the store - something more along the line of the cost of fish ($7-$15 a pound).

Saturday, July 07, 2007

iBike WW27 (1)

Simone and I rode downtown to pick up some fish for dinner. Beautiful sunny day, nice gentle ride. While downtown, we walked through the farmer's market and into the post office and that kind of thing. Simone got most excited when she saw the water fountain on the waterfront.

It's one of those fountains that is flush with the ground and has about two dozen water jets that shoot straight up. They turn on and off in different patterns and with different heights, and the kids love it. Simone started by just walking in the water that was draining off the side. Then she decided to go check out one of the spouts. After that she was shrieking like all the other kids, putting her hands into the spouts of water and walking from spout to spout. Lots of fun. She got to ride home in just her diaper because her clothes were soaked.

You can check the water fountain out here.