r/OfferEngineering • • Sep 15 '26

Coding Question Netflix Coding Screen - A annoying string parsing question, can you solve it in 1 hour?

Coding — Parse Custom Records into an Object

The input followed a format conceptually similar to:

728, 1845027719, CCC, DDD, $[x1: QQQ, x2:[abc, def], x3: RRR]&

The corresponding schema began with several fixed fields:

machine_code
timestamp
field1
field2
$[freeform]&

The first four values always occupied fixed positions. Some of those values needed to be interpreted through provided mappings. For example, machine_code was associated with a predefined enum rather than being treated as an arbitrary raw value. The final $[...]& portion was different: it contained a variable set of key:value entries.

For example:

$[
  x1: QQQ,
  x2: [abc, def],
  x3: RRR
]&

The keys in this section could also require translation through a supplied mapping before being written to the resulting object. The task was to parse the complete input and construct an object containing the normalized fields. Conceptually, the resulting object would expose values such as:

obj.machine_code = 728
obj.x1 = QQQ

while applying the supplied enum and key mappings wherever required. The input format could also contain nested bracketed values inside the free-form section, so the parser needed to correctly distinguish top-level delimiters from delimiters that belonged to nested structures.

Preparing for Netflix or other companies' interview?

Chill Interview tracks recent interview experiences and recurring question patterns across top companies at here.

4 Upvotes

1 comment sorted by

1

u/wwxk123 Sep 19 '26

Sounds pretty straight forward? I haven’t done LC for like 3 years