JSON Data Types — Interview Questions
Reviewed by Gurusankar M.
Short Answer
JSON supports six value types: string (double-quoted), number, boolean (true/false), null, object ({}), and array ([]). It has no date, integer-vs-float distinction, undefined, function, or comment types — dates are usually sent as ISO-8601 strings and big/precise numbers as strings.
On this page
Concept Made Simple
Coffee Chat Question
“What data types does JSON support?”
Remember It Faster
Mind Map Answer
- Primitives
- string, number, boolean, null
- Structured
- object {}, array []
- No
- date, undefined, function, comment
- Strings
- must use double quotes
Learn by Doing
Hands-on Keyboard
{
"name": "Guru",
"age": 30,
"verified": true,
"manager": null,
"skills": ["Java", "AWS"],
"joined": "2026-08-01T09:00:00Z"
}Think Beyond the Expected
What If?
How do you represent a date, since JSON has no date type?
Use a string, almost always ISO-8601 ("2026-08-01T09:00:00Z"), and parse it on each side (new Date(str) in JS, java.time.Instant in Java). Some teams send a Unix epoch number instead. There's no native date, so both parties must agree on the string/number convention.
Real World
The 'JSON has no date' fact bites everyone eventually — you JSON.stringify a Date and it becomes an ISO string, then forget to parse it back and end up comparing a string to a Date. Money and IDs are often sent as strings to avoid float precision loss.
Interviewer's Expectation
Keywords they're listening for:
- string/number/boolean/null
- object & array
- no date/undefined/function
- double-quoted strings
- dates as ISO strings
Common Mistakes
- Expecting a native date type
- Using single quotes for strings
- Assuming numbers keep exact precision (float issues)
Best Practices
- Send dates as ISO-8601 strings
- Send money/large IDs as strings to avoid float errors
- Distinguish null (known-empty) from a missing key
Follow-up Questions
- Why send large numbers or money as strings?
- How is null different from an absent key?
- What happens to undefined during JSON.stringify?
Continue Learning with AI
Take this question deeper with your favourite AI assistant. Pick a depth, copy the prompt, or open it directly — AI is your learning companion, not a shortcut.
Plain-language foundations
I'm preparing for a software engineering interview and want to understand this from scratch, as a beginner. Topic: Syntax (JSON) Interview question: "What data types does JSON support?" Please: 1. Explain the core idea in simple, plain language, using an everyday analogy. 2. Define any technical terms you use. 3. Walk through one small, concrete example. 4. Finish with a single sentence I can easily remember. Keep the tone friendly and assume I'm new to this topic.
Was this answer helpful?
Affiliate links
Tools for Your Developer Workspace
Equipment for a comfortable, productive setup.
As an Amazon Associate I earn from qualifying purchases.
- MonitorView on Amazon : BenQ EW2790U 27-inch Monitor (opens in a new tab)
BenQ EW2790U 27-inch Monitor
- LaptopView on Amazon : Acer Aspire One Laptop (opens in a new tab)
Acer Aspire One Laptop
- Office ChairView on Amazon : Wakefit Gravita Ergonomic Office Chair (opens in a new tab)
Wakefit Gravita Ergonomic Office Chair