NES Computer Science (315)
NES Computer Science (315) is a trademark of its owner, which is not affiliated with and does not endorse Test Treasure Publication or TTP Prep.
NES Computer Science (315) is a trademark of its owner, which is not affiliated with and does not endorse Test Treasure Publication or TTP Prep.
10 sample questions for the NES Computer Science (315), with the correct answer and an explanation for each. No account needed. Try each one before you open the answer.
Sections covered on the exam: Computational Thinking and Data Analysis, Programming Concepts, Computing Systems, Networks, and the Internet, Impacts of Computing and Learning Environments.
Question 1 · Computational Thinking and Data Analysis
A teacher assigns a team to write a program for the school library that lets students search the catalog, check out and return books, and see any overdue fines.
Answer: B. Identify subproblems such as searching the catalog, recording a checkout, recording a return, and computing fines, each with defined inputs and outputs
Decomposition breaks a problem into meaningful subproblems that each do one job and communicate through clear inputs and outputs, so each can be built and tested separately and then combined. Splitting by programming construct is tempting because it divides the code evenly, but loops and conditionals are not independent tasks and none of the pieces could be tested alone.
Question 2 · Computational Thinking and Data Analysis
| Field | Value |
|---|---|
| File name | IMG_2041.jpg |
| Pixel dimensions | 4032 × 3024 |
| Date and time taken | Oct 14, 3:42 PM |
| GPS location | 40.7128° N, 74.0060° W |
| Device | Smartphone camera |
Answer: A. Remove the GPS location and other identifying metadata from each file before uploading
Metadata is data about the data; here the embedded GPS coordinates could reveal where a student lives, so it should be stripped before the files are made public. Renaming the files is tempting, but the file name does not hold the location, and the GPS fields remain inside the file after renaming, as they do after resizing or changing colors.
Question 3 · Programming Concepts
Answer: A. 1 2 3 4 6 9
The inner loop starts at the current i. For i = 1, j runs 1 to 3 and displays 1 2 3. For i = 2, j runs 2 to 3 and displays 4 6. For i = 3, j = 3 and displays 9. The full output is 1 2 3 4 6 9. The nine-number output would come from an inner loop that always starts at 1, which is a full multiplication table.
Question 4 · Programming Concepts
Two students make the same typo, misspelling a variable name on line 20 of their programs. Maria's Python program prints its first three lines of output and then stops with an error message at line 20. Dev's C++ program reports the error before any output appears, and no executable file is produced.
Answer: D. Python is typically interpreted and executes statements as it reaches them, while C++ is compiled in full before it can run
An interpreter translates and executes code statement by statement, so a misspelled name is detected only when execution reaches that line, after earlier output has already appeared. A compiler translates the entire program before producing an executable, so the C++ typo was reported before anything ran. The other options reverse the roles of compiler and interpreter or attribute a language-translation behavior to the editor.
Question 5 · Computing Systems, Networks, and the Internet
Answer: A. Worm
A worm is self-replicating malware that spreads across a network on its own, often by exploiting unpatched vulnerabilities, with no user action required. A virus also replicates but attaches to a host file or program and spreads when a user runs or opens it, which did not happen here; a trojan relies on a user installing disguised software, and ransomware would have encrypted files and demanded payment.
Question 6 · Computational Thinking and Data Analysis
A student decomposes a vending-machine program into four procedures: getSelection(), which returns the item code chosen; getPrice(code), which returns that item's price; collectPayment(price), which returns the amount inserted; and makeChange(paid, price), which returns the change owed.
Answer: B. The main program should call the procedures in order, passing each one the values it needs and using the values they return
Well-decomposed components communicate through parameters and return values, so a main program can coordinate them in sequence and each piece can be tested on its own with chosen inputs. Shared global variables are tempting because they avoid passing values, but they let any procedure change data unexpectedly and tie the pieces together so they cannot be tested independently.
Question 7 · Computational Thinking and Data Analysis
Answer: A. Collect only grade level and the study-habit responses, without names or ID numbers, and report results only as totals for each grade
Privacy-aware collection follows data minimization: gather only what the purpose requires, avoid identifiers when they are not needed, and share results in aggregate. Collecting extra identifiers "in case they are useful later" is a common mistake, because every unnecessary field adds risk if the data is exposed.
Question 8 · Programming Concepts
Answer: A. 7 numbers; the last is 20
k takes the values 2, 5, 8, 11, 14, 17, 20. The next value, 23, exceeds 20, so the loop stops after 7 numbers ending at 20. Dividing the span 18 by the step 3 gives 6, which forgets to count the starting value. The answer ending at 23 displays a value that is already past the bound.
Question 9 · Programming Concepts
A middle school class is building an app that shows current weather for their town. Instead of collecting weather data themselves, they use a public weather service's API, following its documentation.
Answer: B. It defines requests their program can send and returns weather data without exposing internals
An API specifies the requests a program may send and the form of the responses, such as current conditions as structured data, while hiding how the service works; this is abstraction. Direct database access is tempting because data does come back, but an API exposes only defined operations, not the underlying database. An API also does not hand over source code, and current weather requires calling the service each time rather than a one-time download.
Question 10 · Computing Systems, Networks, and the Internet
Answer: D. Disconnect the computer from the network at once and notify district IT to contain the attack
Ransomware is spreading to the shared drive, so isolating the infected machine stops further encryption, and IT can then contain the incident and restore from backups. Copying files first is tempting, but it leaves the infection running and may copy already-encrypted or infected files. A scan while still connected lets encryption continue, and restarting does not remove ransomware, which usually runs again at startup.
TTP Prep has 200 NES Computer Science (315) practice questions with explanations, timed and mock-exam modes, 346 flashcards, interactive lessons, a printable cheat sheet and a readiness score. Start free, no card needed.
More free questions: browse every exam.