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.

MediumTechnical
0 practiced
Explain differences and performance implications among Object.keys, Object.getOwnPropertyNames, Object.getOwnPropertyDescriptors, for...in loops, and Reflect.ownKeys when enumerating or copying properties, including Symbol and non-enumerable properties. Recommend a safe enumeration strategy for reading configuration objects.
EasyTechnical
0 practiced
Describe the differences between JavaScript Set and Array. Explain membership test performance, how to use Set for deduplication while preserving order, how to convert between them, and trade-offs when choosing an Array vs a Set in token pipelines.
MediumTechnical
0 practiced
Describe how to implement a cached computed property on a JavaScript object using a getter (property descriptor) such that the expensive computation runs on first access, the result is cached for subsequent accesses, but the property remains writable or invalidatable if needed. Discuss concurrency and async pitfalls.
HardTechnical
0 practiced
Implement serialize(obj) and deserialize(s) in JavaScript to convert nested structures containing Map, Set, Symbol keys, and typical primitives into a JSON-friendly string and back. Include an encoding scheme for Map/Set and for non-string keys, mention how you would handle circular references, and discuss limitations.
EasyTechnical
0 practiced
How do you iterate over all of an object's own property keys, including non-enumerable properties and Symbol keys, in JavaScript? Provide code examples and explain differences between Object.keys, Object.getOwnPropertyNames, Object.getOwnPropertySymbols, and Reflect.ownKeys.

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.