{
  "title": "Advanced Computer Science O/X",
  "description": "Data structures, algorithms, and systems",
  "languageCode": "en",
  "cards": [
    {
      "type": "ox",
      "prompt": "Binary search finds a value in a sorted array in O(log n) time.",
      "answer": true,
      "explanation": "Binary search halves the search range each step, giving O(log n) time."
    },
    {
      "type": "ox",
      "prompt": "A stack is a Last-In-First-Out (LIFO) data structure.",
      "answer": true,
      "explanation": "In a stack, the most recently added element is removed first (LIFO)."
    },
    {
      "type": "ox",
      "prompt": "A queue is a First-In-First-Out (FIFO) data structure.",
      "answer": true,
      "explanation": "In a queue, the first element added is the first removed (FIFO)."
    },
    {
      "type": "ox",
      "prompt": "Computers internally store and process data in base-10 (decimal).",
      "answer": false,
      "explanation": "Computers store and process data in binary (base-2), using 0s and 1s."
    },
    {
      "type": "ox",
      "prompt": "One byte consists of 8 bits.",
      "answer": true,
      "explanation": "A byte is made up of 8 bits."
    },
    {
      "type": "ox",
      "prompt": "A compiler translates source code into machine code before the program runs.",
      "answer": true,
      "explanation": "A compiler translates the whole program into machine code ahead of execution, unlike an interpreter."
    },
    {
      "type": "ox",
      "prompt": "In most programming languages, array indices start at 1.",
      "answer": false,
      "explanation": "In many languages (C, Java, Python) array indices start at 0, not 1."
    },
    {
      "type": "ox",
      "prompt": "A hash table can offer average-case O(1) time for insertion and lookup.",
      "answer": true,
      "explanation": "With good hashing and collision handling, hash tables average O(1) operations."
    },
    {
      "type": "choice",
      "prompt": "Which time complexity grows fastest as input size n becomes large?",
      "choices": [
        "O(n²)",
        "O(n)",
        "O(log n)",
        "O(1)"
      ],
      "answer": 1,
      "explanation": "O(n²) grows faster than O(n), O(log n), or constant time as n increases."
    },
    {
      "type": "choice",
      "prompt": "Which data structure is best suited for Last-In-First-Out behavior?",
      "choices": [
        "Stack",
        "Queue",
        "Array",
        "Graph"
      ],
      "answer": 1,
      "explanation": "A stack provides LIFO behavior; a queue is FIFO."
    },
    {
      "type": "text",
      "prompt": "What is the decimal value of the binary number 1010? (digits only)",
      "answers": [
        "10",
        "ten"
      ],
      "explanation": "1010 in binary equals 8 + 0 + 2 + 0 = 10 in decimal."
    },
    {
      "type": "text",
      "prompt": "What do we call a flaw or error in a computer program, the removal of which is called debugging?",
      "answers": [
        "bug",
        "a bug",
        "software bug"
      ],
      "explanation": "A bug is an error in a program; fixing bugs is called debugging."
    },
    {
      "type": "ox",
      "prompt": "Merge sort has a worst-case time complexity of O(n log n).",
      "answer": true,
      "explanation": "Merge sort always divides the array in half and merges in linear time, giving O(n log n) even in the worst case."
    },
    {
      "type": "ox",
      "prompt": "Quicksort's worst-case time complexity is O(n log n).",
      "answer": false,
      "explanation": "Quicksort averages O(n log n), but with consistently bad pivots (e.g. an already sorted array) it degrades to O(n²)."
    },
    {
      "type": "choice",
      "prompt": "Which tree traversal visits the root before its left and right subtrees?",
      "choices": [
        "In-order",
        "Pre-order",
        "Post-order",
        "Level-order"
      ],
      "answer": 2,
      "explanation": "Pre-order traversal visits root, then left subtree, then right subtree; in-order visits the root between the subtrees."
    },
    {
      "type": "ox",
      "prompt": "A balanced binary search tree supports search, insertion, and deletion in O(log n) time.",
      "answer": true,
      "explanation": "Balanced BSTs like AVL or red-black trees keep their height at O(log n), so core operations run in O(log n)."
    },
    {
      "type": "ox",
      "prompt": "DNS translates IP addresses into MAC addresses.",
      "answer": false,
      "explanation": "DNS resolves human-readable domain names into IP addresses; mapping IPs to MAC addresses is done by ARP."
    },
    {
      "type": "text",
      "prompt": "What is the hexadecimal number FF in decimal? (digits only)",
      "answers": [
        "255",
        "two hundred fifty-five",
        "two hundred and fifty-five"
      ],
      "explanation": "FF in hexadecimal is 15×16 + 15 = 255, the largest value of an unsigned 8-bit byte."
    },
    {
      "type": "ox",
      "prompt": "TCP provides reliable, ordered delivery of data, while UDP does not guarantee delivery.",
      "answer": true,
      "explanation": "TCP uses acknowledgments and retransmission for reliable, in-order delivery; UDP is faster but offers no such guarantees."
    },
    {
      "type": "ox",
      "prompt": "RAM retains its contents even after the computer is powered off.",
      "answer": false,
      "explanation": "RAM is volatile memory that loses its contents when power is cut; non-volatile storage like SSDs or ROM keeps data."
    },
    {
      "type": "choice",
      "prompt": "In the OSI model, which layer is responsible for routing packets between networks?",
      "choices": [
        "Physical layer",
        "Transport layer",
        "Network layer",
        "Application layer"
      ],
      "answer": 3,
      "explanation": "The network layer (layer 3) handles logical addressing and routing of packets across networks; IP operates at this layer."
    },
    {
      "type": "ox",
      "prompt": "A deadlock can occur when processes each hold a resource while waiting for a resource held by another.",
      "answer": true,
      "explanation": "Deadlock arises from circular waiting: each process holds something another needs, so none can proceed."
    },
    {
      "type": "ox",
      "prompt": "In Big-O notation, O(1) means an algorithm performs exactly one operation.",
      "answer": false,
      "explanation": "O(1) means constant time — the number of operations does not grow with input size, not that only one operation occurs."
    },
    {
      "type": "text",
      "prompt": "What does the abbreviation CPU stand for? (three words)",
      "answers": [
        "central processing unit",
        "the central processing unit"
      ],
      "explanation": "The Central Processing Unit executes instructions and is often called the 'brain' of the computer."
    },
    {
      "type": "ox",
      "prompt": "A linked list allows O(1) insertion at its head, unlike inserting at the front of an array.",
      "answer": true,
      "explanation": "Inserting at a linked list's head only rewires pointers (O(1)); an array must shift every element, costing O(n)."
    },
    {
      "type": "ox",
      "prompt": "Plain HTTP encrypts data in transit by default.",
      "answer": false,
      "explanation": "HTTP sends data in plaintext; HTTPS adds TLS encryption to protect data between browser and server."
    },
    {
      "type": "choice",
      "prompt": "Which data structure does breadth-first search (BFS) typically use to track the next nodes to visit?",
      "choices": [
        "Stack",
        "Heap",
        "Tree",
        "Queue"
      ],
      "answer": 4,
      "explanation": "BFS explores level by level using a queue; depth-first search uses a stack or recursion instead."
    },
    {
      "type": "ox",
      "prompt": "A connected graph with no cycles is called a tree.",
      "answer": true,
      "explanation": "By definition, a tree is a connected acyclic graph; with n vertices it always has exactly n−1 edges."
    },
    {
      "type": "ox",
      "prompt": "An operating system's kernel runs in user mode.",
      "answer": false,
      "explanation": "The kernel runs in privileged kernel mode with full hardware access; applications run in restricted user mode."
    },
    {
      "type": "text",
      "prompt": "What is the name of the smallest unit of digital information, representing a 0 or a 1?",
      "answers": [
        "bit",
        "a bit",
        "binary digit"
      ],
      "explanation": "A bit (binary digit) is the smallest unit of information; eight bits make one byte."
    },
    {
      "type": "ox",
      "prompt": "Two's complement is the standard way modern computers represent signed integers.",
      "answer": true,
      "explanation": "Two's complement lets the same addition circuitry handle positive and negative numbers, so it is the universal choice."
    },
    {
      "type": "ox",
      "prompt": "Recursion always uses less memory than an equivalent iterative solution.",
      "answer": false,
      "explanation": "Recursion usually uses more memory because each call adds a stack frame; deep recursion can even overflow the call stack."
    },
    {
      "type": "choice",
      "prompt": "What does SQL stand for?",
      "choices": [
        "Structured Query Language",
        "Standard Query Logic",
        "Sequential Question Language",
        "System Quality Language"
      ],
      "answer": 1,
      "explanation": "SQL, Structured Query Language, is the standard language for querying and managing relational databases."
    },
    {
      "type": "ox",
      "prompt": "In a relational database, a primary key uniquely identifies each row in a table.",
      "answer": true,
      "explanation": "A primary key is a column (or set of columns) whose values are unique and non-null, identifying each row exactly once."
    },
    {
      "type": "ox",
      "prompt": "Moore's law states that processor clock speed doubles every year.",
      "answer": false,
      "explanation": "Moore's law is the observation that the number of transistors on a chip doubles roughly every two years — it is about transistor density, not clock speed."
    },
    {
      "type": "text",
      "prompt": "What acronym names the non-volatile memory that stores firmware and keeps its contents without power?",
      "answers": [
        "rom",
        "read only memory",
        "read-only memory"
      ],
      "explanation": "ROM (Read-Only Memory) is non-volatile and traditionally holds firmware such as a computer's boot code."
    }
  ]
}
