Kit Library / Computer Science / Data Interchange Formats

⚡ Topic Learning Kit

Create a flash card for json

English 31 leveled MCQs 17 flashcards Free

Shared by a Veda learner · Generated with Veda AI

Veda Bites

The whole idea, one bite at a time

Veda Bites are swipeable micro-lessons — each one teaches exactly one idea. The bites below come from this kit — swipe through them in the app.

💡 Key Idea

JSON Is a Lightweight Data Format

The backbone of data exchange.

JSON (JavaScript Object Notation) is a text-based format for structuring data. It is language-independent, human-readable, and widely used for APIs and configuration files. A JSON document is built from key-value pairs, arrays, and nested objects.

↳ JSON is a universal, minimal syntax for representing structured data.

📖 Definition

What Is a JSON Object?

Curly braces hold the data.

A JSON object is an unordered collection of key-value pairs enclosed in curly braces `{}`. Each key is a string, followed by a colon, then the value. Pairs are separated by commas.

↳ Objects group related data using named keys.

📖 Definition

What Is a JSON Array?

Ordered lists in square brackets.

A JSON array is an ordered list of values enclosed in square brackets `[]`. Values can be of any type, including objects or other arrays. Items are separated by commas.

↳ Arrays store ordered collections of values.

⭐ Important Fact

JSON Data Types

Six types, no more.

JSON supports exactly six data types: string, number, boolean, null, object, and array. There are no dates, functions, or undefined values.

↳ JSON's type system is intentionally small and universal.

⚠️ Common Mistake

Trailing Commas Are Invalid

No comma after the last item.

↳ Always omit commas after the last element in objects and arrays.

⚠️ Common Mistake

Keys Must Be Double-Quoted

Single quotes won't work.

In JSON, all object keys must be enclosed in double quotes (`"`). Single quotes or unquoted keys (common in JavaScript) are not valid JSON.

↳ Always wrap keys in double quotes to produce valid JSON.

✏️ Example

A Flash Card in JSON

Putting it all together.

↳ A flash card is naturally represented as a JSON object with question, answer, and metadata.

✅ Best Practice

Use Consistent Indentation

Readability matters for humans.

While JSON parsers ignore whitespace, consistent indentation (2 or 4 spaces) makes the structure clear for developers. This is especially important when editing or debugging flash card data.

↳ Format JSON with indentation to improve human readability.

🛠️ Application

JSON for Flash Card Decks

Store entire decks as arrays.

A flash card deck is typically a JSON array of objects. Each object represents one card. This structure is easy to parse, transmit, and store in files or databases.

↳ Arrays of objects are the standard way to represent collections of flash cards.

🧠 Memory Trick

Remember: Objects Are Like Dictionaries

Key-value pairs, just like a dictionary.

Think of a JSON object as a dictionary: you look up a word (key) and get its definition (value). Arrays are like a numbered list.

↳ Associate objects with dictionaries and arrays with lists for quick recall.

🎯 Exam Tip

Validate JSON with Online Tools

Catch errors before they bite.

Before using a JSON file, run it through a JSON validator (e.g., jsonlint.com). This catches missing commas, unquoted keys, and trailing commas instantly.

↳ Always validate JSON to avoid silent parsing failures.

❓ Did You Know

JSON Is Everywhere

From APIs to config files.

JSON is the most common format for REST APIs, configuration files (e.g., `package.json`), and data storage. Its simplicity has made it the default choice for web and mobile apps.

↳ JSON's ubiquity means mastering it is essential for modern development.

⚖️ Comparison

JSON vs. XML for Flash Cards

Which is lighter?

↳ JSON is generally simpler and faster than XML for data interchange.

🔄 Workflow

Creating a Flash Card JSON File

From idea to file in 4 steps.

↳ Follow a simple four-step workflow to create any flash card JSON file.

🌍 Real World

Flash Card Apps Use JSON

Anki, Quizlet, and more.

