<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Daniel Borowski</title>
    <description>The latest articles on DEV Community by Daniel Borowski (@borowskidaniel).</description>
    <link>https://dev.to/borowskidaniel</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F214900%2Ff677c7df-49ea-45eb-a368-25aadca31467.jpg</url>
      <title>DEV Community: Daniel Borowski</title>
      <link>https://dev.to/borowskidaniel</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/borowskidaniel"/>
    <language>en</language>
    <item>
      <title>BigO for technical interviews</title>
      <dc:creator>Daniel Borowski</dc:creator>
      <pubDate>Tue, 18 May 2021 01:14:57 +0000</pubDate>
      <link>https://dev.to/coderbyte/bigo-for-technical-interviews-3ij9</link>
      <guid>https://dev.to/coderbyte/bigo-for-technical-interviews-3ij9</guid>
      <description>&lt;p&gt;When preparing for upcoming technical interviews (especially for software engineering roles at &lt;a href="https://blog.interviewing.io/how-do-i-know-if-im-ready-to-interview-at-faang/" rel="noopener noreferrer"&gt;FAANG companies&lt;/a&gt;), you might practice by solving coding challenges online and preparing by solving &lt;a href="https://www.pathrise.com/guides/93-software-engineer-interview-questions-to-nail-your-onsite/" rel="noopener noreferrer"&gt;common interview questions&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;One of our previous articles lists some &lt;a href="https://dev.to/coderbyte/the-best-code-interview-prep-platforms-in-2020-3emj"&gt;common platforms&lt;/a&gt; where you can practice coding, like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://coderbyte.com/" rel="noopener noreferrer"&gt;Coderbyte&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.interviewcake.com/" rel="noopener noreferrer"&gt;Interview Cake&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.algoexpert.io/product" rel="noopener noreferrer"&gt;AlgoExpert&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://leetcode.com/" rel="noopener noreferrer"&gt;Leetcode&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://en.wikipedia.org/wiki/Big_O_notation" rel="noopener noreferrer"&gt;Big-O&lt;/a&gt; is an important concept you'll come across when learning about algorithms and data structures. &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Big-O notation is used to classify algorithms according to how their run time or space requirements grow as the input size grows.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://coderbyte.com/big-o-runtime-guide" rel="noopener noreferrer"&gt;Coderbyte&lt;/a&gt; is the only platform where the runtime analysis for your solutions is generated and expressed in Big-O notation automatically in your profile. Below is a screenshot of how it'll look on your profile after solving a coding challenge.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;FindIntersection&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;strArr&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; 
  &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;arr1&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;strArr&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nf"&gt;split&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;, &lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;arr2&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;strArr&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nf"&gt;split&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;, &lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;intersArr&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[];&lt;/span&gt;
  &lt;span class="k"&gt;for &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="nx"&gt;arr1&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;arr2&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;includes&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;arr1&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]))&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nx"&gt;intersArr&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;push&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;arr1&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;intersArr&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toString&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq7e47t3bfukxplcre6zk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq7e47t3bfukxplcre6zk.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When you submit a solution for a challenge and it passes all the test cases, your solution is then sent to our runtime-analysis server where we run a series of progressively larger test cases, and then statistically determine what runtime trajectory it matches. We currently will return one of the following &lt;a href="https://en.wikipedia.org/wiki/Big_O_notation#Orders_of_common_functions" rel="noopener noreferrer"&gt;common Big-O results&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;We &lt;a href="https://github.com/coderbyte-org/big-o" rel="noopener noreferrer"&gt;open-sourced our code&lt;/a&gt; for this as well (written in TypeScript) so you can learn how it works!&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/HfIH3czXc-8"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Hi CodeLand, we're Coderbyte and we're here to help you level up your interview skills.</title>
      <dc:creator>Daniel Borowski</dc:creator>
      <pubDate>Thu, 23 Jul 2020 12:02:20 +0000</pubDate>
      <link>https://dev.to/coderbyte/hi-codeland-we-re-coderbyte-and-we-re-here-to-help-you-level-up-your-interview-skills-g2k</link>
      <guid>https://dev.to/coderbyte/hi-codeland-we-re-coderbyte-and-we-re-here-to-help-you-level-up-your-interview-skills-g2k</guid>
      <description>&lt;p&gt;&lt;a href="https://coderbyte.com" rel="noopener noreferrer"&gt;Coderbyte&lt;/a&gt; is the #1 coding challenge platform for interview prep. We offer a collection of code challenges and web development courses that can help you prepare for upcoming job interviews. The coding challenges range in difficulty and they can all be completed straight in our online editor!&lt;/p&gt;

&lt;p&gt;We're so excited to be at Codeland, and hope we can help you level up your coding and interview skills.  Check us out at &lt;a href="https://coderbyte.com" rel="noopener noreferrer"&gt;Coderbyte.com&lt;/a&gt; and take the Codeland challenge today.&lt;/p&gt;

&lt;p&gt;Here's what you can expect (psssst scroll down for a special CodeLand discount):&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F168soqf73yd1h4jm05f2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F168soqf73yd1h4jm05f2.png" alt="interview-kits"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fbi67gig9oynd21nedx5h.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fbi67gig9oynd21nedx5h.png" alt="solution-guide"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fpo31z1n2dxl2qsjuij4k.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fpo31z1n2dxl2qsjuij4k.png" alt="progress-tracking"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fmlz463y6qqew0dbbmwia.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fmlz463y6qqew0dbbmwia.png" alt="coding-environment"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  A CodeLand Exclusive Discount ✨
&lt;/h3&gt;

&lt;p&gt;If you're excited about our approach to interview prep, then today's your lucky day! Please enjoy 30% off any subscriptions or crash courses with this &lt;a href="https://coderbyte.com/member?promo=janpromo4351&amp;amp;utm_source=Codeland" rel="noopener noreferrer"&gt;special CodeLand link&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;If you have any questions at all, please feel free to leave a comment down below :)&lt;/p&gt;

