FastPrepHex Dump Formatter
Problems/Hex Dump Formatter

Hex Dump Formatter

Waymo logoWaymo● MediumFULLTIMEONSITE INTERVIEW

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: The interview report specifies row-based hexadecimal and ASCII output, including that 0x23 is printable and that other bytes show as a dot. It leaves out exact letter case, padding, the offset width, the row width, and the rule for empty input. Our version is about 72% the same as the reported question.

Given an array bytes of byte values and a positive row width bytesPerRow, return a formatted hexadecimal dump as an array of rows.

Each row has this exact structure:

  • an eight-character lowercase hexadecimal offset for the row's first byte;
  • two spaces;
  • bytesPerRow uppercase two-digit hexadecimal slots separated by one space, with missing slots in the final row filled by spaces;
  • two spaces;
  • an ASCII column surrounded by | characters.

In the ASCII column, byte values from 0x20 through 0x7E use their ASCII character. Every other byte uses .. Return an empty array when bytes is empty.

Function

formatHexDump(bytes: int[], bytesPerRow: int) → String[]

Examples

Example 1

bytes = [72,101,108,108,111,0,35,255]bytesPerRow = 4return = ["00000000  48 65 6C 6C  |Hell|","00000004  6F 00 23 FF  |o.#.|"]

The first row contains four printable bytes. In the second row, 0x00 and 0xFF become ., while 0x23 becomes #.

Example 2

bytes = [65,66,67]bytesPerRow = 4return = ["00000000  41 42 43     |ABC|"]

The final hexadecimal slot is blank, but the ASCII column contains only the three present bytes.

Constraints

  • 0 <= bytes.length <= 10^5
  • 0 <= bytes[i] <= 255
  • 1 <= bytesPerRow <= 32

More Waymo interview questions

  • Linked Perception HistoryONSITE INTERVIEW · Seen Sep 2026
  • Dictionary Matches from Repeated LettersONSITE INTERVIEW · Seen Sep 2026
  • Cyclic Fuel Command SimulationONSITE INTERVIEW · Seen Sep 2026
  • Shortest Travel Time in a Grid with Traffic LightsPHONE SCREEN · Seen Nov 2026
  • Fixed-Order Task Run Time With CooldownPHONE SCREEN · Seen Oct 2026
  • Reorderable Task Scheduler With CooldownPHONE SCREEN · Seen Oct 2026
  • Island Area and Water BoundaryPHONE SCREEN · Seen Sep 2026
  • Vehicle Maintenance Event ReadinessPHONE SCREEN · Seen Sep 2026
  • Obstacle-Aware Return to OriginPHONE SCREEN · Seen Sep 2026
  • Shortest Paths to Multiple TargetsPHONE SCREEN · Seen Sep 2026

Similar questions at other companies

  • Query Log MatchDatadog · PHONE SCREEN · ONSITE INTERVIEWDatadog interview questions
  • Digit-Coded Card ValidationCapital One · ONSITE INTERVIEWCapital One interview questions
  • Compress Editor Actions into Operational Transform OperationsReplit · OA · PHONE SCREEN · ONSITE INTERVIEW
  • Path Leaf Character IteratorGoogle · ONSITE INTERVIEWGoogle interview questions
  • Trace Events from Stable Whole-Stack StatesAnthropic · ONSITE INTERVIEWAnthropic interview questions
  • Cipher Cover Interval EditingDatabricks · ONSITE INTERVIEWDatabricks interview questions
  • Most Frequent Call Path in Interleaved LogsRoblox · ONSITE INTERVIEWRoblox interview questions
  • Parse Command-Line TokensSamsara · ONSITE INTERVIEWSamsara interview questions
  • Rich-Text Segment Normalization and Bold ToggleScale AI · ONSITE INTERVIEWScale AI interview questions
  • Deterministic Word Guess SolverAtlassian · ONSITE INTERVIEWAtlassian interview questions

Waymo interview experiences

  • Waymo New Grad MLE Phone Screen: Traffic Lights: 1 Experience
All Waymo interview questionsSee Waymo hiring insights
Saved
class Solution {
    public String[] formatHexDump(int[] bytes, int bytesPerRow) {
      // write your code here
    }
}
Checking account…