Popular flash card apps like Anki and Quizlet use JSON (or JSON-like formats) to import/export decks. This allows users to share and backup their study materials easily.

↳ JSON is the practical standard for portable flash card data.

💡 Key Idea

Nested Structures for Complex Cards

Cards can have sub-objects.

A flash card can contain nested objects for richer data, such as `"metadata": {"created": "2024-01-01", "tags": ["math"]}`. This keeps related information organized.

↳ Nesting objects inside cards allows for extensible and organized flash card data.

Smart notes

What you'll study, topic by topic

1

JSON Syntax and Structure for Flash Cards

8 min

JSON (JavaScript Object Notation) is a lightweight, text-based format for structuring data, built from key-value pairs, arrays, and nested objects. It supports six data types and is widely used for APIs, configuration fi…

  • JSON uses objects `{}` for key-value pairs and arrays `[]` for ordered lists.
  • All keys must be double-quoted strings.
  • Trailing commas are invalid and cause parse errors.

Full explanation, worked examples & memory tricks in the app

Leveled MCQ practice

Try the smart MCQs from this kit

All 31 questions, laddered from warm-up to topper-level, each with its answer and the reasoning behind it.

Warm-up · 23 questions

Q1. Which of the following is the correct JSON syntax for a key-value pair?

Beginner
A key = value
B key: value
C "key": value
D "key" = "value"

Answers and explanations are in the Veda app.

Q2. What data type is the JSON value `true`?

Beginner
A Boolean
B String
C Object
D Number

Answers and explanations are in the Veda app.

Q3. Which of the following is a valid JSON array?

Beginner
A ["apple", "banana", "cherry"]
B <"apple", "banana", "cherry">
C ("apple", "banana", "cherry")
D {"apple", "banana", "cherry"}

Answers and explanations are in the Veda app.

Q4. What is the correct JSON representation of a number?

Beginner
A forty-two
B 42
C '42'
D "42"

Answers and explanations are in the Veda app.

Q5. Which of the following JSON objects is syntactically correct?

