FREE Coding Challenges and Practice Questions and Answers

0%

Write a function to reverse a string. What would the function reverseString("CodeSignal") return?

Correct! Wrong!

Reversing a string means the last character becomes the first, the second-to-last becomes the second, and so on. For "CodeSignal," reversing gives "langiSedoC."

Given an array of numbers from 1 to 5, but one number is missing. Which function call will find the missing number from [1, 2, 4, 5]?

Correct! Wrong!

The sum of the first 5 natural numbers is 1 + 2 + 3 + 4 + 5 = 15. The sum of the array is 1 + 2 + 4 + 5 = 12. The missing number is 15 - 12 = 3.

Which input for the function isPalindrome returns True?

Correct! Wrong!

A palindrome is a string that reads the same backward as forward. Among the options, only "level" satisfies this property.

How many vowels are in the string "CodeSignal"?

Correct! Wrong!

The vowels in the English language are a, e, i, o, u. In "CodeSignal," the vowels are o, e, i, which total 3.

Sum of Array Elements

Correct! Wrong!

The sum of the array [3, 5, 7, 2] is calculated as 3 + 5 + 7 + 2 = 17.