Question: We are told that when people die, their body stays in their grave and their soul goes to barzakh where they wait for the day of judgement. After that people enter either Jannah or Jahannam. However during Isra' wal Miraj, the Prophet (saw) traveled to Jannah and Jahannam. I understand that the Prophets are in Jannah already as there may be an exception for them. However Muhammad (saw) also saw people suffering in Jahannam too. 

So my question is how or why were there people already in Jahannam when the soul waits in Barzakh after death?

Answer: 
I don't know what our Prophet saw, so I can't comment about that but if you read Quran, you will see that in many verses, Allah describes the judgment day, heaven and hell as if they already happened. Please check **Quran** verses **6:27, 6:30, 6:128, 7:44, 18:99, 21:100, 22:22, 23:102-108** and many others.

**My understanding** is that it already happened from Allah's perspective, but not from our (humans and other creation in this universe) perspective. **My understanding** is that it all already happened and recorded (e.g. video recordings, server logs, book registries, in a way we can't fully understand) by Allah and that information is available to Allah any time. Please check Quran verses **6:59, 10:61, 36:12, 57,22**. Surely Allah can show it to anyone, if Allah wishes. However, we (both living and the dead) are still proceeding in time towards the judgment day and heaven and hell. **My understanding** is that, from our perspective nobody is in the heaven or hell yet, as the judgment did not took place yet. Please check Quran verses **36:52, 23:112-23:113**.

A director of the movie knows what will happen at the end of the movie but a viewer has to go through the movie and reach its end to know it.
Right. Before Judgement Day, no one is in Paradise getting the full taste of Paradise as it will be experienced, or the full taste/experience of Hell.. including those who are exceptions, as you mentioned. -- The scholars say that when the Prophet (ﷺ) "saw" the people in Paradise and the People in Hellfire, it was something shown to him via vision/knowledge from Allah (ﷻ).. of what is to come (and wasn't something that was happening currently when he saw it). The Prophet (ﷺ) then conveyed that to us. Just another way to show us the realities of the two places and what can be expected. SubhanAllah.