Beginner
A {"name": "Alice", "age": 30
B {"name": "Alice", "age": 30}
C {"name": "Alice", "age": 30,}
D {name: "Alice", age: 30}

Answers and explanations are in the Veda app.

Q6. What is the JSON value for null?

Beginner
A undefined
B "null"
C null
D None

Answers and explanations are in the Veda app.

Q7. Which of the following is NOT a valid JSON value type?

Beginner
A Array
B Function
C String
D Object

Answers and explanations are in the Veda app.

Q8. How are strings enclosed in JSON?

Beginner
A Double quotes
B Single quotes
C No quotes
D Backticks

Answers and explanations are in the Veda app.

Q9. What does the following JSON represent? `{"items": [1, 2, 3]}`

Beginner
A An array of objects
B An object with a key "items" whose value is an array of numbers
C An object with a key "items" whose value is a string
D An array containing an object

Answers and explanations are in the Veda app.

Q10. Which of the following is a valid JSON string?

Beginner
A "Hello World'
B 'Hello World'
C Hello World
D "Hello World"

Answers and explanations are in the Veda app.

Q11. What is the correct JSON syntax for an empty object?

Beginner
A "{}"
B null
C []
D {}

Answers and explanations are in the Veda app.

Q12. Which of the following is a valid JSON number?

Beginner
A "3.14"
B 3.14.0
C 3.14
D 3,14

Answers and explanations are in the Veda app.

Q13. What is the correct JSON representation of a boolean value?

Beginner
A true
B TRUE
C "true"
D True

Answers and explanations are in the Veda app.

Q14. In JSON, keys can be unquoted if they contain only letters.

Beginner
A True
B False

Answers and explanations are in the Veda app.

Q15. A JSON array can contain a mix of different data types, such as strings, numbers, and objects.

Beginner
A True
B False

Answers and explanations are in the Veda app.

Q16. The JSON value `"null"` is the same as the JSON value `null`.

Beginner
A True
B False

Answers and explanations are in the Veda app.

Q17. Whitespace (spaces, tabs, newlines) is allowed in JSON to improve readability.

Beginner
A True
B False

Answers and explanations are in the Veda app.

Q18. A JSON object must have at least one key-value pair.

Beginner
A True
B False

Answers and explanations are in the Veda app.

Q19. Which of the following is the correct JSON syntax for a key-value pair where the key is "name" and the value is "Alice"?

Beginner
A `"name": "Alice"`
B `"name": Alice`
C `name: Alice`
D `name: "Alice"`

Answers and explanations are in the Veda app.

Q20. What is the correct JSON representation of an empty array?

Beginner
A `null`
B `[""]`
C `{}`
D `[]`

Answers and explanations are in the Veda app.

Q21. Which of the following is a valid JSON object with one key-value pair?

Beginner
A `{score: 95}`
B `{"score": 95,}`
C `{"score": 95}`
D `{"score": 95`

Answers and explanations are in the Veda app.

Q22. What is the correct JSON syntax for a string value?

Beginner
A `Hello`
B `Hello` (without quotes)
C `'Hello'`
D `"Hello"`

Answers and explanations are in the Veda app.

Q23. Which of the following JSON snippets contains a trailing comma that makes it invalid?

Beginner
A `{"a": 1}`
B `{"a": 1, "b": 2,}`
C `{"a": 1, "b": 2}`
D `[1, 2, 3]`

Answers and explanations are in the Veda app.

Building up · 5 questions

Q24. Consider the following JSON snippet: ```json { "flashcards": [ {"front": "What is JSON?", "back": "A data format"}, {"front": "What is a key?", "back": "A string identifier"}, ] } ``` Why is this JSON invalid?

Intermediate
A The array `"flashcards"` contains objects with different key names.
B The strings inside the objects use double quotes, which is not allowed.
C There is a trailing comma after the last object in the array.
D The key `"flashcards"` must be enclosed in single quotes.

Answers and explanations are in the Veda app.

Q25. Given the requirement to store a flash card with a mathematical expression as the "front" and its LaTeX representation as the "back", which of the following JSON objects correctly represents this data?

Intermediate
A ```json {"front": $E = mc^2$, "back": "E = mc^2"} ```
B ```json {"front": "$E = mc^2$", "back": "The equation $E = mc^2$ represents mass-energy equivalence."} ```
C ```json {"front": "E = mc^2", "back": "$E = mc^2$"} ```
D ```json {"front": "E = mc^2", "back": "$$E = mc^2$$"} ```

Answers and explanations are in the Veda app.

Q26. A developer creates a JSON structure for a set of flash cards where each card has a "tags" field that can contain multiple tags. Which of the following JSON snippets correctly represents a card with the tags "math", "physics", and "relativity"?

Intermediate
A ```json {"question": "What is E=mc^2?", "tags": ("math", "physics", "relativity")} ```
B ```json {"question": "What is E=mc^2?", "tags": [math, physics, relativity]} ```
C ```json {"question": "What is E=mc^2?", "tags": ["math", "physics", "relativity"]} ```
D ```json {"question": "What is E=mc^2?", "tags": "math, physics, relativity"} ```

Answers and explanations are in the Veda app.

Q27. Compare the following two JSON structures for storing a flash card with nested metadata: Structure 1: ```json { "card": { "front": "Define JSON", "back": "JavaScript Object Notation", "metadata": {"difficulty": "easy", "created": "2023-01-01"} } } ``` Structure 2: ```json { "card": { "front": "Define JSON", "back": "JavaScript Object Notation", "metadata": {"difficulty": "easy", "created": "2023-01-01",} } } ``` Which statement is correct?

Intermediate
A Structure 1 is valid; Structure 2 is invalid due to a trailing comma in the nested `"metadata"` object.
B Structure 2 is valid because trailing commas are allowed in nested objects.
C Neither structure is valid because the `"card"` key must be a string without quotes.
D Both structures are valid JSON because nested objects are allowed.

Answers and explanations are in the Veda app.

Q28. A flash card application stores cards in a JSON array. Which of the following JSON arrays is syntactically correct and contains exactly three cards, each with a "front" and "back"?

Intermediate
A ```json [ {"front": "Q1", "back": "A1"}, {"front": "Q2", "back": "A2"} {"front": "Q3", "back": "A3"} ] ```
B ```json [ {"front": "Q1", "back": "A1"}, {"front": "Q2", "back": "A2"}, {"front": "Q3", "back": "A3"}, ] ```
C ```json [ {"front": "Q1", "back": "A1"} {"front": "Q2", "back": "A2"} {"front": "Q3", "back": "A3"} ] ```
D ```json [ {"front": "Q1", "back": "A1"}, {"front": "Q2", "back": "A2"}, {"front": "Q3", "back": "A3"} ] ```

Answers and explanations are in the Veda app.

Topper level · 3 questions

Q29. A flash card application imports a JSON file containing an array of cards. The file has the following structure: ```json [ { "front": "What is the capital of France?", "back": "Paris" }, { "front": "What is the square root of 16?", "back": "4" }, { "front": "What is the boiling point of water?", "back": "100°C" } ] ``` A developer notices that the third card's "back" value contains the degree symbol (°). The JSON parser throws an error. Which of the following is the most likely cause?

Advanced
A The array contains three objects, but JSON arrays can only hold up to two objects.
B The degree symbol is a reserved character in JSON and must be escaped with a backslash.
C The JSON file is not encoded in UTF-8, causing the degree symbol to be misinterpreted.
D The degree symbol is not a valid UTF-8 character, so it must be escaped as `\u00b0`.

Answers and explanations are in the Veda app.

Q30. A developer needs to store a flash card with a mathematical formula that includes a fraction. The front of the card is: "Solve for x: $\frac{3x + 2}{5} = 7$". The developer writes the following JSON: ```json { "front": "Solve for x: $\frac{3x + 2}{5} = 7$", "back": "x = 11" } ``` When parsed, this JSON is invalid. Which of the following corrections will make the JSON valid while preserving the LaTeX expression exactly as intended?

Advanced
A Remove the dollar signs: `\frac{3x + 2}{5} = 7`.
B Enclose the entire string in single quotes instead of double quotes.
C Replace the backslashes with forward slashes: `$\frac{3x + 2}{5} = 7$` becomes `$/frac{3x + 2}{5} = 7$`.
D Escape each backslash with an additional backslash: `$\\frac{3x + 2}{5} = 7$`.

Answers and explanations are in the Veda app.

Q31. A flash card dataset is stored in a JSON file with the following structure: ```json { "deck": "Advanced Math", "cards": [ { "front": "What is the integral of $e^x$?", "back": "$e^x + C$" }, { "front": "What is the limit of $1/x$ as $x \\to \\infty$?", "back": "0" } ] } ``` A developer claims that this JSON is invalid because the second card's "front" contains a LaTeX expression with escaped backslashes (`\\to` and `\\infty`). Which of the following statements is correct?

Advanced
A The developer is incorrect; the JSON is valid because the double backslashes correctly represent literal backslashes in the LaTeX expression.
B The developer is correct; the JSON is invalid because the second card's "front" contains a space after the comma in `$x \\to \\infty$`, which is not allowed.
C The developer is incorrect; the JSON is valid only if the entire file is encoded in ASCII, but the presence of `$` symbols makes it invalid.
D The developer is correct; the double backslashes are not valid in JSON strings and must be single backslashes.

Answers and explanations are in the Veda app.

Flashcards

Tap a card to flip it

17 flashcards in this kit — the app reviews them with spaced repetition so the right card returns on the right day.

Study it properly — free, in the app

The full Veda Bites deck, complete notes, spaced-repetition flashcards, leveled MCQs, tests and games for this kit — plus Daily Facts and the Arena, every day.