1. How do the angels get to the grave?
They are sent with the will of Allah subhana wa ta'ala of course.
2. How does a dead person communicate with angels?
With the will of Allah subhana wa ta'ala of course.
3. What were the acceptable answers before Mohammad?
What ever was the dominant faith sent by Allah during that time, I suppose.
The Believers:
Then Allaah says: ‘Record the book of My slave in ‘Illiyoon in the seventh heaven, and return him to the earth, for from it I created them, to it I will return them and from it I will bring them forth once again.’ So his soul is returned to his body and there come to him two angels who make him sit up and they say to him, ‘Who is your Lord?’ He says, ‘Allaah.’ They say, ‘What is your religion?’ He says, ‘My religion is Islam.’ They say, ‘Who is this man who was sent among you?’ He says, ‘He is the Messenger of Allaah (peace and blessings of Allaah be upon him).’ They say, ‘What did you do?’ He says, ‘I read the Book of Allaah and I believed in it.’ Then a voice calls out from heaven, ‘My slave has spoken the truth, so prepare for him a bed from Paradise and clothe him from Paradise, and open for him a gate to Paradise.’
The NonBelievers
.....He (The prophet Muhammed sallahu 'alahy wa salaam) said: “Then his soul is returned to his body, and there come to him two angels who make him sit up and they say to him, ‘Who is your Lord?’ He says, ‘Oh, oh, I don’t know.’ They say, ‘What is your religion?’ He says, ‘Oh, oh, I don’t know.’ Then a voice calls out from heaven, ‘Prepare for him a bed from Hell and clothe him from Hell, and open for him a gate to Hell.’ Then there comes to him some of its heat and hot winds, and his grave is constricted and compresses him until his ribs interlock. Then there comes to him a man with an ugly face and ugly clothes, and a foul stench, who says, ‘Receive the bad news, this is the day that you were promised.’ He says, ‘Who are you? Your face is a face which forebodes evil.’ He says, ‘I am your evil deeds.’ He says, ‘O Lord, do not let the Hour come, do not let the Hour come.’”
Narrated by Abu Dawood, 4753; Ahmad, 18063 – this version was narrated by him. Classed as saheeh by al-Albaani in Saheeh al-Jaami’, 1676.
This isn't the entire hadith, the full version is quite longer, but the answers of the questioned are supposed to reflect tawheed (monotheism) and 'aqeedah (belief). Since all the prophets (peace be upon them) carried the same message, then the questioner should be able to answer accordingly.
However, in the grave, the pure souls have already been named pure, before they are questioned, and the bad souls have already been named impure before they are questioned (according to the hadith). Therefore the questions are appropriate for each group.
peace