Interview preparation

Coding practice

Write JavaScript, run it in your browser and watch every test pass or fail. If something breaks, we explain why it happened and what to study next.

0/23 solved

Arrays, strings, hash maps and stacks, the basics of every coding round.

EasyArraysLoops

Sum of an array

Return the sum of all numbers in the array. An empty array should return 0.

Examples

  • sumArray([1,2,3]) → 6
  • sumArray([]) → 0
JavaScript

Tip: press Ctrl or Cmd + Enter to run. Your code is saved in this browser.

Test results

Press “Run tests” to check your solution.

Your badges

Every coding task you solve earns a badge. Finish a whole track to unlock a certificate. Sign in to collect them and see them on your profile.

0 of 23 task badges collected

Software Development

</>SOFTWARESum of an arrayEASYHIRE DAILY
</>SOFTWAREReverse astringEASYHIRE DAILY
</>SOFTWAREPalindromecheckEASYHIRE DAILY
</>SOFTWAREFizzBuzzEASYHIRE DAILY
</>SOFTWAREValid anagramMEDIUMHIRE DAILY
</>SOFTWARETwo SumMEDIUMHIRE DAILY
</>SOFTWAREValidparenthesesMEDIUMHIRE DAILY
</>SOFTWAREMaximumsubarray sumHARDHIRE DAILY
</>SOFTWARELongestsubstringwithout repeatsHARDHIRE DAILY

Data Analyst

DATA ANALYSTAverage ofnumbersEASYHIRE DAILY
DATA ANALYSTCount bycategoryEASYHIRE DAILY
DATA ANALYSTRemoveduplicatesEASYHIRE DAILY
DATA ANALYSTTop N by salesMEDIUMHIRE DAILY
DATA ANALYSTGroup and sumMEDIUMHIRE DAILY
DATA ANALYSTMedianMEDIUMHIRE DAILY
DATA ANALYSTPercentagechangeHARDHIRE DAILY
DATA ANALYSTMoving averageHARDHIRE DAILY

Cyber Security

CYBER SECURITYStrong passwordcheckEASYHIRE DAILY
CYBER SECURITYCaesar cipherdecoderEASYHIRE DAILY
CYBER SECURITYMask an emailMEDIUMHIRE DAILY
CYBER SECURITYDetect bruteforceMEDIUMHIRE DAILY
CYBER SECURITYSpot SQLinjectionMEDIUMHIRE DAILY
CYBER SECURITYValidate anIPv4 addressHARDHIRE DAILY

Milestones

First solve

Solve any problem

On a roll

Solve 5 problems

Double digits

Solve 10 problems

Easy sweep

Solve every Easy problem

Software Development master

Solve every Software Development problem

Data Analyst master

Solve every Data Analyst problem

Cyber Security master

Solve every Cyber Security problem

Common JavaScript errors, in plain language

Most beginners meet the same four errors again and again. Knowing what each one means makes debugging much faster in interviews and on the job.

SyntaxError

JavaScript could not read your code. This usually means a missing or extra bracket, quote, comma or parenthesis.

Quick fix: Check that every ( { [ has a matching ) } ].

ReferenceError

You used something that does not exist in this scope. Common causes are a typo, a missing let/const, or using a variable outside the block where it was created.

Quick fix: Declare variables with let or const before using them.

TypeError

An operation was used on the wrong type of value. For example calling .map on something that is not an array, or reading a property of undefined.

Quick fix: Print the value with console.log to see what it really is.

RangeError

A function kept calling itself and never stopped, so JavaScript ran out of memory for calls (stack overflow).

Quick fix: Add a base case: a condition that returns without calling the function again.