In this document I will explain some design decisions and other things that I think need to be discussed. First of all, this code challenge has been very interesting. The first part of Node has been more algorithmic, while the second has been somewhat more visual. Next I will explain the projects separately, giving some examples and showing screenshots.
(https://github.com/JRamonMC/robotsonmars)
In this project, NodeJS had to be used as an essential requirement. I chose Express because of the facilities it presented and because it also had a simple integration with MongoDB through Mongoose.
The architecture of the application is simple, I have not chosen to do pure MVC because I think that the important thing is how the robot moves along the surface and how these movements are registered.
To "see" this movement, I have chosen EJS, since it allows to embed javascript code in HTML. I've added Bootstrap to make it have a more interesting look and feel.
The first of all has been to design the algorithm on paper (my favorite part). My first thought was that this problem could be solved recursively. I didn't see the point of using other algorithms like divide and conquer, since the chain was being processed little by little. For that I have created both a sequential and a recursive solution.
However, when measuring the times (they are commented in the code), it does not change much between one implementation and another.
The problem has two predefined directions in which you can quickly query the scenarios, returning simple text. These are : /robots/exampleRecursive and /robots/exampleNoRecursive.
Once you have seen those api addresses, you can proceed by introducing the cases one by one through the interface. These cases persist and can be viewed on the main screen. One of the problems was that he couldn't find a way to meaningfully include the last address the robot had processed before getting lost. It was a silly mistake, for the robot to get lost it always has to move forward.

