1,874 reputation
11924
bio website
location
age
visits member for 4 years, 3 months
seen Aug 11 at 22:29

Apr
26
awarded  Popular Question
Apr
22
comment Explicitly defining variable data types vs. using the keyword 'var'?
Eric Lippert of the C# compiler team recently blogged about this: blogs.msdn.com/b/ericlippert/archive/2011/04/20/…
Apr
17
comment How do you ascertain the quality of a potential employer's code before you take a position?
I think it's pretty reasonable to say you'd like a chance to speak with some of the developers who would be your peers.
Apr
10
comment Should a senior developer refuse to take paper exams during an interview?
+1. Writing code during interview: Good. Writing code and discussing it with the interviewer: Much, much better.
Apr
10
comment Should a senior developer refuse to take paper exams during an interview?
And some have 2 years but think in binary...
Apr
10
comment Should a senior developer refuse to take paper exams during an interview?
@Bo: I think that hiring someone who's unqualified is generally way more costly than missing out on someone who is qualified.
Mar
8
comment What is the greatest design flaw you have faced in any programming language?
@dan04: I agree, it's accidental fall through that's the problem, and requiring an explicit fall would prevent this. However, I suspect (just a guess) that this was left out of C# as a deliberate design decision to avoid bugs due the order of the cases being changed. goto case can achieve the same functionality without that risk. Yes, everyone hates gotos, but I'm not sure how strong that sentiment would be if its use had always been restricted to the way it's used in C#'s switch statement (and especially if we further restrict ourselves to only forwards-jumping gotos).
Mar
8
comment What is the greatest design flaw you have faced in any programming language?
@Kirk Broadhurst: Technically break is not mandatory in a C# switch statement, if it was then it would be pointless since it could just be assumed. What is mandatory is a jump statement of some sort, such as break, return or goto. (Except in an empty case, where fall-through is allowed.)
Feb
26
comment What is your favorite whiteboard interview problem?
+1 because I think it's a good question for a job that requires geometry. There's plenty of reasoning involved, not just plugging into a formula. That said, I know some good programmers who'd be tripped up just because they haven't so much as had to think about circles in 10 years -- but the question doesn't ask for a suitable question for any developer interview. The currently top-voted SQL question (which I also like) is at least as job-specific.
Feb
26
comment What is your favorite whiteboard interview problem?
This gives r = 20.5cm, meaning the area of the crescent is 643.24cm^2 (or 6*10^2 cm^2 if we care about significant figures).
Feb
26
comment What is your favorite whiteboard interview problem?
I enjoyed this problem. I hope you don't mind me sharing my solution to part (a). The diameters differ by 9cm, so if the inner circle has radius r, the outer circle has radius r + 4.5. The area of the crescent is the difference in the areas of the circles: pi(r + 4.5)^2 - pi * r^2. All that's left is finding r. Define C as the point (0,0), then point E is at (0, r - 0.5) (because CE is 5cm less than the larger radius). The inner circle is shifted right 4.5cm, so its equation is (x - 4.5)^2 + y^2 = r^2. Plug in (x,y) = (0, r - 0.5) and solve for r.
Feb
15
awarded  Nice Question
Feb
15
comment What's your favorite interview question?
@ChrisF: I rephrased to try to get a bit more of the "sharing experiences" and "asking why", which should also hit more of the "invites longer answers". Let me know if it needs further revision.
Feb
15
revised What's your favorite interview question?
added 158 characters in body; edited tags
Jan
12
comment What is your favorite whiteboard interview problem?
I guess I would do this: DELETE FROM Things WHERE ID NOT IN (SELECT MIN(ID) FROM Things GROUP BY Name). Do you have a preferred solution?
Jan
12
comment What is your favorite whiteboard interview problem?
@Jon Hopkins: OK, I get what you're doing now. You want to find all of the rows with duplicates so you can kill all but one of each, leaving only the de-duped rows. I was initially thinking that you just wanted a query that returns the rows while omitting duplicates, which is why it seemed really simple.
Dec
25
awarded  Pundit
Dec
20
comment What is your favorite whiteboard interview problem?
@Jon: Not sure what you mean by "That gives the count for everything". From your example solution, it looks like what you want is one row for each distinct name. From your comments it seems like maybe you mean something like HAVING count(Name) > 1, but then I guess your sample answer should omit Bodkin Van Horn, Hot Shot, Snimm, and Dave.
Dec
20
comment Is using ELSE bad programming?
Yes, this is very language dependent. In C#, where if requires a bool, variables must be definitely assigned, all paths must return a value, etc., I cannot think of any reason the order of if and else would matter besides readability. That is, if(a){b();}{c();} should be equivalent to if(!a){c();{b();}. In JavaScript, on the other hand, you have to be aware that passwordCheck could be undefined, etc.
Dec
20
comment What is your favorite whiteboard interview problem?
I guess I don't know what counts as "entirely trivial"... Something like SELECT min(ID), Name FROM Things GROUP BY Name would work, right?