</description>
      <category>codeland</category>
    </item>
    <item>
      <title>The Best Code Interview Prep Platforms in 2020</title>
      <dc:creator>Daniel Borowski</dc:creator>
      <pubDate>Tue, 16 Jun 2020 04:55:17 +0000</pubDate>
      <link>https://dev.to/coderbyte/the-best-code-interview-prep-platforms-in-2020-3emj</link>
      <guid>https://dev.to/coderbyte/the-best-code-interview-prep-platforms-in-2020-3emj</guid>
      <description>&lt;p&gt;Software developer interviews are rapidly evolving. Years ago, mastering data structures and common algorithms was enough to ace an interview and get a job. Today though, employers want candidates with real-world experience and skills.&lt;/p&gt;

&lt;p&gt;That’s why many interviewers won’t even ask data structure or algorithm questions at all. Instead, they'll focus on proficiencies with full-stack technologies and collaboration skills.&lt;/p&gt;

&lt;p&gt;Job seekers would be wise to practice code challenges and take mock interviews to make sure they’re prepared. There are countless books and resources, such as &lt;a href="https://www.amazon.com/Cracking-Coding-Interview-Programming-Questions/dp/0984782850"&gt;Cracking The Coding Interview&lt;/a&gt;, and &lt;a href="https://www.freecodecamp.org/news/the-8-most-popular-coding-challenge-websites-of-2020/"&gt;popular online code challenge websites&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;In addition to those resources, here are the best code interview prep platforms for developer candidates.&lt;/p&gt;

&lt;h1&gt;
  
  
  &lt;a href="https://coderbyte.com/"&gt;Coderbyte&lt;/a&gt;
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--sjlhbQLP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/5nm0plur6dylsu3agp0f.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--sjlhbQLP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/5nm0plur6dylsu3agp0f.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Coderbyte, my website, is the only site to offer full-stack coding challenges, interview prep courses, and mock interviews. With 500+ challenges, articles, and videos across algorithm, front-end, and even database technologies, you can quickly assess and refine your skills for any role. We also showcase user-submitted and official solutions for all challenges.&lt;/p&gt;

&lt;h1&gt;
  
  
  &lt;a href="https://www.interviewcake.com/"&gt;Interview Cake&lt;/a&gt;
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--W9p-H9MW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/3owzalnif98tm2m22c5p.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--W9p-H9MW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/3owzalnif98tm2m22c5p.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Frequently considered the best source for interview articles, tips, and content, Interview Cake is a crash course in getting a software development job.&lt;/p&gt;

&lt;p&gt;They offer courses that are specific to leading technology companies, and provide guidance beyond solving coding problems, such as advice on how to effectively communicate with interviewers even when you don’t know the answer.&lt;/p&gt;

&lt;h1&gt;
  
  
  &lt;a href="https://www.algoexpert.io/product"&gt;AlgoExpert&lt;/a&gt;
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--WLW127K7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/1yidxzhh23ay21d2i0bu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--WLW127K7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/1yidxzhh23ay21d2i0bu.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;AlgoExpert is one of the original coding challenge websites. The site offers tons of video tutorials, certifications, and interview tips. Their interview prep includes a selection of 100 challenges across all types of technologies and roles.&lt;/p&gt;

&lt;h1&gt;
  
  
  &lt;a href="https://interviewing.io/"&gt;Interviewing.io&lt;/a&gt;
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--h8lJT3Zd--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/3xe7jfr0e278sl366xxg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--h8lJT3Zd--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/3xe7jfr0e278sl366xxg.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Interviewing.io takes a very unique approach to coding interview prep. Rather than providing content and practice coding challenges, Interviewing.io has a library of actual video interviews that you can watch, and you can pay to anonymously take a mock interview with an engineering hiring manager.&lt;/p&gt;

&lt;p&gt;You may still need to practice coding on another site, but this is a great investment to get actionable feedback.&lt;/p&gt;

&lt;h1&gt;
  
  
  &lt;a href="https://leetcode.com/"&gt;Leetcode&lt;/a&gt;
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--V_HCrCyF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/gflszm2aom7j04zpp7ep.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--V_HCrCyF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/gflszm2aom7j04zpp7ep.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Like Coderbyte and AlgoExpert, Leetcode is one of the original coding challenge websites. They offer many interview prep courses for tech companies and roles, and display the average scores for different cohorts of developers so you can easily benchmark.&lt;/p&gt;

&lt;h1&gt;
  
  
  &lt;a href="https://www.hackerearth.com/for-developers"&gt;HackerEarth&lt;/a&gt;
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--3C6Z6xYC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/wn4ycljgiio2xdpcchx6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--3C6Z6xYC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/wn4ycljgiio2xdpcchx6.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Famous for their coding competitions and hackathons, HackerEarth recently launched a feature for mock interviews.&lt;/p&gt;

&lt;p&gt;They have a massive community of international developers and companies, so this is a great site if you are also looking to connect with a potential employer.&lt;/p&gt;

