Sharpen Your Skills with Coding Challenges
Practice programming problems, test your solutions, and learn from the reference answer. New challenges added regularly.
Reverse a String
Write a function that reverses a string without using the built-in reverse() method. For example, 'hello' should return 'olleh'.
Category: String Manipulation
FizzBuzz
Write a function that prints numbers 1 to n. For multiples of 3, print 'Fizz' instead. For multiples of 5, print 'Buzz'. For multiples of both, print 'FizzBuzz'.
Category: Algorithms
Palindrome Checker
Write a function that checks if a string is a palindrome (reads the same forwards and backwards). Ignore case and spaces.
Category: String Manipulation
Fibonacci Sequence
Write a function that returns the nth Fibonacci number. The sequence starts: 0, 1, 1, 2, 3, 5, 8, 13, 21...
Category: Algorithms
Reverse a String
Write a function that takes a string and returns it reversed. For example, 'hello' should return 'olleh'.
Category: String Manipulation
Find Duplicate Numbers
Write a function that takes a list of numbers and returns a list of all numbers that appear more than once. Each duplicate should appear only once in the result.
Category: Algorithms
Build a Calculator
Write a calculator function that takes two numbers and an operator (+, -, *, /) and returns the result. Handle division by zero.
Category: Utilities
Parse and Extract from JSON
Write a function that takes a JSON string representing a list of users (each with name and email) and returns an array of just the email addresses.
Category: Data Structures
Build an API Request Function
Write an async function that fetches user data from an API by ID, handles errors, and returns null if the user is not found or the request fails.
Category: Utilities