The Gemara in Sanhedrin (Kuf Vav Amud Beis) says that Billam suffered all 4 deaths that are given by Beis Din. Rashi explains they hung him-CHENEK, and lit a fire under him, and chopped off his head-SAYIF, so he fell-SKILAH into the fire-SREIFAH.The question is how is that all four if SKILAH and SREIFAH were done after his Death?
The Maharsha answers that first they stoned him a little then they put a little wick in his mouth again not to the extent of death, they choked him almost until death and finally they chopped off his head killing him, thereby getting a bit of all the Deaths of Beis Din.
The Shevus Yackov has a more an interesting answer. He claims is that Billam with his Magic did not allow himself to die and kept himself alive until the removal oh his head and hence got all the deaths of Beis Din.
The Ben Ish Chai has an amazing story on this topic. There was a person in Bagdad a comedian by profession not religious and mocked religious practices and religon as a whole. While entertaining at a party there was fish served and the comedian failed to heed Chazal and spoke in middle of the meal choked on a fish bone and died. The person having the party was afraid he would suffer the consequences and instead dragged the body up the stairs to a doctor who lived above him leaned him on the wall knocked on the door and left. The doctor came out the door but because of the darkness saw nothing and tripped on the body and fell down the stairs with the body. The doctor fearing the same outcome took the body to a corner and left it there. Then a tailor had an assistant who walked out to get air saw the body thought it was someone coming to rob them ran inside told the tailor who then threw the hot iron out at the head of the comedian and he too believed he had killed and he too put him at the side. At that moment a drunk walked by with bottle in hand and tripped over the corpse’s foot. The drunk got angry and he looked at the corpse saw him smile and said and you think it’s funny and broke the bottle and slashed his throat. Then finally a Police officer passed and arrested the drunk. He was sentenced to a death Penalty but now everyone knew who it was and their consciences acted up and they all admitted to the same crime, the judge was at a loss as to what to do so he went to the Ben Ish Chai. The Ben Ish Chai answered it is truly simple the person was not killed he choked, no one is guilty. This man mocked Chazal and got all the Deaths received in Beis Din. (1)CHENEK-Choked on the fish (2) SKILAH- As he was thrown down the Stairs (3)SERAIFAH- He was burnt by the hot iron (4) SAYIF-As he was Slashed by the drunk’s bottle. A fitting end for one who mocks the words of Chazal.