Skip to main content
CodeOath

Try it yourself

The editor your candidates get.

Same editor, same runner, same test cases. Nothing here is recorded: no camera, screen or microphone, and no account. Press Run Tests and see every test result the way a candidate does.

Sample question

FizzBuzz

Easy

Return a list with one entry for every integer from 1 to n, in order. Each entry is a string:

  • "Fizz" when the number divides evenly by 3
  • "Buzz" when it divides evenly by 5
  • "FizzBuzz" when it divides evenly by both
  • the number written as text in every other case
Example 1
Input
n = 5
Output
["1", "2", "Fizz", "4", "Buzz"]
Explanation

3 is a multiple of 3 and 5 is a multiple of 5. Nothing else in the range is.

Example 2
Input
n = 15
Output
["1", "2", "Fizz", "4", "Buzz", "Fizz", "7", "8", "Fizz", "Buzz", "11", "Fizz", "13", "14", "FizzBuzz"]
Explanation

15 is a multiple of both 3 and 5, so the last entry is "FizzBuzz".

Constraints:

  • 1 <= n <= 10^4

Tab indents. Press Esc, then Tab to leave the editor.

Run your code to see every test here. Nothing is submitted or recorded.

Next step

Send this to a real candidate.

In an assessment the same runner scores every test automatically, with camera and screen evidence kept separate from the score.