Off-by-one errors happen when you iterate one time too many or too few. Using i < 10 loops 10 times (0-9). Using i <= 10 loops 11 times (0-10). Forgetting to update the loop variable causes infinite loops.
Updating the wrong variable leaves the condition unchanged. Using = instead of == in conditions assigns instead of comparing. while (x = 0) assigns 0 to x, making the condition false immediately.