JavaScript coding challenges

225 challenges you can solve in JavaScript, from first loops to graphs, dynamic programming and machine learning. Write your code in the browser, run the tests instantly and get an AI review.

Easy · 134 Medium · 67 Hard · 24

Skills you'll practise: CountingDigit extractionString splitting2D listsArithmeticFormulasListsLoopsConditionsDivisibilityFloating pointGradient descent
  • Python · C++ · C#
  • Automated tests
  • AI code review
  • Community solutions
226
Challenges
123
Solutions shared
9
Languages

All challenges

Search by topic, language, or difficulty.

225 challenges
Medium

Layer Normalization

Normalize each row to zero mean and unit variance, then scale and shift it, as every Transformer block does.

You'll learn Layer normTransformers
Neural networksaimachine learning
No solutions yet
Easy

Second Largest Value

Find the second largest distinct value.

You'll learn Two trackersDistinct values
ArraysBeginnerStudent-beginner
No solutions yet
Easy

Sum of Multiples

Add values below a limit divisible by any supplied factor.

You'll learn LoopsDivisibility
BeginnerNumbers
No solutions yet
Easy

Derivatives of Activation Functions

Compute the derivative of sigmoid, ReLU, Leaky ReLU or tanh at each value, the slopes backpropagation needs.

You'll learn DerivativesBackpropagation
Neural networksaimachine learning
No solutions yet
Medium

Gradients of a Single Neuron

Use the chain rule to find how the loss changes with each weight and the bias of a sigmoid neuron.

You'll learn Chain ruleGradients
Neural networksaimachine learning
No solutions yet
Easy

Sum an Array

Add up all values in a list.

You'll learn AccumulatorsEmpty-list cases
ArraysBeginnerStudent-beginner
No solutions yet
Easy

Flatten a 2D Array

Combine the rows of a 2D integer array into one array.

You'll learn 2D arraysNested loops
ArraysLoops
No solutions yet
Easy

Longest Word

Find the longest word in a sentence.

You'll learn String splittingTracking a maximum
BeginnerStringsStudent-beginner
No solutions yet
Hard

Backpropagation in a Two-Layer Network

Compute every weight and bias gradient of a network with one sigmoid hidden layer and one sigmoid output.

You'll learn BackpropagationChain rule
Neural networksaimachine learning
No solutions yet
Easy

Replace Spaces With Dashes

Turn spaces into dashes to make a URL-style slug.

You'll learn String buildingCharacter replacement
BeginnerLearning-pathStrings
Easy

Initials From a Name

Build uppercase initials from a full name.

You'll learn String splittingUppercase
BeginnerLearning-pathStrings
Easy

Array Average

Compute the average of a list of numbers.

You'll learn Sum and countFloat division
ArraysBeginnerStudent-beginner
No solutions yet
Hard

Hotel Room Allocation

Assign arriving groups in order.

You'll learn Range maximum queriesPoint updates
Segment-treesSimulation
No solutions yet
Easy

Odd, Even, or Neither

Classify a number by whether it is an odd integer, an even integer, or neither.

You'll learn ModuloConditions
BeginnerNumbers
No solutions yet
Easy

Acronym Generator

Create an acronym from the first letter of every word, in uppercase.

You'll learn String parsingWord splitting
ParsingStrings
No solutions yet
Easy

Array Minimum

Find the smallest value in a list.

You'll learn Tracking a minimumSingle pass
ArraysBeginnerStudent-beginner
No solutions yet
Easy

Every Other Character

Keep the characters at even positions.

You'll learn String indexingSteps
BeginnerLearning-pathStrings
Easy

Above-Average Values

Keep the values that are greater than the average.

You'll learn Two passesFiltering
ArraysBeginnerLearning-path