Problem, as an interviewer would state it:
"Implement Object.assign-equivalent behavior from scratch — merging one or more source objects into a target, matching real native Object.assign's own documented contract, including which object reference it actually returns."
Examples:
Object.assign({a: 1}, {b: 2}, {a: 3, c: 4}); // {a: 3, b: 2, c: 4}
Clarifying questions expected:
- When multiple sources define the same key, does the LAST source genuinely win, matching a real, predictable left-to-right merge order?
- Does the target object get MUTATED in place, or is a genuinely new object returned?
- Should enumerable Symbol-keyed properties on a source be copied too, not just string keys?
Code / implementation expected: Yes — real, direct proof of correct left-to-right merge-and-overwrite order, that the SAME target reference is mutated and returned, and that enumerable Symbol-keyed properties are correctly copied too.