Design A New Traffic Light System


Design a New Traffic Light System

If you are asked to design a new traffic light system, what would be your key design requirements?


Rationale: First of all, the key point to establish when being confronted with open ended questions like this one is to think about all the possible scenarios where you would normally be asked to design and implement such a system. You will have to ask further questions in order to clarify your role. If the interview is not face to face you are obviously unable to ask for further clarifications so you will need to make your own assumptions. When talking about traffic lights in general their main purpose is to draw attention on something or signal the occurrence of some event. Here are some examples where such a mechanism would be required.


  • Road traffic
  • Airport traffic
  • Rockets
  • Maritime signaling


Traffic lights tend to differ when it comes to the number and variety of colors. For example, pedestrian traffic lights only have red and green signaling stop and go, whereas vehicle traffic adds the color yellow to emphasize the transition between stop and go, forcing the driver to take measures in advance. Other examples would be Formula 1 traffic lights, indicating the countdown to the start of the race or a sports stadium lighting system meant to direct fans to the exit gates after the match has ended.


In our model answer given below we will assume that we are asked to design a traffic lights model meant to fluidize the traffic in a busy intersection. We will need to take into account two design categories.

Firstly, let’s consider the principal design requirements:


  • Fuel consumption minimization – Reducing the waiting time for traffic participants automatically reduces fuel consumption as well, mainly because an idling engine consumes plenty of fuel and also emits pollutants in the air, so this step would automatically come with benefits for the environment as well.
  • The sequence of signals – The sequence of signals is actually a more complex process then most people think. For example, in addition to ensuring the right order of colors (red – amber/ yellow – green), a good system should also consider the time the yellow light stays active, for example. This needs to be computed according to the size of the intersection and the average speed of traffic participants. Cars and pedestrians should have enough time to finish crossing the intersection before the ‘red’ light appears.
  • The type of controller
    • The controller of a traffic light system can be pre-timed (allow a number of seconds for each light), or can be adjusted according to the needs of the traffic participants. For example, we have all seen the pedestrian traffic lights triggered by the push of a button. In this case the controller needs to dynamically adjust the time period during which a light is active.
    • This idea can be brought even further, to traffic controllers that work with sensors, for example, and adjust the time allowed for each light based on how busy an intersection is. There are various types of sensors that can be used. Using movement sensors would perhaps be complicated and risky because of the potentially high error rate, but the detectors placed in the pavement turn out to work quite well. These can measure the frequency of vehicles / pedestrian for each direction of the intersection and therefore tell the controller to adjust the time each light is active.



Optionally, the design of a traffic light system could also include exchanging information between traffic lights at different intersections. It is often unpleasant for participants in traffic to stop at all consecutive lights, so it would be ideal to achieve some synchronization between these.

Secondly, the other category to mention is the functional requirements. By these, we are referring to the actual purpose of the system – to direct traffic. Some of these requirements are as follows:

  • In the case of road traffic lights, apart from the sequence of colors should ideally display the direction which is made available or unavailable to the drivers. This is marked by an arrow of the corresponding color. For example, if you see a green arrow pointing to the right it means you are free to go right.
  • When it comes to pedestrian crossings in the intersection, the arrows would be replaced by a green walking man if allowed to proceed or a red stationary man if required to stand.
  • In case of a timed controller, an idea would be to also include a countdown timer accompanied by the red or green color, symbolizing the time left to wait in the intersection or proceed.


Again, you need to remember that this is an open ended question which can be approached in various ways. The idea is to keep asking questions until you find out what kind of scenario the interviewer had in mind. A sensible idea would be not to omit aspects such as non-functional requirements. For example, how would you rate the performance of your system? Or under what parameters would you ideally test it? For the sports stadium example, stress testing would be a point worth mentioning. You would want to fill the stadium up with the maximum number of people allowed in order to assess the performance of the traffic lights.



Previous articleWhen A User Types A Character On A Keyboard
Next articleType A URL Into The Address Bar
Since last 15 years in different geographical locations, Sumit prepared hiring format for several hiring managers/teams to hire the balanced talents and interviewed talents on the various stages of their selection process. He also interviewed by hundreds of companies in different geographical locations.His best conclusion for hiring teams and candidate is to prepare in advance. Here ‘advance’ means keep your interview book ready and continue to update it even you are not going to interview candidates or applying for any job in next six months.