KaseyaRole: Senior Software Development EngineerSeptember 2026
Interview question
What does this JavaScript print, and why?
```javascript
const a = {
value: 10,
nested: {
x: 1
}
};
const b = { ...a };
b.value = 20;
b.nested.x = 100;
console.log(a.value);
console.log(a.nested.x);
```
Follow-up questions
- What is the difference between a shallow copy and a deep copy?
- What built-in JavaScript facilities can make a deep copy?
- How would your proposed serialization approach handle an object containing dates and functions?