PracHub
QuestionsPremiumLearningGuidesCheatsheetNEWCareers
|Home/Other / Miscellaneous/Citadel

Explain JS types, Promises, Maps, WebSockets

Last updated: Mar 29, 2026

Quick Overview

This question evaluates understanding of JavaScript language fundamentals (primitive vs reference types and boolean coercion), asynchronous programming and error propagation with Promises, differences among collection types (Object, Map, WeakMap) including key constraints and GC behavior, and WebSocket message ordering and reliability.

  • medium
  • Citadel
  • Other / Miscellaneous
  • Software Engineer

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: This question evaluates understanding of JavaScript language fundamentals (primitive vs reference types and boolean coercion), asynchronous programming and error propagation with Promises, differences among collection types (Object, Map, WeakMap) including key constraints and GC behavior, and WebSocket message ordering and reliability.

Citadel logo
Citadel
Jul 26, 2025, 12:00 AM
Software Engineer
Technical Screen
Other / Miscellaneous
5
0

JavaScript Types, Promises, Collections, and WebSocket Ordering

You are interviewing for a software engineering role. Answer the following about JavaScript runtime behavior, collections, and networking:

1) Data Types and Data Structures

  • List JavaScript primitive types vs reference types.
  • Name common built-in data structures used in practice.
  • Which values coerce to false in a boolean context?

2) Promises: Return Values and Error Propagation

  • What do then / catch / finally return?
  • What happens if an error is thrown in the Promise executor or in any handler (including inside an async function)?

3) Plain Objects vs Map

Compare by:

  • Key types allowed
  • Iteration order
  • Default/inherited properties and collision issues
  • Performance characteristics (adds/removes/lookups)
  • Typical use cases

4) WeakMap

  • What is it?
  • How do its key constraints and garbage-collection behavior differ from Map ?

5) WebSockets and Message Ordering

  • Does a single WebSocket connection guarantee in-order, reliable delivery?
  • When can ordering be affected (e.g., multiple connections, reconnections, server fan-out)?
  • How would you design for ordering and/or idempotency if required?

Solution

Show

Comments (0)

Sign in to leave a comment

Loading comments...

Browse More Questions

More Other / Miscellaneous•More Citadel•More Software Engineer•Citadel Software Engineer•Citadel Other / Miscellaneous•Software Engineer Other / Miscellaneous
PracHub

Master your tech interviews with 7,500+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • Careers
  • For Universities
  • Student Access

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.