On these occasions Jesus was either alone or only there were only two present at the time?
Jesus is tested by Satan alone.
Matthew 4:1-11
Only two present
Jesus prays alone. Matthew 26:38-45
Stay here and keep watch with me.”
39 Going a little farther, he fell with his face to the ground and prayed, “My Father, if it is possible, may this cup be taken from me. Yet not as I will, but as you will.”
40 Then he returned to his disciples and found them sleeping. “Couldn’t you men keep watch with me for one hour?” he asked Peter. 41 “Watch and pray so that you will not fall into temptation. The spirit is willing, but the flesh is weak.”
42 He went away a second time and prayed, “My Father, if it is not possible for this cup to be taken away unless I drink it, may your will be done.”
43 When he came back, he again found them sleeping, because their eyes were heavy. 44 So he left them and went away once more and prayed the third time, saying the same thing.
45 Then he returned to the disciples and said to them, “Are you still sleeping and resting? Look, the hour has come, and the Son of Man is delivered into the hands of sinners.
Jesus speaks with Pilate alone. John 18:33-38
33 Pilate then went back inside the palace, summoned Jesus and asked him, “Are you the king of the Jews?”
34 “Is that your own idea,” Jesus asked, “or did others talk to you about me?”
35 “Am I a Jew?” Pilate replied. “Your own people and chief priests handed you over to me. What is it you have done?”
36 Jesus said, “My kingdom is not of this world. If it were, my servants would fight to prevent my arrest by the Jewish leaders. But now my kingdom is from another place.”
37 “You are a king, then!” said Pilate.
Jesus answered, “You say that I am a king. In fact, the reason I was born and came into the world is to testify to the truth. Everyone on the side of truth listens to me.”
38 “What is truth?” retorted Pilate.
Indeed Mr Pilate, what is truth?
But how did these gospel writers know the words spoken when they were spoken in the absence of anyone else.?