Based on the information John can do 1/5 of the task per hour
Steve can do 1/4 of the task per hour
So, in 2 hours working together
John & Steve can do 2( 1/5 + 1/4 ) = 9/10 of the task
Since John is left to finish, Let x = the time it takes him to finish
Then,
1/5 task/hour = 1/10 task/x hours Solving for x
x = 1/2 hour
So John takes another 30 minutes after Steve leaves!