Implement deepClone(value)
structuredClone exists natively now, but interviewers still ask for this, the point is testing whether you understand recursion over nested reference types, not whether you know the built-in exists.
Write deepClone(value) that returns a deep copy of a value made of plain objects, arrays, and primitives, mutating the clone must never affect the original, at any nesting depth.
const original = { nested: { count: 1 } };
const clone = deepClone(original);
clone.nested.count = 999;
original.nested.count; // still 1Bonus (not tested here, but worth thinking about): how would you handle a value that contains a circular reference to itself?