Monthly Archives: February 2023

A fun little puzzle

I ran across this puzzle about 10 years ago. Although it didn’t take me long to come up with the optimum solution, I find the puzzle interesting because it just might be a good interview question for programmers at different … Continue reading

Posted in Software development | Tagged | Leave a comment

Birthdays, random numbers, and hash keys

You’re probably familiar with the Birthday Paradox, either from your introductory statistics class or from hanging around computer programmers for too long. Briefly, the math shows that the odds of any two people in a group having the same month and … Continue reading

Posted in Software development | Tagged | Leave a comment

Subtraction is not the same as comparison

(Originally posted in somewhat different form on 11/21/2016.) All too often, I run across integer comparison functions that work, but have a latent bug. It’s not a bug that you’ll run into very often but when you do run into … Continue reading

Posted in Software development | Tagged | Leave a comment

Computer programs are not cats

(Originally published February 1, 2013) I see questions like this fairly regularly: I’ve said before that Thread.Sleep is a red flag indicating that something is not quite right. And when a call to Sleep is in a loop, it’s a near certainty that there is a … Continue reading

Posted in Software development | Tagged | Leave a comment