Printable quiz

Coding Basics Quiz for Beginners Quiz with answers

12 coding questions ready to print. The questions come first and the answers are on their own page, so you can hand out the quiz and keep the answers to yourself. Prefer to play on screen? Play Coding Basics Quiz for Beginners online and see how you compare with other players.

Questions

Coding Basics Quiz for Beginners · 12 questions · Circle one answer per question unless it says otherwise.

Name / team:Score: ____ / 12
  1. What does HTML stand for?
    • AHyperText Markup Language
    • BHighText Machine Language
    • CHyperlink and Text Markup Language
    • DHome Tool Markup Language
  2. Which language is mainly used to style the look of web pages?
    • AHTML
    • BCSS
    • CPython
    • DSQL
  3. In JavaScript, which keyword declares a variable that cannot be reassigned?
    • Avar
    • Blet
    • Cconst
    • Dstatic
  4. What does SQL stand for?
    • AStructured Query Language
    • BSimple Query Logic
    • CSequential Question Language
    • DServer Query Layer
  5. Which data structure follows the First In, First Out (FIFO) rule?
    • AStack
    • BQueue
    • CTree
    • DGraph
  6. In Python, what does len("hello") return?
    • A4
    • B5
    • C6
    • DAn error
  7. Which symbol starts a single-line comment in Python?
    • A//
    • B#
    • C--
    • D/*
  8. What is the decimal number 5 written in binary?
    • A101
    • B110
    • C111
    • D100
  9. Which Git command makes a local copy of a remote repository?
    • Agit push
    • Bgit clone
    • Cgit commit
    • Dgit merge
  10. What is the time complexity of binary search on a sorted array?
    • AO(n)
    • BO(log n)
    • CO(n²)
    • DO(1)
  11. Which HTTP status code means the requested page was not found?
    • A200
    • B301
    • C404
    • D500
  12. In JavaScript, what does typeof null return?
    • A"null"
    • B"object"
    • C"undefined"
    • D"number"
Advertisement slot

Answers

Coding Basics Quiz for Beginners · answer sheet

  1. A: HyperText Markup Language

    HTML, HyperText Markup Language, describes the structure and content of a web page using tags.

  2. B: CSS

    CSS, or Cascading Style Sheets, controls how a web page looks: colours, fonts, spacing and layout.

  3. C: const

    A variable declared with const cannot be reassigned. Use let when the value needs to change.

  4. A: Structured Query Language

    SQL, Structured Query Language, is used to read and change data in relational databases.

  5. B: Queue

    A queue works like a line at a shop: the first item added is the first one removed. A stack is the opposite (last in, first out).

  6. B: 5

    len() counts characters, and "hello" has five of them.

  7. B: #

    In Python, everything after a # on a line is a comment and is ignored when the code runs.

  8. A: 101

    In binary, 101 means one 4, no 2s and one 1, which adds up to 5.

  9. B: git clone

    git clone downloads a full copy of a remote repository, including its history, to your computer.

  10. B: O(log n)

    Binary search halves the search range at every step, so the work grows logarithmically, written O(log n).

  11. C: 404

    404 Not Found means the server is reachable but has nothing at that address.

  12. B: "object"

    typeof null returns "object" because of a bug in the very first version of JavaScript that was kept to avoid breaking old websites.

Tips for running this quiz

  • For a pub quiz or party, print one question sheet per team and read the questions out loud.
  • In class, use "Print questions only" and project the answers afterwards to go through them together.
  • Want a winner without the marking? Send everyone the online version and compare scores at the end.

More printable quizzes →