&lt;h1&gt;
  
  
  &lt;a href="https://www.hackerrank.com/dashboard"&gt;HackerRank&lt;/a&gt;
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--uAOh4u0M--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/0jdg7erqpcavsrwam0x6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--uAOh4u0M--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/0jdg7erqpcavsrwam0x6.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Known for their recruiting tools, HackerRank also offers code challenges and interview prep for developers. There's no premium version, so you can access their strong library of challenges for free. It’s a good place to start for a job seeker that isn’t sure yet if they are ready to invest in premium interview prep.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>codenewbie</category>
      <category>webdev</category>
      <category>productivity</category>
    </item>
    <item>
      <title>The Best Coding Challenge Websites of 2020</title>
      <dc:creator>Daniel Borowski</dc:creator>
      <pubDate>Sun, 05 Jan 2020 18:17:39 +0000</pubDate>
      <link>https://dev.to/coderbyte/the-best-coding-challenge-websites-of-2020-3p6</link>
      <guid>https://dev.to/coderbyte/the-best-coding-challenge-websites-of-2020-3p6</guid>
      <description>&lt;p&gt;Despite the lowest unemployment rate in decades, &lt;a href="https://www.techrepublic.com/article/tech-jobs-will-see-steady-growth-through-2023/"&gt;analysts expect&lt;/a&gt; technology hiring to continue growing steadily into the 2020s. That’s great news for recent computer science graduates and developers currently working in the field, but that doesn’t mean ambitious engineers can get complacent. While there will likely be growth opportunities in the market overall, there are still significant changes apace and urgency to keep up with the latest trends.&lt;/p&gt;

&lt;p&gt;Today, there are more types of technical roles than ever before, and a continued proliferation of new languages, frameworks, and technologies. Technical employees that want to get ahead should routinely test and refine their skills. To that end, I’ve put together the following list of platforms where you can level up your skills for any number of roles, from data science to developer operations.&lt;/p&gt;




&lt;h1&gt;
  
  
  1. Coderbyte
&lt;/h1&gt;

&lt;p&gt;Helpful links: &lt;a href="https://coderbyte.com/?utm_source=Dev.to&amp;amp;utm_medium=Article&amp;amp;utm_campaign=CodeReview"&gt;Website&lt;/a&gt; | &lt;a href="https://coderbyte.com/challenges?utm_source=Dev.to&amp;amp;utm_medium=Article&amp;amp;utm_campaign=CodeReview"&gt;Challenges&lt;/a&gt; | &lt;a href="https://coderbyte.com/member?utm_source=Dev.to&amp;amp;utm_medium=Article&amp;amp;utm_campaign=CodeReview"&gt;Premium&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--KImF0KRv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/b7kcabmuc4fjzic54rox.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--KImF0KRv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/b7kcabmuc4fjzic54rox.png" alt="cb"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Coderbyte provides 300+ coding challenges you can solve in an online editor using 10 different programming languages. You can then access official solutions, over 1.5 million user solutions, and read articles on how to efficiently solve the challenges. Coderbyte is recommended by the top coding bootcamps and companies because of its collection of interview prep challenges.&lt;/p&gt;

&lt;h3&gt;
  
  
  Great for…
&lt;/h3&gt;

&lt;p&gt;Coderbyte is perfect for people in the beginner-to-intermediate phase of their careers. There is a library of harder challenges as well for those who like to solve coding problems for fun, but this isn’t primarily a site for competitive programmers.&lt;/p&gt;

&lt;h3&gt;
  
  
  Pricing / Premium content
&lt;/h3&gt;

&lt;p&gt;There are a handful of free challenges on Coderbyte, and then there are hundreds of premium challenges and over 1 million user solutions that are available to members.&lt;/p&gt;




&lt;h1&gt;
  
  
  2. LeetCode
&lt;/h1&gt;

&lt;p&gt;Helpful links: &lt;a href="https://leetcode.com/"&gt;Website&lt;/a&gt; | &lt;a href="https://leetcode.com/problemset/all/"&gt;Free Challenges&lt;/a&gt; | &lt;a href="https://leetcode.com/subscribe/"&gt;Premium&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--6TOScuyt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/8uq856uuj0pjh6g3328p.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--6TOScuyt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/8uq856uuj0pjh6g3328p.png" alt="lc"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;LeetCode has a collection of some of the best algorithm challenges online today. The topics they cover require knowledge of data structures such as binary trees, heaps, linked lists, etc., which is why their challenges are a bit more advanced than some other websites — but the challenges are great if used when preparing for a software engineering interview.&lt;/p&gt;

&lt;p&gt;They also have a &lt;a href="https://leetcode.com/interview/"&gt;Mock Interview&lt;/a&gt; section that is specifically for job interview preparation, they host their own coding contests, and they have a great discussion board where people talk about interview questions, jobs, compensation, and other topics related to engineering.&lt;/p&gt;

&lt;h3&gt;
  
  
  Great for…
&lt;/h3&gt;

&lt;p&gt;LeetCode is great for intermediate-to-advanced programmers. It might not be the best suited for brand new coders who don’t yet know how to write basic loops for example, but once you learn the fundamentals this is a great site to practice coding.&lt;/p&gt;

&lt;h3&gt;
  
  
  Pricing / Premium content
&lt;/h3&gt;

&lt;p&gt;There are free challenges available on LeetCode, and they also have a premium subscription which gets you access to more challenges and other features of the platform.&lt;/p&gt;




&lt;h1&gt;
  
  
  3. Edabit
&lt;/h1&gt;

&lt;p&gt;Helpful links: &lt;a href="https://edabit.com/"&gt;Website&lt;/a&gt; | &lt;a href="https://edabit.com/challenges"&gt;Challenges&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ujf_8qJF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/jscfgb4zxbu5ryw4t2dt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ujf_8qJF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/jscfgb4zxbu5ryw4t2dt.png" alt="eb"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Edabit has grown in popularity over the last year, and developers seem to really enjoy the challenges. They offer a large collection of over 4,000 challenges that can be solved online in one of several languages. The site currently only offers online interactive coding challenges — there aren’t any discussion boards, articles, user solutions, or mock interviews like other sites offer, but over time they might be adding some of these.&lt;/p&gt;

&lt;h3&gt;
  
  
  Great for…
&lt;/h3&gt;

&lt;p&gt;Edabit is great for beginners looking to practice their coding skills daily by solving bite-sized challenges. Once you reach the intermediate stage, other sites provide harder challenges and more content geared towards competitive programming and job interviews.&lt;/p&gt;

