💻 Coding Practice Test — 6th Grade
20 questions from 11 coding articles. Take it online for an instant score, or print it with the answer key.
Coding test — 6th Grade
What do you do at each step of binary search?
What does a compiler do?
What is a game engine?
What does an interpreter do?
What does JavaScript do on websites?
What is a library in programming?
What is machine code made of?
What is open source?
What is a parameter?
What does return do?
When does a runtime error show up?
At most, how many guesses do you need for a number from 1 to 100?
Who developed one of the first compilers?
What is the advantage of a game engine?
Which language is usually run by an interpreter?
Who created JavaScript?
How do you add a library in Python?
Why don’t people write in machine code?
Which of these is open source?
If def square(n): return n * n, what does square(4) give?
Name: ____________________ Date: ____________
What do you do at each step of binary search?
- A. Shuffle the list
- B. Check the middle and throw away half
- C. Guess at random
- D. Check from the beginning one by one
What does a compiler do?
- A. Connects to the internet
- B. Deletes bugs by itself
- C. Draws on the screen
- D. Translates all the code into machine code ahead of time
What is a game engine?
- A. Software that provides ready-made drawing, sound and physics
- B. A kind of joystick
- C. The engine of a car
- D. A professional gamer
What does an interpreter do?
- A. Draws sprites
- B. Deletes programs
- C. Translates everything ahead of time into a file
- D. Runs code line by line as it goes
What does JavaScript do on websites?
- A. It makes the page respond and change
- B. It builds the computer
- C. It replaces the HTML
- D. It only decides the colors
What is a library in programming?
- A. A kind of loop
- B. A list of bugs
- C. A collection of ready-made functions
- D. A room full of books
What is machine code made of?
- A. Pictures
- B. 0s and 1s
- C. English words
- D. Colorful blocks
What is open source?
- A. A file left open on the screen
- B. Code with no computer password
- C. Software that got hacked
- D. Software whose code anyone can see
What is a parameter?
- A. An error
- B. The function’s answer
- C. The name of a loop
- D. Information that goes into a function
What does return do?
- A. Gives an answer back from the function
- B. Goes back to the start of the computer
- C. Prints to the screen
- D. Deletes a variable
When does a runtime error show up?
- A. Only in Scratch
- B. Never
- C. Before you write any code
- D. While the program is running
At most, how many guesses do you need for a number from 1 to 100?
- A. 3
- B. 100
- C. 7
- D. 50
Who developed one of the first compilers?
- A. Marie Curie
- B. Grace Hopper
- C. Ada Lovelace
- D. Amelia Earhart
What is the advantage of a game engine?
- A. There is no advantage
- B. It invents the game for you
- C. It deletes bugs by itself
- D. You don’t have to write the shared parts from scratch
Which language is usually run by an interpreter?
- A. English
- B. HTML
- C. Sign language
- D. Python
Who created JavaScript?
- A. Brendan Eich
- B. Guido van Rossum
- C. Grace Hopper
- D. Tim Berners-Lee
How do you add a library in Python?
- A. return
- B. print
- C. def
- D. import
Why don’t people write in machine code?
- A. It’s very hard to read and write
- B. It’s against the law
- C. It’s in English
- D. It’s very slow
Which of these is open source?
- A. A company’s name
- B. An account password
- C. Every paid program
- D. Python
If def square(n): return n * n, what does square(4) give?
- A. 44
- B. 8
- C. 16
- D. 4
Answer key
- B. Check the middle and throw away half
- D. Translates all the code into machine code ahead of time
- A. Software that provides ready-made drawing, sound and physics
- D. Runs code line by line as it goes
- A. It makes the page respond and change
- C. A collection of ready-made functions
- B. 0s and 1s
- D. Software whose code anyone can see
- D. Information that goes into a function
- A. Gives an answer back from the function
- D. While the program is running
- C. 7
- B. Grace Hopper
- D. You don’t have to write the shared parts from scratch
- D. Python
- A. Brendan Eich
- D. import
- A. It’s very hard to read and write
- D. Python
- C. 16
Answer key
Show the answers and explanations
- B. Check the middle and throw away half — The range is cut in half each step. (Binary Search)
- D. Translates all the code into machine code ahead of time — Like a translator for a whole book. (Compiler)
- A. Software that provides ready-made drawing, sound and physics — Creators can focus on the game itself. (Game Engine)
- D. Runs code line by line as it goes — Like a live translator. (Interpreter)
- A. It makes the page respond and change — Buttons, games and search boxes — all JavaScript. (First Steps in JavaScript)
- C. A collection of ready-made functions — Other people wrote and tested them. (Library)
- B. 0s and 1s — The computer runs it directly. (Machine Code)
- D. Software whose code anyone can see — You may learn from and improve it, following the license. (Open Source)
- D. Information that goes into a function — It gets filled fresh on every call. (Parameter)
- A. Gives an answer back from the function — You can store the answer in a variable. (Return Value)
- D. While the program is running — The code is written correctly, but something goes wrong partway through. (Runtime Error)
- C. 7 — 2 to the 7th power is 128, which is more than 100. (Binary Search)
- B. Grace Hopper — In the early 1950s. (Compiler)
- D. You don’t have to write the shared parts from scratch — Drawing, sound and collisions come ready. (Game Engine)
- D. Python — JavaScript too. (Interpreter)
- A. Brendan Eich — He wrote it in 1995. (First Steps in JavaScript)
- D. import — For example, import random. (Library)
- A. It’s very hard to read and write — It’s easy to make mistakes in long strings. (Machine Code)
- D. Python — Volunteers around the world improve it. (Open Source)
- C. 16 — 4 times 4. (Parameter)
Study before the test
What is on this coding test?
20 multiple-choice questions taken from 11 coding articles written for 6th grade readers.
Can I print it?
Yes. Use the print button: the test and the answer key come out on separate pages, no sign-up needed.