AImotive interview question

Code an algorithm that will solve the road intersection problem