Objects & Immutability

Unflatten Object from Dot Paths

mediumJS SpecificJS / TS3 tests

Problem Statement

Implement `unflattenObject(obj)` that takes a single-level object with dot-separated key paths and reconstructs the corresponding nested object.

Examples

Example 1:
unflattenObject({ 'user.name': 'Bob', 'user.age': 30 });
// { user: { name: 'Bob', age: 30 } }
JavaScript & TypeScript starter code included
Run this as a live interview

Practice solo

3 test cases. No second person needed.

Get new interview exercises

Practice problems and review drills, sent when we publish new ones. No spam.

Unsubscribe anytime. We never share your address.