PracHub
QuestionsPremiumCoachesLearningGuidesInterview Prep
|Home/Other / Miscellaneous/Citadel

Explain JS types, Promises, Maps, WebSockets

Last updated: Mar 29, 2026

Quick Overview

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.

  • 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: 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.

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

Explain JS types, Promises, Maps, WebSockets

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?

Constraints & Assumptions

  • Preserve the scope, facts, inputs, and requested outputs from the prompt above.
  • If the prompt leaves a detail unspecified, state a reasonable assumption before relying on it.
  • Keep the answer interview-ready: concise enough to present, but concrete enough to implement or evaluate.

Clarifying Questions to Ask

  • Clarify the goal, inputs, constraints, stakeholders, and success criteria.
  • State assumptions before using them.
  • Keep the answer grounded in the prompt rather than adding outside facts.

What a Strong Answer Covers

  • A structured framing of the problem and constraints.
  • A concrete approach with trade-offs and edge cases.
  • A way to validate the answer and communicate the recommendation.

Follow-up Questions

  • What assumption is most important to validate first?
  • What could make the answer fail in practice?
  • How would you explain the result to a non-technical stakeholder?

Solution

Show

Submit Your Answer to Earn 20XP

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 8,000+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • 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.