&lt;h3&gt;
  
  
  Pricing / Premium content
&lt;/h3&gt;

&lt;p&gt;All the challenges on Edabit are free, and there is no premium pricing option.&lt;/p&gt;




&lt;h1&gt;
  
  
  4. Codewars
&lt;/h1&gt;

&lt;p&gt;Helpful links: &lt;a href="https://www.codewars.com/"&gt;Website&lt;/a&gt; | &lt;a href="https://www.codewars.com/kata/latest/my-languages"&gt;Free Challenges&lt;/a&gt; | &lt;a href="https://www.codewars.com/subscribe"&gt;Premium&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--vA8AvXNQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/wt3xbrou7by7efpiudre.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--vA8AvXNQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/wt3xbrou7by7efpiudre.png" alt="cw"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Codewars provides a large collection of coding challenges submitted and edited by their own community. You can solve the challenges directly online in their editor using 20+ programming languages. You can view a discussion for each challenge as well as user solutions. You can earn points and climb the rankings by solving their challenges.&lt;/p&gt;

&lt;h3&gt;
  
  
  Great for…
&lt;/h3&gt;

&lt;p&gt;Codewars is great for people in the beginner-to-intermediate phase. The challenges are created by the community so you get exposed to a lot of different types of coding challenges.&lt;/p&gt;

&lt;h3&gt;
  
  
  Pricing / Premium content
&lt;/h3&gt;

&lt;p&gt;They offer all of their challenges created by the community for free, and their premium subscription gets you access to some cool features on their platform.&lt;/p&gt;




&lt;h1&gt;
  
  
  5. HackerRank
&lt;/h1&gt;

&lt;p&gt;Helpful links: &lt;a href="https://www.hackerrank.com/?utm_expid=.2u09ecQTSny1HV02SEVoCg.0&amp;amp;utm_referrer="&gt;Website&lt;/a&gt; | &lt;a href="https://www.hackerrank.com/dashboard"&gt;Challenges&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--udVQMXEw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/p8u3c655u87m5pqjgynr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--udVQMXEw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/p8u3c655u87m5pqjgynr.png" alt="hr"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;HackerRank has a large collection of coding challenges tailored towards algorithms and data structures, along with interview prep material, a discussion board for each challenge, and a list of top user solutions. They have challenges for other topics as well like functional programming, AI, Shell, SQL, and more.&lt;/p&gt;

&lt;h3&gt;
  
  
  Great for…
&lt;/h3&gt;

&lt;p&gt;HackerRank is great for intermediate-to-advanced programmers who have already picked up the basics of a language and are ready to solve more complicated problems. The challenges are written with mathematical notation and can sometimes be a little confusing, which is why it might not be so great for beginner developers.&lt;/p&gt;

&lt;h3&gt;
  
  
  Pricing / Premium content
&lt;/h3&gt;

&lt;p&gt;All the challenges on HackerRank are free, and there is no premium pricing option.&lt;/p&gt;




&lt;h1&gt;
  
  
  6. freeCodeCamp
&lt;/h1&gt;

&lt;p&gt;Helpful links: &lt;a href="https://www.freecodecamp.org/learn/"&gt;Website&lt;/a&gt; | &lt;a href="https://www.freecodecamp.org/learn/coding-interview-prep/data-structures/typed-arrays/"&gt;Challenges&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--XWUPuDcG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/e5gtg45c68jri8f5xbyq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--XWUPuDcG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/e5gtg45c68jri8f5xbyq.png" alt="fcc"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;freeCodeCamp is a great website for novices and beginners who are just getting into coding. They offer all sorts of resources on learning syntax, practicing coding, building projects, and preparing for interviews. They don’t have as many interactive coding challenges as other sites, but they do offer some fun challenges and interview prep for beginners learning JavaScript.&lt;/p&gt;

&lt;h3&gt;
  
  
  Great for…
&lt;/h3&gt;

&lt;p&gt;Novices who are just learning to code for the first time. It’s a great place to learn HTML, CSS and JavaScript in a fun, interactive way.&lt;/p&gt;

&lt;h3&gt;
  
  
  Pricing / Premium content
&lt;/h3&gt;

&lt;p&gt;freeCodeCamp is completely free.&lt;/p&gt;




&lt;h1&gt;
  
  
  7. TopCoder
&lt;/h1&gt;

&lt;p&gt;Helpful links: &lt;a href="https://www.topcoder.com/"&gt;Website&lt;/a&gt; | &lt;a href="https://www.topcoder.com/challenges"&gt;Challenges&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--OemkvBtz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/up1oqle0nou13v5v0yvy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--OemkvBtz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/up1oqle0nou13v5v0yvy.png" alt="tc"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;TopCoder is one of the original platforms for competitive programming online. It provides a list of algorithmic challenges from past competitions that you can complete on your own directly online using their code editor. Their popular Single Round Matches are offered a few times per month at a specific time where you compete against others to solve challenges. Here are some topics that their challenges may cover.&lt;br&gt;
Aside from solving challenges for fun online, they offer sponsored competitions where you can win prizes for writing the best solution.&lt;/p&gt;

&lt;h3&gt;
  
  
  Great for…
&lt;/h3&gt;

&lt;p&gt;TopCoder is better suited for advanced programmers who are comfortable solving algorithm challenges dealing with advanced topics like graph search and number theory.&lt;/p&gt;

&lt;h3&gt;
  
  
  Pricing / Premium content
&lt;/h3&gt;

&lt;p&gt;All the challenges on TopCoder are free, and there is no premium pricing option.&lt;/p&gt;




&lt;h1&gt;
  
  
  8. Codeforces
&lt;/h1&gt;

