Praise be to Allah.
The scholars differed as to whether the questioning in the grave is only for this ummah, or is for both them and other nations. There are several views:
The first view:
is that the questioning is only for this ummah, because the nations who came before us had messengers who came to them, and when they refused to believe, the Messengers stopped calling them and left them alone, and the punishment was hastened for them.
But when the Prophet of mercy (blessings and peace of Allah be upon him) was sent, who was compassionate towards his ummah, of whom Allah said (interpretation of the meaning): “And We have sent you (O Muhammad (blessings and peace of Allah be upon him)) not but as a mercy for the Alameen (mankind, jinns and all that exists)” [al-Anbiya’ 21:107], and his ummah included both true believers and hypocrites, Allah refrained from punishing them because of how they outwardly appeared to be, and questioning for them after death was ordained, so as to distinguish the evil from the good.
Allah, may He be exalted, says (interpretation of the meaning):
“Allah will keep firm those who believe, with the word that stands firm in this world (i.e. they will keep on worshipping Allah Alone and none else), and in the Hereafter. And Allah will cause to go astray those who are Zalimoon (polytheists and wrong-doers, etc.), and Allah does what He wills”
Among those who thought this view more likely to be correct was al-Hakeem at-Tirmidhi, the author of Nawaadir al-Usool (4/160)
The second view:
We should refrain from giving any definitive view concerning this matter. This was the view favoured by Ibn ‘Abd al-Barr (may Allah have mercy on him), as it says in at-Tamheed (22/253).
The third view:
An-Nawawi (may Allah have mercy on him) said: Our companions (i.e., the Shaafa‘is) said:
The questioning of the two angels and the torment of the grave cannot be ruled out because of the body of the deceased being scattered, as we usually see, or by his being eaten by wild animals or fish in the sea, and the like. Just as Allah, may He be exalted, will bring him back to life for the resurrection, and He, may He be glorified and exalted, is able to do that, in like manner He is able to bring part of him back to life, or several parts, even if he has been eaten by wild animals or fish.
End quote from Sharh Saheeh Muslim (17/201)
As-Suyooti (may Allah have mercy on him) said in his poem Abyaat at-Tathbeet (83):
The unburied person and the crucified person are questioned, although the living are not able to see that.
The commentator on the poem said:
The questioning is something that will happen to everyone who dies, no matter how he died, whether it was by knocked to the ground or by drowning or by being thrown into the fire, or being eaten by wild animals or birds, because of the general meaning of the evidence that speaks of this questioning… end quote.
Shaykh Ibn Baaz (may Allah have mercy on him) said:
The grave is either one of the gardens of Paradise or one of the ditches of Hell, and punishment or bliss happen to both the soul and body in the grave… and also in the hereafter. The delights of Paradise affect both the soul and the body, and the torments of Hell affect both the soul and the body.
If a person dies by drowning or by burning, or by being devoured by wild animals, the soul experiences its share of torment or bliss, and the one whose body is in the sea or was burned or is in the bellies of wild animals will also have its share of that, in a manner that is known to Allah, may He be glorified and exalted.
End quote from Fataawa Noor ‘ala ad-Darb (4/304)
Shaykh Ibn ‘Uthaymeen (may Allah have mercy on him) said:
Is this – namely the trial of the grave – something that is only for the one who is buried in a grave, because of the words “When the deceased is buried”, or does it apply to everyone who dies?
Answer: this is not only for the one who is buried in a grave; rather it includes everyone who dies. The words of the Prophet (blessings and peace of Allah be upon him), “When the deceased is buried…” are based on what is usually the case.
Based on that, if a person is knocked to the ground [and remains unburied] or thrown into the sea and dies there, then the two angels will come to him and test him.
End quote from Sharh al-‘Aqeedah as-Safaareeniyyah (1/433)
So whether the deceased is buried in the proper manner or not, the two angels will come to him and will test him in his grave, and they will ask him in a manner that is known to Allah, may He be exalted.
And Allah knows best.