Tag view

#objects

Cross-subject tag search for related interview cards.

Clear

Results update as you type. Press / to jump straight into search.

Tagged with objects

6 cards

Python Easy Theory

Mutable vs immutable objects

Mutable objects can change in place; immutable objects require a new object for a changed value.

  • List and dict are mutable
  • str and tuple are immutable
  • Matters for side effects and hashing

Mutable vs immutable objects

Python Medium Theory

Shallow copy vs deep copy

A shallow copy copies the outer container; a deep copy recursively copies nested objects too.

  • Shallow shares nested refs
  • Deep duplicates nested refs
  • copy and deepcopy from copy module

Shallow copy vs deep copy

JavaScript Medium Theory

Object.keys, Object.values, Object.entries, Object.assign, spread with objects, shallow copy vs deep copy, Object.freeze, and Object.seal

Object helpers are useful for inspection and copying, but most built-in copy patterns are still shallow.

  • `Object.assign` and spread are shallow
  • `freeze` and `seal` change mutability rules
  • Entries are useful for iteration

Object.keys, Object.values, Object.entries, Object.assign, spread with objects, shallow copy vs deep copy, Object.freeze, and Object.seal

JavaScript Hard Theory

Property descriptors, getters and setters, Object.create, hasOwnProperty, and the in operator

JavaScript objects support descriptor-level control, computed accessors, explicit prototype creation, and different ways to check for properties.

  • Descriptors control writability and enumerability
  • Getters and setters run code on access
  • `in` and `hasOwnProperty` answer different questions

Property descriptors, getters and setters, Object.create, hasOwnProperty, and the in operator