&lt;p&gt;Helpful links: &lt;a href="https://codeforces.com/"&gt;Website&lt;/a&gt; | &lt;a href="https://codeforces.com/problemset"&gt;Challenges&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--P202_nZS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/cm5ca2f6bu34rbe8cgom.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--P202_nZS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/cm5ca2f6bu34rbe8cgom.png" alt="cf"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Codeforces is now probably the top competitive programming website (where a few years ago TopCoder was where most competitive programmers spent their time). There are problems that you can solve online to practice, but there’s no online editor. Rather, you write your solution in your own editor and then upload it to their system which then tests your code against a suite of test cases.&lt;br&gt;
They also frequently hold contests where the best competitive programmers take part in.&lt;/p&gt;

&lt;h3&gt;
  
  
  Great for…
&lt;/h3&gt;

&lt;p&gt;Advanced and competitive programmers who truly enjoy solving difficult algorithm challenges.&lt;/p&gt;

&lt;h3&gt;
  
  
  Pricing / Premium content
&lt;/h3&gt;

&lt;p&gt;All the challenges on Codeforces are free, there is no premium pricing option.&lt;/p&gt;

</description>
      <category>codenewbie</category>
      <category>javascript</category>
      <category>challenge</category>
      <category>career</category>
    </item>
    <item>
      <title>The 5 hardest code challenges for beginners</title>
      <dc:creator>Daniel Borowski</dc:creator>
      <pubDate>Sat, 12 Oct 2019 23:03:35 +0000</pubDate>
      <link>https://dev.to/coderbyte/the-5-hardest-code-challenges-for-beginners-5flc</link>
      <guid>https://dev.to/coderbyte/the-5-hardest-code-challenges-for-beginners-5flc</guid>
      <description>&lt;p&gt;On Coderbyte we offer around 100 &lt;em&gt;easy&lt;/em&gt; code challenges that are perfect for beginners who are learning to code and need some way to practice. We looked at the stats for these challenges and found the ones where users struggled with the most to achieve a perfect score. We ended up narrowing down all the easy challenges to find the 5 hardest ones listed in the &lt;em&gt;easy&lt;/em&gt; section — where by easy we mean challenges that should be solvable somewhere between 15–25 minutes by a beginner coder.&lt;/p&gt;

&lt;h1&gt;
  
  
  Hardest Beginner Challenges
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.coderbyte.com/editor/Questions%20Marks:JavaScript"&gt;Question Marks&lt;/a&gt;: Requires looping through a string and checking if certain conditions are met.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.coderbyte.com/editor/Vowel%20Square:JavaScript"&gt;Vowel Square&lt;/a&gt;: Requires finding a 2x2 square of vowels in a larger matrix.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.coderbyte.com/editor/Scale%20Balancing:JavaScript"&gt;Scale Balancing&lt;/a&gt;: Requires looping through an array of weights to determine if a scale can be perfectly balanced.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.coderbyte.com/editor/Correct%20Path:JavaScript"&gt;Correct Path&lt;/a&gt;: Requires traversing through a partially finished path in an NxN matrix and finishing the path.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.coderbyte.com/editor/Closest%20Enemy%20II:JavaScript"&gt;Closest Enemy II&lt;/a&gt;: Requires checking the distance between certain points in a NxM matrix.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Out of these, the challenge where users struggled most to get a perfect score and spent the longest time solving is &lt;strong&gt;Question Marks&lt;/strong&gt;.&lt;/p&gt;

&lt;h1&gt;
  
  
  Challenge Description
&lt;/h1&gt;

&lt;p&gt;Take an input string parameter and determine if exactly 3 question marks exist between every pair of numbers that add up to 10. If so, return true, otherwise return false. Some examples test cases are below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;arrb6???4xxbl5???eee5&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;acc?7??sss?3rr1??????5&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;5??aaaaaaaaaaaaaaaaaaa?5?5&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;
&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;9???1???9???1???9&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;aa6?9&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Before reading further, try and think of how you would solve this challenge.&lt;/p&gt;

&lt;h1&gt;
  
  
  Analysis
&lt;/h1&gt;

&lt;p&gt;This challenge requires several layers of logic to get right, which is why it can be difficult to come up with a solution at first. It requires looping through the string and maintaining the position of every pair of numbers that add up to 10. If you do find two numbers that add up to 10, then you will need to determine if exactly 3 specific characters exist somewhere between these two indices.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;68%&lt;/strong&gt; of users who submitted a solution in JavaScript didn’t get a perfect score.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;35%&lt;/strong&gt; of users who submitted a solution in Ruby didn’t get a perfect score.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The average number of lines for a solution is &lt;strong&gt;15–29&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  Sample Solutions
&lt;/h1&gt;

