InterviewStack.io LogoInterviewStack.io

Basic Data Structures (Objects, Maps, Sets) Questions

Understand how objects work in JavaScript including prototypal inheritance and property descriptors. Know when to use Maps vs Objects and Sets vs Arrays. Understand the performance characteristics of different data structures. Be comfortable with nested data structures and how to manipulate them efficiently.

HardTechnical
0 practiced
Implement a JavaScript class StructuralMap that works like Map but allows arrays or plain objects as keys by using structural (deep) equality for key comparison rather than reference equality. Provide an implementation approach using canonicalization or hashing, address collision handling, cycles, and discuss performance trade-offs.
HardTechnical
0 practiced
Design and sketch an implementation of a thread/process-safe LRU cache for Node.js that works across multiple worker processes (cluster or worker_threads). Explain coordination options, eviction consistency, and alternatives such as a centralized Redis-backed LRU, CRDT-based approaches, or per-process caches with eventual consistency.
HardSystem Design
0 practiced
Design a lifecycle management strategy for JavaScript wrapper objects that own native GPU memory (e.g., tensors). Show how WeakRef and FinalizationRegistry could be used to release native buffers when JS wrappers are GC'd, discuss race conditions, and propose explicit APIs to ensure timely release without relying solely on garbage collection.
EasyTechnical
0 practiced
Implement in JavaScript a function isOwn(obj, key) that returns true if key is an object's own property (not inherited). The function should correctly handle string and Symbol keys and avoid throwing when obj is null or undefined.
MediumTechnical
0 practiced
Design an API for accessing nested model hyperparameters stored as a JavaScript object with these requirements: immutable external API, path-based get/set with type validation, and efficient copying for small diffs. Outline data structures and provide a minimal get/set pseudocode sketch showing structural sharing.

Unlock Full Question Bank

Get access to hundreds of Basic Data Structures (Objects, Maps, Sets) interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.