{"id":9,"date":"2023-01-13T04:25:04","date_gmt":"2023-01-13T04:25:04","guid":{"rendered":"https:\/\/blogs.oregonstate.edu\/easterdr\/?p=9"},"modified":"2023-01-19T21:41:10","modified_gmt":"2023-01-19T21:41:10","slug":"my-leetcode-method","status":"publish","type":"post","link":"https:\/\/blogs.oregonstate.edu\/easterdr\/2023\/01\/13\/my-leetcode-method\/","title":{"rendered":"My LeetCode Method"},"content":{"rendered":"\n<p>I am currently going through the job hunting process. This includes applying to new grad positions, emailing recruiters, attending career fairs, and *of course* doing LeetCode problems. If you haven&#8217;t applied to jobs yet, you&#8217;ll soon find out that you&#8217;ll receive an online assessment (OA) as the first step in the interview process. I&#8217;ve received and done about 12 different OAs on various sites such as Codility, CodeSignal, and Hackkerrank. Each company can customize their OAs, so you&#8217;ll experience a broad range of difficulties and questions. Later in the interview process, you&#8217;ll be asked similar questions in the technical interview. From my experience, I&#8217;ve noticed that startups tend to require you to complete an at-home assignment while most mid-sized to large-sized companies tend to ask LeetCode-style questions in their interviews, so it&#8217;s best to practice them. <\/p>\n\n\n\n<p class=\"has-medium-font-size\"><em><strong>Here&#8217;s what<\/strong><\/em> <strong><em>to expect<\/em><\/strong><\/p>\n\n\n\n<p>There are several scenarios where you&#8217;ll be asked to complete a technical problem.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Over the phone, where you&#8217;re expected to write code on a shared document<\/li>\n\n\n\n<li>Online assessment <\/li>\n\n\n\n<li>Technical Interview (whiteboard)<\/li>\n<\/ul>\n\n\n\n<p><strong><em>The general approach<\/em><\/strong><\/p>\n\n\n\n<p>The approach I take when tackling a technical question is <strong>UMPIRE<\/strong>.<\/p>\n\n\n\n<p>U: Understand the problem<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Validate your assumptions by thinking of different inputs and outputs.<\/li>\n\n\n\n<li>Ask the interviewer questions about the problem<\/li>\n<\/ul>\n\n\n\n<p>M: Match the problem with the interviewer<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Try to think about known categories of problems (Linked List, Dynamic Programming) or patterns that match the problem. <\/li>\n<\/ul>\n\n\n\n<p>P: Plan your approach and solution<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Use visualizations and pseudocode to plan your approach.<\/li>\n<\/ul>\n\n\n\n<p>I: Implement your solution<\/p>\n\n\n\n<p>R: Review your solution<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Go through your code as if you&#8217;re debugging it and there&#8217;s a bug. Step through the code line by line.<\/li>\n\n\n\n<li>Evaluate some of the common edge cases.<\/li>\n<\/ul>\n\n\n\n<p>E: Evaluate your solution<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Discuss the pros and cons of your algorithm, what you like about your algorithm, and what you could do differently.<\/li>\n\n\n\n<li>This is where you also discuss the Big-O time complexity of your algorithm.<\/li>\n<\/ul>\n\n\n\n<p>One more comment: when solving a technical problem, a good strategy is to come up with the native solution first and then optimize your code later on. <\/p>\n\n\n\n<p>Remember, the interviewer wants to see your approach and thought process, so don&#8217;t forget to talk out loud, use visualizations, and break down the problem into smaller steps. It&#8217;s ok if you don&#8217;t finish the problem completely in the end. <\/p>\n\n\n\n<p><strong><em>Study tips and resources!<\/em><\/strong><\/p>\n\n\n\n<p>It really comes down to practicing like how you would in an interview. <\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Try to use the approach above when solving a problem.<\/li>\n\n\n\n<li>Time yourself. <\/li>\n\n\n\n<li>Find a study partner, so you can practice problems with each other and do mock interviews. <\/li>\n\n\n\n<li>Study by topic<\/li>\n<\/ul>\n\n\n\n<p class=\"has-medium-font-size\"><strong><em>Here are some of my favorite resources:<\/em><\/strong><\/p>\n\n\n\n<p><strong><em>Online study platforms:<\/em><\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Leetcode<\/li>\n\n\n\n<li>Codesignal<\/li>\n\n\n\n<li>Codility<\/li>\n<\/ul>\n\n\n\n<p>What&#8217;s cool about CodeSignal is that they have an &#8220;Interview Practice&#8221; section that has problems for each topic.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/6519\/files\/2023\/01\/Screenshot-2023-01-12-at-5.25.50-PM.png\" alt=\"\" class=\"wp-image-10\" width=\"359\" height=\"480\" srcset=\"https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/6519\/files\/2023\/01\/Screenshot-2023-01-12-at-5.25.50-PM.png 546w, https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/6519\/files\/2023\/01\/Screenshot-2023-01-12-at-5.25.50-PM-225x300.png 225w\" sizes=\"auto, (max-width: 359px) 100vw, 359px\" \/><\/figure>\n\n\n\n<p>What&#8217;s cool about Codility is that for each lesson there&#8217;s reading material to go along with it. Codility will also evaluate the time complexity and performance of your program giving you a score after submitting.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"977\" height=\"863\" src=\"https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/6519\/files\/2023\/01\/Screenshot-2023-01-12-at-5.27.52-PM.png\" alt=\"\" class=\"wp-image-11\" srcset=\"https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/6519\/files\/2023\/01\/Screenshot-2023-01-12-at-5.27.52-PM.png 977w, https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/6519\/files\/2023\/01\/Screenshot-2023-01-12-at-5.27.52-PM-300x265.png 300w, https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/6519\/files\/2023\/01\/Screenshot-2023-01-12-at-5.27.52-PM-768x678.png 768w\" sizes=\"auto, (max-width: 977px) 100vw, 977px\" \/><\/figure>\n\n\n\n<p><strong><em>Books<\/em><\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/edu.anarcho-copy.org\/Algorithm\/grokking-algorithms-illustrated-programmers-curious.pdf\" data-type=\"URL\" data-id=\"https:\/\/edu.anarcho-copy.org\/Algorithm\/grokking-algorithms-illustrated-programmers-curious.pdf\" target=\"_blank\" rel=\"noreferrer noopener\">Grokking algorithms book (pdf)<\/a><\/li>\n\n\n\n<li><a rel=\"noreferrer noopener\" href=\"https:\/\/cses.fi\/book\/book.pdf\" data-type=\"URL\" data-id=\"https:\/\/cses.fi\/book\/book.pdf\" target=\"_blank\">Competitive Programmer&#8217;s Handbook (pdf)<\/a> (this one is a bit excessive, but has some really interesting topics!)<\/li>\n<\/ul>\n\n\n\n<p><strong><em>Youtube<\/em><\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a rel=\"noreferrer noopener\" href=\"https:\/\/www.youtube.com\/@abdul_bari\" data-type=\"URL\" data-id=\"https:\/\/www.youtube.com\/@abdul_bari\" target=\"_blank\">Abdul Bari<\/a> (the goat&#8230;)<\/li>\n\n\n\n<li><a href=\"https:\/\/www.youtube.com\/@tusharroy2525\" data-type=\"URL\" data-id=\"https:\/\/www.youtube.com\/@tusharroy2525\" target=\"_blank\" rel=\"noreferrer noopener\">Cod<\/a><a href=\"https:\/\/www.youtube.com\/@tusharroy2525\" data-type=\"URL\" data-id=\"https:\/\/www.youtube.com\/@tusharroy2525\">ing made simple<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/www.youtube.com\/@NeetCode\" data-type=\"URL\" data-id=\"https:\/\/www.youtube.com\/@NeetCode\" target=\"_blank\" rel=\"noreferrer noopener\">Neetcode<\/a><\/li>\n<\/ul>\n\n\n\n<p><strong><em>To conclude<\/em><\/strong><\/p>\n\n\n\n<p>Mastering algorithms and data structures can be overwhelming and tough. It comes down to consistency and practice. Do a couple of problems every day while implementing the approach and strategies I outlined above and you&#8217;ll definitely see improvement over time. Good luck &amp; thanks for reading!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I am currently going through the job hunting process. This includes applying to new grad positions, emailing recruiters, attending career fairs, and *of course* doing LeetCode problems. If you haven&#8217;t applied to jobs yet, you&#8217;ll soon find out that you&#8217;ll receive an online assessment (OA) as the first step in the interview process. I&#8217;ve received [&hellip;]<\/p>\n","protected":false},"author":13207,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-9","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/blogs.oregonstate.edu\/easterdr\/wp-json\/wp\/v2\/posts\/9","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.oregonstate.edu\/easterdr\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.oregonstate.edu\/easterdr\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.oregonstate.edu\/easterdr\/wp-json\/wp\/v2\/users\/13207"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.oregonstate.edu\/easterdr\/wp-json\/wp\/v2\/comments?post=9"}],"version-history":[{"count":10,"href":"https:\/\/blogs.oregonstate.edu\/easterdr\/wp-json\/wp\/v2\/posts\/9\/revisions"}],"predecessor-version":[{"id":22,"href":"https:\/\/blogs.oregonstate.edu\/easterdr\/wp-json\/wp\/v2\/posts\/9\/revisions\/22"}],"wp:attachment":[{"href":"https:\/\/blogs.oregonstate.edu\/easterdr\/wp-json\/wp\/v2\/media?parent=9"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.oregonstate.edu\/easterdr\/wp-json\/wp\/v2\/categories?post=9"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.oregonstate.edu\/easterdr\/wp-json\/wp\/v2\/tags?post=9"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}