&lt;p&gt;Below is a very concise and elegant solution written in Python by the #13th ranked user on Coderbyte, &lt;a href="https://www.coderbyte.com/profile/Qlogin"&gt;Qlogin&lt;/a&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;QuestionsMarks&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
  &lt;span class="n"&gt;qnum&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;
  &lt;span class="n"&gt;dig&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;
  &lt;span class="n"&gt;has_10&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="bp"&gt;False&lt;/span&gt;
  &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;ch&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;ch&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;isdigit&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
      &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="nb"&gt;int&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ch&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;dig&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;qnum&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
          &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="s"&gt;'false'&lt;/span&gt;
        &lt;span class="n"&gt;has_10&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="bp"&gt;True&lt;/span&gt;
      &lt;span class="n"&gt;dig&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;int&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ch&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
      &lt;span class="n"&gt;qnum&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;
    &lt;span class="k"&gt;elif&lt;/span&gt; &lt;span class="n"&gt;ch&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s"&gt;'?'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
      &lt;span class="n"&gt;qnum&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="s"&gt;'true'&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;has_10&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="s"&gt;'false'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;There is also a clever regex solution that a &lt;a href="https://www.coderbyte.com/profile/tonichen"&gt;user on Coderbyte&lt;/a&gt; implemented in Java to solve the challenge:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;static&lt;/span&gt; &lt;span class="nc"&gt;String&lt;/span&gt; &lt;span class="nf"&gt;QuestionsMarks&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;String&lt;/span&gt; &lt;span class="n"&gt;str&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt; 

  &lt;span class="n"&gt;str&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;str&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;replaceAll&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"[a-z]+"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="s"&gt;""&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
  &lt;span class="nc"&gt;Pattern&lt;/span&gt; &lt;span class="n"&gt;pattern&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Pattern&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;compile&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"([0-9])([?])([?])([?])([0-9])"&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
  &lt;span class="nc"&gt;Pattern&lt;/span&gt; &lt;span class="n"&gt;pattern01&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Pattern&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;compile&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"([0-9])([?])([?])([0-9])"&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
  &lt;span class="nc"&gt;Matcher&lt;/span&gt; &lt;span class="n"&gt;matcher01&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;pattern01&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;matcher&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;str&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
  &lt;span class="nc"&gt;Pattern&lt;/span&gt; &lt;span class="n"&gt;pattern02&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Pattern&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;compile&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"([0-9])([?])([0-9])"&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
  &lt;span class="nc"&gt;Matcher&lt;/span&gt; &lt;span class="n"&gt;matcher02&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;pattern02&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;matcher&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;str&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
  &lt;span class="nc"&gt;Matcher&lt;/span&gt; &lt;span class="n"&gt;matcher&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;pattern&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;matcher&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;str&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;

  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;matcher01&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;find&lt;/span&gt;&lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="n"&gt;matcher02&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;find&lt;/span&gt;&lt;span class="o"&gt;())&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="s"&gt;"false"&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
  &lt;span class="o"&gt;}&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;matcher&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;find&lt;/span&gt;&lt;span class="o"&gt;())&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="s"&gt;"true"&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
  &lt;span class="o"&gt;}&lt;/span&gt;

  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="s"&gt;"false"&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Try out the challenges for yourself on &lt;a href="https://www.coderbyte.com/challenges"&gt;Coderbyte&lt;/a&gt; and comment below on what you think about the sample solutions!&lt;/p&gt;

&lt;p&gt;&lt;em&gt;This article originally appeared on &lt;a href="https://medium.com/coderbyte/the-5-hardest-code-challenges-for-beginners-e410da4474b"&gt;Medium&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>challenge</category>
      <category>javascript</category>
      <category>python</category>
      <category>codenewbie</category>
    </item>
    <item>
      <title>Improving your Algorithms &amp; Data Structure skills</title>
      <dc:creator>Daniel Borowski</dc:creator>
      <pubDate>Wed, 09 Oct 2019 14:22:37 +0000</pubDate>
      <link>https://dev.to/coderbyte/improving-your-algorithms-data-structure-skills-2odo</link>
      <guid>https://dev.to/coderbyte/improving-your-algorithms-data-structure-skills-2odo</guid>
      <description>&lt;h2&gt;
  
  
  Fundamentals
&lt;/h2&gt;

&lt;p&gt;The first thing you’ll need if you want to get better at algorithms and data structures is a solid base. This base can be learned one of several ways, either through a computer science program at university, some coding bootcamps focus a bit on the topics below, or you can learn on your own from &lt;a href="https://www.quora.com/What-are-the-best-books-to-learn-algorithms-and-data-structures-Are-there-any-good-blogs-posts-on-these-Which-books-explain-these-concepts-in-a-simpler-way"&gt;books&lt;/a&gt;, videos, or &lt;a href="https://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-006-introduction-to-algorithms-fall-2011/"&gt;online lectures&lt;/a&gt;. So you’ll need a basic understanding of the following topics to get started:&lt;/p&gt;

&lt;h3&gt;
  
  
  Data Structures
&lt;/h3&gt;

&lt;p&gt;Learn about arrays, linked lists, binary trees, hash tables, graphs, stacks, queues, heaps, and other fundamental data structures.&lt;/p&gt;

&lt;h3&gt;
  
  
  Computer Architecture
&lt;/h3&gt;

&lt;p&gt;Learn how data is represented in a computer, the basics of digital logic design, boolean algebra, computer arithmetic, floating-point representation, cache design. &lt;em&gt;Try and learn a little about C and Assembly programming.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Moving Forward Past the Fundamentals
&lt;/h2&gt;

&lt;p&gt;Once you feel like you have a good understanding of most of the concepts listed above, it’s time to start diving into the algorithms part. Here is a list of resources and things I did to get better at writing and understanding important algorithms.&lt;/p&gt;

&lt;h3&gt;
  
  
  Big-O &amp;amp; Runtime
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Learn what Big-O is and how to analyze the &lt;a href="https://cs.stackexchange.com/questions/192/how-to-come-up-with-the-runtime-of-algorithms"&gt;running times&lt;/a&gt; of algorithms. This is a &lt;a href="https://en.wikipedia.org/wiki/Introduction_to_Algorithms"&gt;classic book&lt;/a&gt; on the topic (here is the chapter on the &lt;a href="https://www.cs.dartmouth.edu/~ac/Teach/CS19-Winter06/SlidesAndNotes/CLRS-3.1.pdf"&gt;growth of functions&lt;/a&gt;).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Here is a good list of &lt;a href="https://github.com/tayllan/awesome-algorithms#online-courses"&gt;online courses&lt;/a&gt; that teach algorithms.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Implement Some Algorithms Yourself
&lt;/h3&gt;

