← Back to companies
[ OK ] Loaded —
[ INFO ]
$ cd
$ ls -lt
01
02
03
04
05
$ ls -lt
01
02
03
04
05
user@intervues:~/$
Given a (possibly deeply) nested JSON object, write a function that returns a flat dictionary whose keys are the dot-separated paths to every leaf value in the original structure. If the input is not a dictionary at the top level, treat it as if it were wrapped in one. Arrays must also be flattened: use the index as the next path component. The function must be deterministic and must not mutate the original data. You may assume that all keys are non-empty strings and that all values are JSON primitives (str, int, float, bool, None), dicts, or lists.