As someone who was pretty &quot;good&quot; at math and CS algorithms, I&#x27;ll let you in on a little secret: None of this is comes naturally to me. I struggle when encountering new ideas that I&#x27;ve never seen before. I&#x27;ve bombed easy technical interview questions because I couldn&#x27;t make the right logical leap.<p>I still got good grades back in the day because I worked hard. I ground problems until things made sense. Every problem you do adds to your problem solving toolbelt. As your toolbelt grows, you start noticing patterns and you can apply those tools to these new problems. I rarely have to derive things from first principles because I&#x27;ve seen so many different problems at this point.<p>Some people think that I&#x27;m unusually smart or have a natural aptitude for these things. That can&#x27;t be further from the truth - I don&#x27;t think this comes naturally to most people. You just work at it until you get good at it.<p>The best textbook I&#x27;ve found for Algorithms is the one used at Princeton: Sedgewick&#x27;s &quot;Algorithms.&quot; It&#x27;s extremely practical and doesn&#x27;t go into too much of the math&#x2F;proofs behind the algorithms themselves. From there, just grind problems until it makes sense.