There's no continuous project you're working on. It's just getting a lot of chances of winning the lottery. If someone finishes before you, you just slightly alter the number you're searching for and continue on. You're also not really working towards the same thing. Your solution probably includes you sending the blockreward to yourself and their solution includes them sending it to themselves too, on top of that you may also choose other secondary transactions. The chosen transactions influence the number you need to find.
It does happen that two blocks are found at nearly the same time, before adjustments can be made. In those cases one of the two ends up getting 'orphaned', it's relatively rare compared to normal blocks though.