1.

Can an infinite loop be dangerous to embedded systems due to memory leak?(a) Yes(b) Yes, but only if it is used within a limited scope(c) No(d) Yes, but only for some Arduino BoardsThe question was asked during an interview for a job.This is a very interesting question from Looping topic in portion Arduino Programming of Arduino

Answer»

Correct answer is (a) Yes

The explanation: Infinite loops are a good way to ensure that your PROGRAM is running continuously WITHOUT any interruptions. However in programming languages that allow raw memory MANAGEMENT, it’s very easy to have a memory leak, or a continuous allocation of memory which eventually leads to the programming using all the memory AVAILABLE and eventually crashing the ENTIRE system.



Discussion

No Comment Found

Related InterviewSolutions