FastPrepRoot Mean Square Error
Problems/Root Mean Square Error

Root Mean Square Error

Waabi logoWaabi● EasyFULLTIMEPHONE SCREEN
QuestionFunctionExamplesConstraints

Problem statement

Source note: A Waabi software-engineer interview guide updated August 23, 2026 reports an RMSE coding problem over predicted and actual values with a single-scan solution. Six-decimal string formatting is an explicit portable judging adapter.

Given equal-length arrays of predicted and actual integer values, compute the root mean square error: the square root of the mean of the squared pairwise differences. Return the result rounded to exactly six digits after the decimal point.

Function

rootMeanSquareError(predicted: int[], actual: int[]) → String

Examples

Example 1

predicted = [1,2,3]actual = [1,2,3]return = "0.000000"

All differences are zero.

Example 2

predicted = [2,4]actual = [0,0]return = "3.162278"

The mean squared error is ten, whose square root is approximately 3.16227766.

Constraints

  • 1 <= predicted.length = actual.length <= 100000
  • |predicted[i]|, |actual[i]| <= 100000
See Waabi hiring insights
Saved
class Solution {
    public String rootMeanSquareError(int[] predicted, int[] actual) {
      // Write your code here.
    }

}
Checking account…