We should always ask ourselves why we need to do XYZ. If we don’t have a clear answer, it’s not worth the time and effort.
The harsh truth about coding interviews is that questions asked are not directly related to software engineer’s daily work. You will rarely implement a recursion algorithm in a real project and the most commonly used data structure is not tree, stack or queue, it’s just array.
However, the most cost-efficient way to evaluate an engineer is still through coding questions because no company can afford to give every candidate a one-month internship to evaluate his/her skills.
What it means is that unless a better form of interview is invented, coding questions are still the primary form of “exams”. To survive in this game, you have to get used to that type of questions that you may never encounter in real projects.
The point is not expecting the same question to be asked again (though this is possible), but getting familiar with this type of questions and they can also be helpful to your work potentially.