Question: In which scenario would a stack be preferred over a queue?
Options:
Correct Answer: When processing tasks in a last-in, first-out manner
Solution:
A stack is preferred when tasks need to be processed in a last-in, first-out (LIFO) manner, such as in backtracking algorithms.