Objects & Immutability

Pick Keys from Object

easyJS SpecificJS / TS3 tests

Problem Statement

Implement `deepPick(obj, keys)` that returns a new object containing only the specified keys from the input object.

Examples

Example 1:
const user = { id: 1, name: 'Alice', email: '[email protected]', password: 'hash' };
deepPick(user, ['id', 'name']); // { id: 1, name: 'Alice' }
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.