&lt;p&gt;Start off by implementing several important algorithms yourself and learning about their running times. Some examples are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Binary search&lt;/li&gt;
&lt;li&gt;Euclid’s algorithm&lt;/li&gt;
&lt;li&gt;Depth and breadth first search&lt;/li&gt;
&lt;li&gt;Dijkstra’s shortest path&lt;/li&gt;
&lt;li&gt;Binary tree traversals&lt;/li&gt;
&lt;li&gt;Insertion sort, Mergesort, Quicksort&lt;/li&gt;
&lt;li&gt;Min &amp;amp; max heaps&lt;/li&gt;
&lt;li&gt;More &lt;a href="https://hbfs.wordpress.com/2008/12/23/the-10-classes-of-algorithms-every-programmer-must-know-about/"&gt;examples&lt;/a&gt; and &lt;a href="https://softwareengineering.stackexchange.com/questions/155639/which-algorithms-data-structures-should-i-recognize-and-know-by-name"&gt;lists&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Algorithm Books
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Read the &lt;a href="https://www.amazon.com/Algorithm-Design-Manual-Steven-Skiena/dp/1849967202"&gt;Algorithm Design Manual&lt;/a&gt;. It’s a great book and it’s my favorite.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://en.wikipedia.org/wiki/Introduction_to_Algorithms"&gt;Introduction to Algorithms&lt;/a&gt; is a classic book that covers a lot of material.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.amazon.com/Elements-Programming-Interviews-Insiders-Guide/dp/1479274836"&gt;Elements of Programming Interviews&lt;/a&gt; contains a lot of challenges and code solutions that will help you prepare for interviews.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Challenges
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Practice coding simple and then more advanced algorithms on sites like &lt;a href="https://coderbyte.com"&gt;Coderbyte&lt;/a&gt; which provide explanations and solutions so you can learn from other coders as well.&lt;/li&gt;
&lt;li&gt;Go through the challenges on this &lt;a href="https://runestone.academy/runestone/books/published/pythonds/index.html"&gt;interactive&lt;/a&gt; python algorithms website.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://medium.com/coderbyte/the-10-best-coding-challenge-websites-for-2018-12b57645b654"&gt;The 10 most popular coding challenge websites for 2018&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://medium.com/coderbyte/the-5-hardest-code-challenges-for-beginners-e410da4474b"&gt;The 5 hardest code challenges for beginners.&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Algorithms Explanations &amp;amp; Interview Questions
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Read as many algorithm explanations and code examples as you can on &lt;a href="https://www.geeksforgeeks.org/"&gt;GeeksforGeeks&lt;/a&gt;. Here is an &lt;a href="https://www.geeksforgeeks.org/graph-data-structure-and-algorithms/"&gt;example&lt;/a&gt; of a good post on graph algorithms.&lt;/li&gt;
&lt;li&gt;Look at some interview questions posted on &lt;a href="https://www.careercup.com/"&gt;CareerCup&lt;/a&gt; and try and understand how other users solved the questions. Like this &lt;a href="https://www.careercup.com/question?id=5641027330244608"&gt;example&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Aside from coding challenge sites, try and solve common coding interview questions you find online such as the ones on &lt;a href="https://www.quora.com/q/kqxqbzywcunzbyyp/500-Data-Structures-and-Algorithms-interview-questions-and-their-solutions"&gt;this list&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Dynamic Programming
&lt;/h3&gt;

&lt;p&gt;This a &lt;em&gt;very&lt;/em&gt; important concept you will need to understand if you want to get better at algorithms, which is the reason I separated this topic from the rest. The description from Wikipedia for it is:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;A method for solving a complex problem by breaking it down into a collection of simpler subproblems, solving each of those subproblems just once, and storing their solutions. The next time the same subproblem occurs, instead of recomputing its solution, one simply looks up the previously computed solution, thereby saving computation time.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I have seen dynamic programming show up in several coding interviews I’ve had. I’ve also seen problems that require a dynamic programming solution on challenge sites like &lt;a href="https://leetcode.com/problems/longest-palindromic-subsequence/description/"&gt;LeetCode&lt;/a&gt;, &lt;a href="https://code.google.com/codejam/contest/10224486/dashboard"&gt;Google Code Jam&lt;/a&gt;, and several challenges on &lt;a href="https://www.geeksforgeeks.org/google-foo-bar-challenge/"&gt;Google Foo Bar&lt;/a&gt; required a DP solution.&lt;/p&gt;

&lt;p&gt;I’d recommend to try and solve as many problems &lt;a href="https://www.geeksforgeeks.org/dynamic-programming/"&gt;on this list&lt;/a&gt; as you can. There is also a good tutorial on TopCoder titled: &lt;a href="https://community.topcoder.com/tc?module=Static&amp;amp;d1=features&amp;amp;d2=040104"&gt;Dynamic Programming — From Novice to Advanced&lt;/a&gt;. A lot of DP problems have the same structure and patterns so if you solve 3 DP problems everyday for 2 weeks or so, after a while you’ll be able to spot and solve a DP problem no problem.&lt;/p&gt;

&lt;h3&gt;
  
  
  Advanced Resources in Algorithms (&lt;strong&gt;optional&lt;/strong&gt;)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="http://courses.csail.mit.edu/6.851/fall17/lectures/"&gt;Advanced Data Structures Lectures&lt;/a&gt; by Erik Demaine&lt;/li&gt;
