NumPy view vs copy: how to tell which an operation returns, and why it matters for aliasing bugs
Role: Data Scientist
Category: Data Manipulation (SQL/Python)
Difficulty: medium
Interview Round: Other
Overview: Asks how NumPy views differ from copies, how to tell which one an operation returns, and why the difference causes aliasing bugs. Tests buffer sharing, slicing versus fancy indexing, the base attribute and np.shares_memory, and when to copy.