{"id":1219,"date":"2011-01-08T15:46:43","date_gmt":"2011-01-08T22:46:43","guid":{"rendered":"https:\/\/simpleprogrammer.com\/2011\/01\/08\/solving-problems-breaking-it-down\/"},"modified":"2018-01-10T17:48:46","modified_gmt":"2018-01-10T22:48:46","slug":"solving-problems-breaking-it-down","status":"publish","type":"post","link":"https:\/\/simpleprogrammer.com\/solving-problems-breaking-it-down\/","title":{"rendered":"How to Solve Programming Problems"},"content":{"rendered":"<p>Right before the holidays, I said that <a href=\"https:\/\/simpleprogrammer.com\/2010\/12\/22\/solving-problems-you-better-learn-how\/\">you had better learn how to solve programming problems<\/a>.\\n\\nThis time I am going to try and give you some good tools to enable you to get good at solving programming problems.\u00a0 (Really algorithm type problems specifically.)\\n\\n<\/p>\n<h2>Common mistakes<\/h2>\n<p>\\n\\n<a href=\"https:\/\/simpleprogrammer.com\/wp-content\/uploads\/2011\/01\/lolcatthink.jpg\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; padding-left: 0; padding-right: 0; display: inline; padding-top: 0; border: 0;\" title=\"lolcatthink\" src=\"https:\/\/simpleprogrammer.com\/wp-content\/uploads\/2011\/01\/lolcatthink_thumb.jpg\" alt=\"lolcatthink\" width=\"469\" height=\"439\" border=\"0\" \/><\/a>\\n\\nWhen most programmers are given a programming problem in an interview, they make several key mistakes.\u00a0 The most severe of those is the improper allocation of time.\\n\\nIf you have heard the saying \u201cmeasure twice and cut once,\u201d then you are probably familiar with the idea of spending upfront time to make sure something is done right, rather than diving right in.\\n\\nThe most common mistake I see when conducting interviews or watching someone try to solve a programming problem is they try to start writing code as soon as possible.\\n\\n<strong>You must resist this urge.<\/strong>\\n\\nYou really want to make sure you take enough time to understand the problem completely before attempting to solve it.\\n\\nAnother big mistake is trying to over solve the solution on the first iteration.\u00a0 Keep it simple, don\u2019t try to get fancy.\\n\\n<\/p>\n<h2>A simple set of steps<\/h2>\n<p>\\n\\nI am going to give you a simple set of steps to follow which you can use for any algorithm type programming problem.\\n\\n<\/p>\n<ol>\\n    <\/p>\n<li>Read the problem completely twice.<\/li>\n<p>\\n    <\/p>\n<li>Solve the problem manually with 3 sets of sample data.<\/li>\n<p>\\n    <\/p>\n<li>Optimize the manual steps.<\/li>\n<p>\\n    <\/p>\n<li>Write the manual steps as comments or pseudo-code.<\/li>\n<p>\\n    <\/p>\n<li>Replace the comments or pseudo-code with real code.<\/li>\n<p>\\n    <\/p>\n<li>Optimize the real code.<\/li>\n<p>\\n<\/ol>\n<p>\\n\\n<strong>As much as 70% of our time should be spent in steps 1-3.<\/strong>\\n\\nLet\u2019s look at each step.\\n\\n<\/p>\n<h2>Read the problem completely twice<\/h2>\n<p>\\n\\nThis is the single most important step.\u00a0 You may even want to read the problem 3 or 4 times.\\n\\nYou want to make sure you completely understand the problem.\u00a0 A good test of this is whether or not you can explain the problem to someone else.\\n\\n<strong>I cannot over-emphasize how important this step is!<\/strong>\\n\\nIf you don\u2019t understand the problem, you cannot solve it.\u00a0 Do not worry about wasting time here, because the better you understand the problem, the easier it will be to solve it.\\n\\nIf you are given any examples along with the problem, make sure you have worked through the examples and understand why the answers are correct for each one.\\n\\n<\/p>\n<h2>Solve the problem manually<\/h2>\n<p>\\n\\n<center>\\n\\n<iframe loading=\"lazy\" src=\"https:\/\/www.youtube.com\/embed\/WUIZBnfYxSA\" width=\"560\" height=\"315\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe>\\n\\n<\/center>I am going to tell you perhaps the biggest secret in programming.\\n\\n<\/p>\n<blockquote><p><strong>\u201cNothing can be automated that cannot be done manually!\u201d<\/strong><\/p><\/blockquote>\n<p>\\n\\nProgramming is automation plain and simple.\u00a0 You may have the ability to skip the manual steps and jump directly to code, but there is a manual process which is the foundation of any code you write.\\n\\nIt is very important to solve the problem manually first, so that you know what you are going to automate, otherwise you are just slinging code around.\u00a0 Which while can be fun, will make you look like an idiot in a programming interview and will probably cause you to sweat profusely.\\n\\nI recommend that you solve the problem with at least three different inputs to make sure you really understand your solution and that it will work for more than one case.\\n\\nI often use a <a href=\"http:\/\/en.wikipedia.org\/wiki\/Mathematical_induction\">Mathematical Induction<\/a> approach if possible.\u00a0 Using this approach I might try and solve for 1 first, then for 2, then for n.\\n\\nAlso don\u2019t forget to look for corner cases and edge cases and do any examples for those kind of cases you can think of.\\n\\nIt\u2019s very important that when you solve a problem manually, you recognize what your brain is actually doing to solve the problem.\u00a0 You may need to write out all the things you are normally storing in your head.\u00a0 You want to be aware of each step, it is easy to gloss over them.\\n\\nLet\u2019s look at a very basic example, reversing a string.\\n\\nIf I give you a string \u201cZebra\u201d, and ask you to reverse it, most people will do the following manual steps.\\n\\n<\/p>\n<ul>\\n    <\/p>\n<li>Write \u201cZebra\u201d down.<\/li>\n<p>\\n    <\/p>\n<li>Start a new word, and put \u201ca\u201d as the first letter.\u00a0 (Why \u2013&gt; because it is the last letter, we want to start here)<\/li>\n<p>\\n    <\/p>\n<li>Put \u201cr\u201d down as the 2nd letter.\u00a0 (Why \u2013&gt; because it is the next letter backwards from the last letter we copied)<\/li>\n<p>\\n    <\/p>\n<li>Put \u201cb\u201d down as the 3rd letter.\u00a0 (Why \u2013&gt; same as above)<\/li>\n<p>\\n    <\/p>\n<li>Etc<\/li>\n<p>\\n<\/ul>\n<p>\\n\\nNotice how I write down each little step and why.\\n\\n<\/p>\n<h2>Optimize the manual solution<\/h2>\n<p>\\n\\nPeople often don\u2019t realize how valuable this step is.\u00a0 It is much easier to rearrange and reconstruct and idea or algorithm in your head than it is in code.\\n\\nIt\u2019s well worth the effort to try and optimize the actual solution or simplify it when it is still in the most easily malleable state.\\n\\nWhat you want to do here is figure out if there is another way you can solve the problem easier, or if there are some steps you can cut our or simplify.\\n\\nLet\u2019s look at our string reversal example and see if we can simplify the steps.\\n\\nWe should be able to immediately recognize that we can use a loop here to reduce the manual steps.\u00a0 Our duplicate why\u2019s for most of our steps tell us that we are doing the same thing over and over for each step, just with different data.\\n\\n<\/p>\n<ol>\\n    <\/p>\n<li>Write \u201cZebra\u201d down.<\/li>\n<p>\\n    <\/p>\n<li>Start at the last letter in the word and create a new empty word.<\/li>\n<p>\\n    <\/p>\n<li>Append the current letter to the new word<\/li>\n<p>\\n    <\/p>\n<li>If there is a previous letter, make the previous letter the current letter and start back at 3.<\/li>\n<p>\\n<\/ol>\n<p>\\n\\nLook how close we are getting to code at this point.\u00a0 You should be tempted to actually write the code for this.\u00a0 That is good, it tells you that you have solved and simplified the problem well.\u00a0 Writing code should now become very easy.\\n\\n<\/p>\n<h2>Write pseudo-code or comments<\/h2>\n<p>\\n\\nMany times you can skip this step if you have a really good handle on the problem or your previous steps already created a detailed enough description of the solution that coding it is already a 1 to 1 translation.\\n\\nIf you are a beginner or struggle with these kinds of problems, I would go ahead and take the time to do this step anyway though.\\n\\nWhat we want to do here is capture all the steps we created and now either put them into our editor as comments or write them as psuedo-code that we can translate to real code.\\n\\nBy doing this, we can know exactly what the structure of the code we are going to write is going to look like which makes the job of filling in the actual code later trivial.\\n\\nLet\u2019s look at some psudeo-code for reversing a string.\\n\\n<\/p>\n<blockquote><p>\/\/ NewWord = \u201c\u201d\\n\\n\/\/ Loop backwards through word to reverse\\n\\n\/\/\u00a0\u00a0 NewWord += CurrentLetter\\n\\n\/\/ Return NewWord<\/p><\/blockquote>\n<p>\\n\\nPretty simple, but the key thing we have done here is outlined the structure of the code we will write to solve the problem.\\n\\n<\/p>\n<h2>Replace comments with real code<\/h2>\n<p>\\n\\nThis step should be extremely easy at this point.\u00a0 If you have done all the other steps, this step involves no problem solving at all.\\n\\nAll we do here is take each comment and convert it into a real line of code.\\n\\nTaking the string reversal, we might end up with something like this.\\n\\n<\/p>\n<div id=\"scid:C89E2BDB-ADD3-4f7a-9810-1B7EACF446C1:acf0e9a4-4d47-4ca9-9424-d9c7d7b9badb\" class=\"wlWriterEditableSmartContent\" style=\"display: inline; float: none; margin: 0; padding: 0;\">\\n\\n<script src=\"https:\/\/gist.github.com\/simpleprogrammer-shared\/11030225a4a878b899add0c3ab3ce008.js\"><\/script>\\n\\n<\/div>\n<p>\\n\\n1 for 1 translation of the comments we created above for real code.\\n\\nIf you struggle here, there are usually two possible reasons:\\n\\n<\/p>\n<ol>\\n    <\/p>\n<li>You didn\u2019t break down the problem into small enough steps<\/li>\n<p>\\n    <\/p>\n<li>You don\u2019t know your programming language well enough to do the conversion<\/li>\n<p>\\n<\/ol>\n<p>\\n\\nIf you didn\u2019t break the problem down enough, try going back to the second step and being as meticulous as possible.\u00a0 Write out each and every single step.\u00a0 I know it is a pain, but do it, believe me it will be worth the effort.\\n\\nIf you don\u2019t know your programming language well enough to do the translation, you may need to brush up here on some basic constructs.\u00a0 Any language you expect to be able to solve algorithm type problems in, you should know how to do the following things:\\n\\n<\/p>\n<ul>\\n    <\/p>\n<li>Create a list<\/li>\n<p>\\n    <\/p>\n<li>Sort a list or array<\/li>\n<p>\\n    <\/p>\n<li>Create a map or dictionary<\/li>\n<p>\\n    <\/p>\n<li>Loop through a list, or dictionary<\/li>\n<p>\\n    <\/p>\n<li>Parse strings<\/li>\n<p>\\n    <\/p>\n<li>Convert from string to int, int to string, etc<\/li>\n<p>\\n<\/ul>\n<p>\\n\\n<strong>If you don\u2019t know how to do all of these things.\u00a0 Stop what you are doing now and learn them. <\/strong> It\u2019s not a very long list, and the benefits will be profound.\\n\\n<\/p>\n<h2>Optimize the real code<\/h2>\n<p>\\n\\nSometimes this step isn\u2019t necessary, but it\u2019s worth taking a look at your code and figuring out if you can cut out a few lines or do something simpler.\\n\\nThis is also a good place to make sure all your variables are named with long meaningful names.\u00a0 I cannot stress enough how important having good names for your variables and methods is for helping the person evaluating your code to understand what you were trying to do.\u00a0 This is especially important when you make a mistake!\\n\\nI won\u2019t give an optimization for our trivial example of a string reversal, but a word of advice here is not to get too tricky.\u00a0 Just try to mainly simplify your code and get rid of duplication.\\n\\n<\/p>\n<h2>A few final tips<\/h2>\n<p>\\n\\nIf you follow this template for solving algorithm type problem, you should do very well in programming interviews, but the key to doing so is having confidence in this process.\\n\\nThe only way you are going to have confidence in this process is to practice it.\u00a0 It takes a good amount of faith to believe that spending 70% of your 30 minutes to solve a problem just thinking about the problem and not writing any code is the right approach, so make sure you have that faith when you need it.\\n\\nI\u2019ve talked about using <a href=\"https:\/\/simpleprogrammer.com\/2010\/04\/02\/so-you-want-to-become-a-better-programmer-topcoder\/\">TopCoder<\/a> to become a better programmer before, and I still recommend it.\u00a0 <a href=\"http:\/\/codility.com\/\">Codility.com<\/a> is another great site I have recently been introduced to.\\n\\nThere is one important step I did not include in the outline above, because I didn\u2019t want to make the process any more complicated than it needed to be.\\n\\nMany times you will find that a problem itself involves multiple large steps or is very complicated.\u00a0 In those instances, you will want to try and find a way to cut the problem directly in half and then following the process above for each half.\\n\\nThis method of tackling a problem is called \u201cdivide and conquer&#8221; and is quite effective.\u00a0 A good way to know where to break a problem in half is to think about what part of the problem if already given to you would make solving the rest easy.\\n\\n<em><span data-sheets-value=\"{&quot;1&quot;:2,&quot;2&quot;:&quot;The programming interview is merely one battle in a larger war: marketing yourself. For the full lowdown, take a look at my course: How to Market Yourself as a Software Developer.&quot;}\" data-sheets-userformat=\"{&quot;2&quot;:961,&quot;3&quot;:{&quot;1&quot;:0},&quot;9&quot;:1,&quot;10&quot;:1,&quot;11&quot;:4,&quot;12&quot;:0}\">The programming interview is merely one battle in a larger war: marketing yourself. For the full lowdown, take a look at my course: <a href=\"https:\/\/simpleprogrammer.com\/store\/products\/how-to-market-yourself\/\">How to Market Yourself as a Software Developer<\/a>.<\/span><\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Right before the holidays, I said that you had better learn how to solve programming problems.\\n\\nThis time I am going to try and give you some good tools to enable you to get good at solving programming problems.\u00a0 (Really algorithm type problems specifically.)\\n\\n Common mistakes \\n\\n\\n\\nWhen most programmers are given a programming problem in an&#8230;<\/p>\n","protected":false},"author":2,"featured_media":24394,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"_kad_post_classname":"","footnotes":""},"categories":[3378,14560,1934,264],"tags":[],"class_list":["post-1219","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-algorithms","category-career","category-language","category-learning"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.6 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Solve Programming Problems - Simple Programmer<\/title>\n<meta name=\"description\" content=\"When most programmers are given a programming problem in an interview, they make several key mistakes. In this post I&#039;m going to outline several steps that will help you improve your problem solving skills - specifically algorithm type problems.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/simpleprogrammer.com\/solving-problems-breaking-it-down\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Solve Programming Problems - Simple Programmer\" \/>\n<meta property=\"og:description\" content=\"When most programmers are given a programming problem in an interview, they make several key mistakes. In this post I&#039;m going to outline several steps that will help you improve your problem solving skills - specifically algorithm type problems.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/simpleprogrammer.com\/solving-problems-breaking-it-down\/\" \/>\n<meta property=\"og:site_name\" content=\"Simple Programmer\" \/>\n<meta property=\"article:published_time\" content=\"2011-01-08T22:46:43+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2018-01-10T22:48:46+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/simpleprogrammer.com\/wp-content\/uploads\/2011\/01\/Solving-Problems-Breaking-it-Down.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1280\" \/>\n\t<meta property=\"og:image:height\" content=\"720\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"John Sonmez\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"John Sonmez\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"10 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/simpleprogrammer.com\\\/solving-problems-breaking-it-down\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/simpleprogrammer.com\\\/solving-problems-breaking-it-down\\\/\"},\"author\":{\"name\":\"John Sonmez\",\"@id\":\"https:\\\/\\\/simpleprogrammer.com\\\/#\\\/schema\\\/person\\\/1abc70edfb189184827740310672de67\"},\"headline\":\"How to Solve Programming Problems\",\"datePublished\":\"2011-01-08T22:46:43+00:00\",\"dateModified\":\"2018-01-10T22:48:46+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/simpleprogrammer.com\\\/solving-problems-breaking-it-down\\\/\"},\"wordCount\":1958,\"commentCount\":23,\"image\":{\"@id\":\"https:\\\/\\\/simpleprogrammer.com\\\/solving-problems-breaking-it-down\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/simpleprogrammer.com\\\/wp-content\\\/uploads\\\/2011\\\/01\\\/Solving-Problems-Breaking-it-Down.png\",\"articleSection\":[\"Algorithms\",\"Career\",\"Language\",\"Learning\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/simpleprogrammer.com\\\/solving-problems-breaking-it-down\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/simpleprogrammer.com\\\/solving-problems-breaking-it-down\\\/\",\"url\":\"https:\\\/\\\/simpleprogrammer.com\\\/solving-problems-breaking-it-down\\\/\",\"name\":\"How to Solve Programming Problems - Simple Programmer\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/simpleprogrammer.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/simpleprogrammer.com\\\/solving-problems-breaking-it-down\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/simpleprogrammer.com\\\/solving-problems-breaking-it-down\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/simpleprogrammer.com\\\/wp-content\\\/uploads\\\/2011\\\/01\\\/Solving-Problems-Breaking-it-Down.png\",\"datePublished\":\"2011-01-08T22:46:43+00:00\",\"dateModified\":\"2018-01-10T22:48:46+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/simpleprogrammer.com\\\/#\\\/schema\\\/person\\\/1abc70edfb189184827740310672de67\"},\"description\":\"When most programmers are given a programming problem in an interview, they make several key mistakes. In this post I'm going to outline several steps that will help you improve your problem solving skills - specifically algorithm type problems.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/simpleprogrammer.com\\\/solving-problems-breaking-it-down\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/simpleprogrammer.com\\\/solving-problems-breaking-it-down\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/simpleprogrammer.com\\\/solving-problems-breaking-it-down\\\/#primaryimage\",\"url\":\"https:\\\/\\\/simpleprogrammer.com\\\/wp-content\\\/uploads\\\/2011\\\/01\\\/Solving-Problems-Breaking-it-Down.png\",\"contentUrl\":\"https:\\\/\\\/simpleprogrammer.com\\\/wp-content\\\/uploads\\\/2011\\\/01\\\/Solving-Problems-Breaking-it-Down.png\",\"width\":1280,\"height\":720},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/simpleprogrammer.com\\\/solving-problems-breaking-it-down\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/simpleprogrammer.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Solve Programming Problems\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/simpleprogrammer.com\\\/#website\",\"url\":\"https:\\\/\\\/simpleprogrammer.com\\\/\",\"name\":\"Simple Programmer\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/simpleprogrammer.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/simpleprogrammer.com\\\/#\\\/schema\\\/person\\\/1abc70edfb189184827740310672de67\",\"name\":\"John Sonmez\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/dc2f18dfa76e017566ce607de002d7abe4acfd5ec19a6db82c180b00867b8d94?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/dc2f18dfa76e017566ce607de002d7abe4acfd5ec19a6db82c180b00867b8d94?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/dc2f18dfa76e017566ce607de002d7abe4acfd5ec19a6db82c180b00867b8d94?s=96&d=mm&r=g\",\"caption\":\"John Sonmez\"},\"url\":\"https:\\\/\\\/simpleprogrammer.com\\\/author\\\/jsonmez\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Solve Programming Problems - Simple Programmer","description":"When most programmers are given a programming problem in an interview, they make several key mistakes. In this post I'm going to outline several steps that will help you improve your problem solving skills - specifically algorithm type problems.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/simpleprogrammer.com\/solving-problems-breaking-it-down\/","og_locale":"en_US","og_type":"article","og_title":"How to Solve Programming Problems - Simple Programmer","og_description":"When most programmers are given a programming problem in an interview, they make several key mistakes. In this post I'm going to outline several steps that will help you improve your problem solving skills - specifically algorithm type problems.","og_url":"https:\/\/simpleprogrammer.com\/solving-problems-breaking-it-down\/","og_site_name":"Simple Programmer","article_published_time":"2011-01-08T22:46:43+00:00","article_modified_time":"2018-01-10T22:48:46+00:00","og_image":[{"width":1280,"height":720,"url":"https:\/\/simpleprogrammer.com\/wp-content\/uploads\/2011\/01\/Solving-Problems-Breaking-it-Down.png","type":"image\/png"}],"author":"John Sonmez","twitter_card":"summary_large_image","twitter_misc":{"Written by":"John Sonmez","Est. reading time":"10 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/simpleprogrammer.com\/solving-problems-breaking-it-down\/#article","isPartOf":{"@id":"https:\/\/simpleprogrammer.com\/solving-problems-breaking-it-down\/"},"author":{"name":"John Sonmez","@id":"https:\/\/simpleprogrammer.com\/#\/schema\/person\/1abc70edfb189184827740310672de67"},"headline":"How to Solve Programming Problems","datePublished":"2011-01-08T22:46:43+00:00","dateModified":"2018-01-10T22:48:46+00:00","mainEntityOfPage":{"@id":"https:\/\/simpleprogrammer.com\/solving-problems-breaking-it-down\/"},"wordCount":1958,"commentCount":23,"image":{"@id":"https:\/\/simpleprogrammer.com\/solving-problems-breaking-it-down\/#primaryimage"},"thumbnailUrl":"https:\/\/simpleprogrammer.com\/wp-content\/uploads\/2011\/01\/Solving-Problems-Breaking-it-Down.png","articleSection":["Algorithms","Career","Language","Learning"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/simpleprogrammer.com\/solving-problems-breaking-it-down\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/simpleprogrammer.com\/solving-problems-breaking-it-down\/","url":"https:\/\/simpleprogrammer.com\/solving-problems-breaking-it-down\/","name":"How to Solve Programming Problems - Simple Programmer","isPartOf":{"@id":"https:\/\/simpleprogrammer.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/simpleprogrammer.com\/solving-problems-breaking-it-down\/#primaryimage"},"image":{"@id":"https:\/\/simpleprogrammer.com\/solving-problems-breaking-it-down\/#primaryimage"},"thumbnailUrl":"https:\/\/simpleprogrammer.com\/wp-content\/uploads\/2011\/01\/Solving-Problems-Breaking-it-Down.png","datePublished":"2011-01-08T22:46:43+00:00","dateModified":"2018-01-10T22:48:46+00:00","author":{"@id":"https:\/\/simpleprogrammer.com\/#\/schema\/person\/1abc70edfb189184827740310672de67"},"description":"When most programmers are given a programming problem in an interview, they make several key mistakes. In this post I'm going to outline several steps that will help you improve your problem solving skills - specifically algorithm type problems.","breadcrumb":{"@id":"https:\/\/simpleprogrammer.com\/solving-problems-breaking-it-down\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/simpleprogrammer.com\/solving-problems-breaking-it-down\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/simpleprogrammer.com\/solving-problems-breaking-it-down\/#primaryimage","url":"https:\/\/simpleprogrammer.com\/wp-content\/uploads\/2011\/01\/Solving-Problems-Breaking-it-Down.png","contentUrl":"https:\/\/simpleprogrammer.com\/wp-content\/uploads\/2011\/01\/Solving-Problems-Breaking-it-Down.png","width":1280,"height":720},{"@type":"BreadcrumbList","@id":"https:\/\/simpleprogrammer.com\/solving-problems-breaking-it-down\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/simpleprogrammer.com\/"},{"@type":"ListItem","position":2,"name":"How to Solve Programming Problems"}]},{"@type":"WebSite","@id":"https:\/\/simpleprogrammer.com\/#website","url":"https:\/\/simpleprogrammer.com\/","name":"Simple Programmer","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/simpleprogrammer.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/simpleprogrammer.com\/#\/schema\/person\/1abc70edfb189184827740310672de67","name":"John Sonmez","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/dc2f18dfa76e017566ce607de002d7abe4acfd5ec19a6db82c180b00867b8d94?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/dc2f18dfa76e017566ce607de002d7abe4acfd5ec19a6db82c180b00867b8d94?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/dc2f18dfa76e017566ce607de002d7abe4acfd5ec19a6db82c180b00867b8d94?s=96&d=mm&r=g","caption":"John Sonmez"},"url":"https:\/\/simpleprogrammer.com\/author\/jsonmez\/"}]}},"_links":{"self":[{"href":"https:\/\/simpleprogrammer.com\/wp-json\/wp\/v2\/posts\/1219","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/simpleprogrammer.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/simpleprogrammer.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/simpleprogrammer.com\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/simpleprogrammer.com\/wp-json\/wp\/v2\/comments?post=1219"}],"version-history":[{"count":0,"href":"https:\/\/simpleprogrammer.com\/wp-json\/wp\/v2\/posts\/1219\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/simpleprogrammer.com\/wp-json\/wp\/v2\/media\/24394"}],"wp:attachment":[{"href":"https:\/\/simpleprogrammer.com\/wp-json\/wp\/v2\/media?parent=1219"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/simpleprogrammer.com\/wp-json\/wp\/v2\/categories?post=1219"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/simpleprogrammer.com\/wp-json\/wp\/v2\/tags?post=1219"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}