I was recently in a job interview in which my interviewer told me that he doesn't believe that university degrees teach many useful things to students. His main point was that they don't do a proper job teaching them to think, and that he has found that even graduate students cannot properly answer problems which he gives them.
I was curious, so I asked him whether he could give me an example of a problem which graduate students can't answer properly. This was the problem:
Given a request, A, with a starting and a finishing time, decide whether it is compatible with another request, B, with a starting and finishing time (two requests are not compatible if their timespans overlap).
My answer was that one can check whether the starting time for request A is after the starting time of request B but before the finishing time of request B, and vice versa for the ending time of request A.
However, he said that my answer was completely wrong. His reason for this was that I jumped straight to solving the problem, instead of proving it beforehand and reasoning about it. When I asked him how he would have answered if he had been asked the problem, his answer was:
The possible cases are that request A may be completely before request B, request A may partially overlap request B on the left, request A may be contained in request B, request B may be contained in request A, request A may partially overlap request B on the right, and request A may be completely after request B.
His explanation for why this is a necessary step of reasoning about a problem was that it allows you to prove that your solution is correct (whereas I, jumping straight to the solution to of the problem, have no way of proving that my solution is correct) and that it is a formal method which allows one to write code which has a lower chance of containing bugs, as you can know that the logic for the code is sound.
From his "proof step" in solving the problem, you can also see quite easily that there is a solution to the problem which requires less computational power than the one I suggested: simply check whether A finishes before B starts or starts after B ends. If this is the case, then they do not overlap.
So my question is whether anyone has any resources or books which they can recommend to me for helping to learn more about how to think about logic before jumping straight to writing the code. I have searched around and haven't yet been able to find anything that great. I'm mostly looking for something practical; i.e. something which only deals with abstract logical proofs and never connects this to how you can use the ideas in your coding would still be something I would be interested in reading, but less so than something which addresses practical application.
Thanks!
TLDR; does anyone have any book or resource recommendations with deal with the idea of how to problem solve and think about logical problems / proofs before actually writing the code.