Let the velocities of car 1 and car 2 be V1 m/s and V2 m/s.
∴ Apparent frequencies of sound emitted by car 1 and car 2 as detected at end point are f1=f0VV−V1,f2=f0VV−V2
⇒330=300330330−V1,360=300330330−V2
⇒V1=30 m/s and V2=55 m/s.
The distance between both the cars just when the 2nd car reach end point.
100 m=V2t−V1t⇒t=4 sec.