Explain JS types, Promises, Maps, WebSockets
Company: Citadel
Role: Software Engineer
Category: Other / Miscellaneous
Difficulty: medium
Interview Round: Technical Screen
Discuss JavaScript data types and common data structures. Which values coerce to false in a boolean context? For Promises, what do then/catch/finally handlers return, and what happens to the returned Promise if an error is thrown in the executor or in any handler (including within an async function)? Compare plain objects and Map in terms of key types, iteration order, default properties, performance, and typical use cases. What is a WeakMap, and how do its key constraints and garbage-collection behavior differ from Map? For WebSockets, explain whether a single connection guarantees in-order, reliable delivery of messages, when ordering might be affected (e.g., multiple connections, reconnections, server fan-out), and how you would design for ordering/idempotency if required.
Quick Answer: Explain JS types, Promises, Maps, WebSockets evaluates requirements, assumptions, structured reasoning, trade-offs, and verification in a realistic interview setting. A strong answer states assumptions, handles edge cases, explains trade-offs, and shows how to validate the result clearly.