The hardware exists in a hostile climate, so it sometimes experiences system failures. An external monitoring system is already in place that can check the the hardware and attempt to restart both it and your program in the event of a failure, but on restart it is important for your program to determine what state it was in just prior to the failure.
The system resources do not allow for the use of a database or network connection (periodically a technician comes to check the system and transfer any recorded data).
Your role on the team is (i) to design and implement the routine(s) to log the time and content of the sensor messages received and the instructions dispatched to the devices, and (ii) to design and implement the routine(s) used during a restart to identify the what messages had been processed and what instructions had been dispatched - thus enabling the program to identify its last known state prior to the failure.
Your task for this exam question is to provide preliminary design ideas for problems (i) and (ii), and to note any problems/difficulties you see with your suggestion.