FastPrepSort Real Number Strings
Problems/Sort Real Number Strings

Sort Real Number Strings

Walmart logoWalmartFULLTIMEPHONE SCREEN

Updated Sep 2026

QuestionFunctionExamples

Problem statement

Source note: Reviewed on 2026-07-18. The original report is unavailable, so exact wording and numeric bounds cannot be verified. The judged core task matches the reported numeric-string sorting task at about 90%.

You are given a list of strings. Each string represents a real number and may be positive, negative, or contain a decimal point.

Sort the strings by their numeric values without converting the full string to an arithmetic numeric data type.

Return the sorted list of original strings. If two strings represent the same numeric value, keep their original relative order.

Function

sortRealNumberStrings(numbers: String[]) → String[]

Examples

Example 1

numbers = ["10","-3.5","2.01","0"]return = ["-3.5","0","2.01","10"]

The strings are ordered by numeric value: -3.5 < 0 < 2.01 < 10.

Example 2

numbers = ["-1.25","-1.2","3","0.5","12.01"]return = ["-1.25","-1.2","0.5","3","12.01"]

Among negative values, -1.25 is smaller than -1.2.

More Walmart Phone Screen questions

  • Count Months Starting on SundayPHONE SCREEN · Seen Aug 2026
  • Longest Even-Length WordPHONE SCREEN · Seen Aug 2026
  • Range ModulePHONE SCREEN · Seen Aug 2026
  • Meeting Rooms IIPHONE SCREEN · Seen Aug 2026
  • Check a Password Against a Supplied PolicyPHONE SCREEN · Seen Jun 2025
  • Convert a Restricted Function to an Arrow FunctionPHONE SCREEN · Seen Jun 2025
  • Repair One Missing Function Punctuation CharacterPHONE SCREEN · Seen Jun 2025
  • Can the Singer Perform the Song?PHONE SCREEN · Seen Mar 2025
  • Rooms With Two Other Entrances and a Treasure SuccessorPHONE SCREEN · Seen Mar 2025
  • First Dictionary Word from Note LettersPHONE SCREEN · Seen Aug 2022
All Walmart interview questionsSee Walmart hiring insights
Saved
class Solution {
    public String[] sortRealNumberStrings(String[] numbers) {
      // write your code here
    }
}
Checking account…