How can you programmatically check if a NumPy array is a view or a copy, for example with .base or __array_interface__?
Role: Data Scientist
Category: Data Manipulation (SQL/Python)
Difficulty: medium
Interview Round: Other
Overview: Asks how to tell in code whether a NumPy array is a view or a copy, using attributes such as .base, ownership flags and the array interface data pointer. Tests whether you know what each check proves and which NumPy operations share memory with their input.