You can write it either way, actually. "senpai" is the more common spelling nowadays, but "sempai" used to be an often-seen spelling due to the pronunciation, back in the 90's.
You can write it either way, actually. "senpai" is the more common spelling nowadays, but "sempai" u