Car stalls while driving and wont start for 20-30 minutes

My first guess is vapor lock. My friend just had a engine swapped out his beat 2.7 engine & a 3.5 replace it. I think its a 2000 or 2002 Dodge Intrepid. Any other ideas as to what might cause this

There’s a lot of electronics that have to be changed when you install a different engine. If your friend didn’t do that it could be ANYTHING.

When the engine won’t start, does it have spark? is it getting fuel? Is the check engine light on?

it was done by “professionals” They supposedly swapped everything. As far as spark, i wasnt with him & I know he didnt know or check. my guess is it is getting spark because the 2 times it happened it just died. He tried to start it several times and finally after about 20-30 minutes of sitting it started right up

Suddenly dieing is a symptom of suddenly loosing spark, or electrical power to ignition. If it wasn’t so sudden, it could be a fuel (supply, or injection) problem.

My guess would be it’s flooding.