Skip to content

Welcome to the future of smart mobility, where a smart traffic signal can detect the number of vehicles on the junction and can automatically turn green! For coding interviews only!

Notifications You must be signed in to change notification settings

gropyus/TrafficNow24

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TrafficNow24

Welcome to the future of smart mobility, where a smart traffic signal can detect the number of vehicles on the junction and can automatically turn green!

For coding interviews only!

Problem

Some number of cars (< 255) are going to pass through a junction Our job is to add a signal light and control the flow of the traffic

Some conditions:

  • 1 - 5 vehicles arrive randomly in front of the signal, periodically.
  • Signal checks for number of vehicles periodically.
  • If number of vehicles is > 3, the signal turns green for the vehicles. (Start condition)
  • We assume all vehicles pass once the signal is green. So the number of vehicles waiting is 0 in the next period, including the last iteration
  • The simulation should return the number of remaining vehicles

Running

Make sure you have CMake > 3.18

mkdir build && cd build
cmake ../
make all
make test

About

Welcome to the future of smart mobility, where a smart traffic signal can detect the number of vehicles on the junction and can automatically turn green! For coding interviews only!

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published