EasyπŸ‘€ 0-2 yearsπŸ‘€ 3-5 years 1 min read

JSON Data Types β€” Interview Questions

Asked inInfosysTCSAccentureWipro
#json#data types#string#number#boolean#null
Report issue

⚑ 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.

β˜•Coffee Chat Question

Concept Made Simple

β€œWhat data types does JSON support?”

🧠Mind Map Answer

Remember It Faster

Primitives→string, number, boolean, null
Structured→object {}, array []
No→date, undefined, function, comment
Strings→must use double quotes

⌨️Hands-on Keyboard

Learn by Doing

json
{
  "name": "Guru",
  "age": 30,
  "verified": true,
  "manager": null,
  "skills": ["Java", "AWS"],
  "joined": "2026-08-01T09:00:00Z"
}

πŸ”₯What If?

Think Beyond the Expected

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

  • 1Why send large numbers or money as strings?
  • 2How is null different from an absent key?
  • 3What happens to undefined during JSON.stringify?

🧩Related Technologies

ISO-8601IEEE-754 floatsJavaScriptJSON Schema

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?

Support our platform by exploring our recommended products.

As an Amazon affiliate, purchases through these links may earn us a small commission β€” at no extra cost to you. It helps keep Full Stack Interview Guru free.

Related Questions