&lt;li&gt;
&lt;a href="http://courses.csail.mit.edu/6.890/fall14/lectures/"&gt;Algorithmic Lower Bounds: Fun with Hardness Proofs&lt;/a&gt; by Erik Demaine&lt;/li&gt;
&lt;li&gt;&lt;a href="https://cses.fi/book/index.html"&gt;Competitive Programmer’s Handbook&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://comscigate.com/Books/contests/icpc.pdf"&gt;The Hitchhiker’s Guide to the Programming Contests&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/AlgoWiki/AlgoWiki"&gt;AlgoWiki&lt;/a&gt;: A wiki dedicated to competitive programming&lt;/li&gt;
&lt;li&gt;
&lt;a href="http://opendatastructures.org/"&gt;Open Data Structures Book&lt;/a&gt;: implementation and analysis of data structures for sequences, queues, priority queues, unordered dictionaries, ordered dictionaries, and graphs&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I hope you enjoyed this list of resources. Feel free to practice coding on &lt;a href="https://coderbyte.com"&gt;Coderbyte&lt;/a&gt;, and comment below with any other resources you think are helpful.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;This article originally appeared on &lt;a href="https://medium.com/coderbyte/how-to-get-good-at-algorithms-data-structures-d33d5163353f"&gt;Medium&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>career</category>
      <category>javascript</category>
      <category>computerscience</category>
      <category>challenge</category>
    </item>
    <item>
      <title>A tricky JavaScript interview question asked by Google</title>
      <dc:creator>Daniel Borowski</dc:creator>
      <pubDate>Mon, 07 Oct 2019 23:19:35 +0000</pubDate>
      <link>https://dev.to/coderbyte/a-tricky-javascript-interview-question-asked-by-google-3gnf</link>
      <guid>https://dev.to/coderbyte/a-tricky-javascript-interview-question-asked-by-google-3gnf</guid>
      <description>&lt;p&gt;The following will be a short explanation, along with some solutions, of a popular JavaScript question that tends to get asked in developer interviews. The question usually looks something like the following:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// interviewer: what will the following code output?&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;arr&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;12&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;15&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;21&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="nx"&gt;arr&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;setTimeout&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Index: &lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;, element: &lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;arr&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="mi"&gt;3000&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;This question deals with the topics: &lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Closures"&gt;closures&lt;/a&gt;, &lt;a href="https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/setTimeout"&gt;setTimeout&lt;/a&gt;, and &lt;a href="https://ultimatecourses.com/blog/everything-you-wanted-to-know-about-javascript-scope"&gt;scoping&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;The correct answer to this is question is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Index: 4, element: undefined
Index: 4, element: undefined
Index: 4, element: undefined
Index: 4, element: undefined
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;If that’s not what you expected, then hopefully the rest of this article will help explain why this is the case in JavaScript.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why is this question so popular?
&lt;/h3&gt;

&lt;p&gt;A user on reddit &lt;a href="https://www.reddit.com/r/javascript/comments/7535tm/amazon_web_developer_loop_timeout_interview/"&gt;mentioned&lt;/a&gt; that they were asked this question in an Amazon developer interview. I’ve also been asked this type of closure + loop question in interviews myself — even in a Google interview.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;This question tests your knowledge of some important JavaScript concepts, and because of how the JavaScript language works this is actually something that can come up quite often when you’re working — namely, needing to use setTimeout or some sort of async function within a loop.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;A solid understanding of functional/block scope, anonymous functions, closures, and IIFE’s will definitely make you a better JavaScript developer and help you out in future interviews.&lt;/p&gt;

&lt;h3&gt;
  
  
  Solutions
&lt;/h3&gt;

&lt;p&gt;I've written about this particular type of challenge on &lt;a href="https://www.coderbyte.com/algorithm/3-common-javascript-closure-questions"&gt;Coderbyte&lt;/a&gt; and on &lt;a href="https://www.freecodecamp.org/news/3-questions-to-watch-out-for-in-a-javascript-interview-725012834ccb/"&gt;freeCodeCamp&lt;/a&gt; as well.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The reason for this is because the setTimeout function creates a function (the closure) that has access to its outer scope, which is the loop that contains the index i. After 3 seconds go by, the function is executed and it prints out the value of i, which at the end of the loop is at 4 because it cycles through 0, 1, 2, 3, 4 and the loop finally stops at 4. arr[4] does not exist, which is why you get undefined.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;There are two popular solutions to the question. One involves passing the needed parameters into the inner function, and the other solution makes use of ES6.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;arr&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;12&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;15&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;21&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="nx"&gt;arr&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c1"&gt;// pass in the variable i so that each function &lt;/span&gt;
  &lt;span class="c1"&gt;// has access to the correct index&lt;/span&gt;
  &lt;span class="nx"&gt;setTimeout&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;i_local&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;The index of this number is: &lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;i_local&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;}(&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="mi"&gt;3000&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;





&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;arr&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;12&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;15&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;21&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="nx"&gt;arr&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c1"&gt;// using the ES6 let syntax, it creates a new binding&lt;/span&gt;
  &lt;span class="c1"&gt;// every single time the function is called&lt;/span&gt;
  &lt;span class="c1"&gt;// read more here: http://exploringjs.com/es6/ch_variables.html#sec_let-const-loop-heads&lt;/span&gt;
  &lt;span class="nx"&gt;setTimeout&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;The index of this number is: &lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="mi"&gt;3000&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;A user on the reddit post provided a &lt;a href="https://www.reddit.com/r/javascript/comments/7535tm/amazon_web_developer_loop_timeout_interview/do3db9n/"&gt;similar answer&lt;/a&gt; to this question as well. There’s also a good &lt;a href="https://stackoverflow.com/questions/3572480/please-explain-the-use-of-javascript-closures-in-loops/3572616#3572616"&gt;explanation of closures&lt;/a&gt; by a user on Stack Overflow.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;This often confuse people who are new to JavaScript or functional programming. It is a result of misunderstanding what closures are. A closure does not merely pass the value of a variable or even a reference to the variable. A closure captures the variable itself!&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Thanks for reading! Check out &lt;a href="https://coderbyte.com"&gt;Coderbyte&lt;/a&gt; for some coding practice :)&lt;/p&gt;

&lt;p&gt;&lt;em&gt;This article originally appeared on &lt;a href="https://medium.com/coderbyte/a-tricky-javascript-interview-question-asked-by-google-and-amazon-48d212890703"&gt;Medium&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>career</category>
      <category>challenge</category>
      <category>codenewbie</category>
    </item>
  </channel>
</rss>
