{"id":116,"date":"2022-04-17T09:18:33","date_gmt":"2022-04-17T09:18:33","guid":{"rendered":"https:\/\/algocademy.com\/blog\/?p=116"},"modified":"2024-10-12T13:15:53","modified_gmt":"2024-10-12T13:15:53","slug":"the-eureka-of-coding","status":"publish","type":"post","link":"https:\/\/algocademy.com\/blog\/the-eureka-of-coding\/","title":{"rendered":"The &#8220;Eureka!&#8221; of Coding"},"content":{"rendered":"\n<p>When the Ancient Greek scholar, Archimedes, once stepped into his bath, he was amazed to see the level of the water rise.<\/p>\n\n\n\n<p>It\u2019s a phenomenon that we don\u2019t even notice today, but back then it was a revelation. Archimedes realised that the displacement of water was equal to the volume of his submerged body.<\/p>\n\n\n\n<p>Legend has it that upon discovering the water displacement, Archimedes jumped out of the bath and cried, \u201cEureka!\u201d.<\/p>\n\n\n\n<p>\u201cEureka!\u201d can be roughly translated as \u201cI found it!\u201d. Archimedes had found the solution to something which had troubled him for a while.<\/p>\n\n\n\n<p>Arguably, this could be one of the first, and most notable, examples of an Aha! moment.<\/p>\n\n\n\n<p>I still remember clearly my first two Aha! moments regarding coding, algorithms and problem solving.<\/p>\n\n\n\n<p>They were both related to being able to solve a problem on my own, without any external help. No google searches, no video explanations, nothing.<\/p>\n\n\n\n<p>Just me and myself:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>thinking about the problem<\/li><li>writing down one or two examples<\/li><li>understanding how the answer is deducted and why it works that way<\/li><li>laying down on paper the steps that are needed to solve the problem<\/li><li>coding up the solution<\/li><li>fixing the compile \/ syntax errors<\/li><li>running the code with the input example<\/li><li>Seeing that it gives a wrong answer<\/li><li>Using print statements to debug<\/li><li>Fixing the error<\/li><li>Trying on different inputs and seeing that it works<\/li><li>Submitting to the online judge and getting accepted<\/li><\/ul>\n\n\n\n<p>The first time I had an Aha! moment was when I was able to solve a simple problem on my own.<\/p>\n\n\n\n<p>The second time is when I solved my first hard problem on my own (yes, it was a Dynamic Programming one).<\/p>\n\n\n\n<p>This involved a few more steps like generating large input tests to make sure my program was fast enough and works well on big inputs.<\/p>\n\n\n\n<p>Why is this important you might ask?<\/p>\n\n\n\n<p>When you know that you can solve problems without any help, you KNOW that during a Coding Interview you will be able to solve anything they throw at you. <\/p>\n\n\n\n<p>They might give you a problem with a twist. If you only know the classical problem by heart, you might not be able to solve it.<\/p>\n\n\n\n<p>Or they might just surprise you with a problem you&#8217;ve never heard before. <\/p>\n\n\n\n<p>Those Aha! moments give you the confidence you need to pass those Coding Interviews with flying colors.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>When the Ancient Greek scholar, Archimedes, once stepped into his bath, he was amazed to see the level of the&#8230;<\/p>\n","protected":false},"author":1,"featured_media":117,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[23],"tags":[],"class_list":["post-116","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-problem-solving"],"_links":{"self":[{"href":"https:\/\/algocademy.com\/blog\/wp-json\/wp\/v2\/posts\/116"}],"collection":[{"href":"https:\/\/algocademy.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/algocademy.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/algocademy.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/algocademy.com\/blog\/wp-json\/wp\/v2\/comments?post=116"}],"version-history":[{"count":3,"href":"https:\/\/algocademy.com\/blog\/wp-json\/wp\/v2\/posts\/116\/revisions"}],"predecessor-version":[{"id":120,"href":"https:\/\/algocademy.com\/blog\/wp-json\/wp\/v2\/posts\/116\/revisions\/120"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/algocademy.com\/blog\/wp-json\/wp\/v2\/media\/117"}],"wp:attachment":[{"href":"https:\/\/algocademy.com\/blog\/wp-json\/wp\/v2\/media?parent=116"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/algocademy.com\/blog\/wp-json\/wp\/v2\/categories?post=116"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/algocademy.com\/blog\/wp-json\/wp\/v2\/tags?post=116"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}