Sitonce
Country: US
Show exams for United States Hong Kong
Sign in

TExES Computer Science 8-12 241 Sample Questions and Answers

Updated 11 min read
Key takeaway

These original TExES Computer Science 8-12 (241) practice questions cover code tracing, algorithms, data representation, and networking.

  • Work each before reading the explanation, then map any error to the official framework.
  • They illustrate selected-response reasoning; they are not Pearson questions, a full mock exam, or a predictor of your scaled score.
On this page13 sections
  1. Question 1: trace a loop
  2. Question 2: choose a search strategy
  3. Question 3: convert an unsigned pattern
  4. Question 4: identify a network service
  5. Question 5: distinguish a runtime bound from an input case
  6. Question 6: short-circuit evaluation
  7. Question 7: choose a boundary test
  8. Question 8: recognize a data-structure operation
  9. Question 9: use a digital source responsibly
  10. Question 10: identify a recursive base case
  11. Review your reasoning, not just the letters
  12. How these questions relate to the official framework
  13. Make a larger practice routine

This page provides original selected-response practice for TExES Computer Science 8-12 (241). The questions are written for this article and are not copied from Pearson’s protected sample items. The official Pearson preparation manual remains the authoritative source for the current framework and official examples. Try the questions first, then read the reasoning for every option.

How to use this set

These five questions are a short practice set, not a full-length mock or a score predictor. Record your reasoning and map errors to a framework competency. Pearson cautions that performance on its sample questions should not be treated as a predictor of operational exam performance.

Question 1: trace a loop

Control flow

In Python, total starts at 0 and i starts at 1. While i <= 3, the program adds i to total and then increases i by 1. What is total when the loop ends?

  1. 3
  2. 5
  3. 6
  4. 7
Answer: C. The loop adds 1, then 2, then 3. The total is 6. After the last body execution, i becomes 4 and the condition is false. A total of 3 omits the final contribution; 7 incorrectly adds the exit value.

Trace initialization, condition, body, and update in order. The condition is checked before each pass. Keep the value of i used in the current pass separate from the value after its update. This is a Python-specific example; the syntax and exact division or loop semantics of another language should be checked against that language’s rules.

Question 2: choose a search strategy

Algorithm analysis

A program must look up one target in a small unsorted array that will not be reused. Which approach avoids adding an unnecessary preprocessing step?

  1. Sort the array, then use binary search
  2. Use a linear search through the array
  3. Use binary search without changing the array
  4. Build a search tree and rebalance it
Answer: B. A linear scan works on unsorted data and requires no separate sorting or indexing step. Sorting could be worthwhile for many repeated searches, but the prompt says this is one lookup and the array will not be reused. Binary search requires ordered data.

This question tests assumptions and task scope, not which search has the best asymptotic bound in isolation. For a single lookup, preprocessing can dominate. For repeated queries against stable data, the analysis might change. A good answer uses every detail in the stem rather than selecting the method that sounds fastest in a different setting.

Question 3: convert an unsigned pattern

Data representation

What decimal value does the eight-bit pattern 01011010 represent when interpreted as an unsigned binary integer?

  1. 82
  2. 88
  3. 90
  4. 92
Answer: C. The 1 bits correspond to 64, 16, 8, and 2. Their sum is 90. The result depends on the stated unsigned interpretation; the same bits could mean something else under another type or encoding.

Write the place values from right to left: 1, 2, 4, 8, 16, 32, 64, and 128. For 01011010, add the places containing a 1: 64 + 16 + 8 + 2 = 90. Do not decode a bit pattern until you know the base, width, signedness, and representation rule.

Question 4: identify a network service

Networks

A browser has a domain name for a site but needs associated address records. Which service helps resolve the name?

  1. DHCP
  2. DNS
  3. TCP
  4. HTTP
Answer: B. DNS provides a name-resolution system and returns records associated with a domain. DHCP can provide device network configuration. TCP provides transport service, and HTTP is an application protocol for web requests and responses.

The distractors are all network-related, but they answer different questions. DHCP helps configure a device; TCP handles transport; HTTP defines application-level web exchanges. DNS does not guarantee the server is reachable or that a requested page exists. A successful lookup is one stage in a larger request.

Question 5: distinguish a runtime bound from an input case

Algorithm analysis

A loop checks every element of a list exactly once. Which statement best describes its growth in the list length n?

  1. It is O(1) because the loop has one body
  2. It is O(log n) because the index changes
  3. It is O(n) because the number of visits grows with n
  4. It is O(n squared) because it uses iteration
Answer: C. One visit per element means the number of body executions grows linearly with n. A single loop is not automatically constant, logarithmic, or quadratic; count how the iterations scale with input size.

Big O is an asymptotic upper bound on growth. It is not an exact time measurement and does not by itself identify best or worst input cases. A worst-case analysis asks which permitted input causes the most work; an upper-bound notation describes how that work grows. Keep those distinctions separate when interpreting an algorithm question.

Question 6: short-circuit evaluation

Programming language semantics

In Python, what happens when denominator != 0 and numerator / denominator > 2 is evaluated with denominator equal to 0?

  1. The division runs and raises an error
  2. The division is skipped and the expression is false
  3. The expression is true because zero is not a denominator
  4. Python changes the denominator to 1
Answer: B. Python evaluates and from left to right and short-circuits when the first operand is false. The false left condition determines the overall Boolean result, so the division is not evaluated. This example is specific to Python’s logical operator semantics.

This question assesses both a Boolean operator and a safe guard pattern. Trace expression evaluation in language order. Do not evaluate the right side automatically just because it is visible in the code. A related language may use different symbols or distinguish short-circuit from non-short-circuit operators, so the language named in the stem matters.

Question 7: choose a boundary test

Software testing

A function should accept integer values from 1 through 20 inclusive. Which input is most useful for checking the upper boundary?

  1. 0
  2. 10
  3. 20
  4. 25
Answer: C. The value 20 is the highest valid value and checks that the inclusive endpoint is accepted. A separate test with 21 would check rejection immediately above the boundary. The prompt asks for the upper boundary itself, not a typical middle value.

A useful test set also checks 19, 21, and possibly non-integer or missing inputs if the function contract addresses them. Boundary-value testing targets places where a comparison may use < instead of <=, or where array indexes run one position too far. The expected behavior must come from the stated requirement, not from what a candidate assumes the programmer intended.

Question 8: recognize a data-structure operation

Abstract data types

A structure removes the most recently added item first. Which abstract data type matches this behavior?

  1. Queue
  2. Stack
  3. Binary search tree
  4. Graph
Answer: B. A stack follows last in, first out behavior: the most recently added item is removed first. A queue is commonly first in, first out. A tree and graph organize relationships differently and do not imply this removal rule by themselves.

Use a simple stack of paper slips as a model: place one slip on top of another and remove from the top. The last slip placed is the first available to remove. For a queue, people waiting in line are often modeled as first in, first out. These models help connect the abstract operation to a use case, but the data type’s interface defines its behavior.

Question 9: use a digital source responsibly

Digital information and ethics

A student wants to include an online image in a project. Which first step best supports lawful and ethical use?

  1. Assume any image on a public webpage is free to reuse
  2. Check the license or permissions and follow required attribution
  3. Remove the creator’s name so the project looks original
  4. Use the image because classroom work is never subject to copyright
Answer: B. The student should check the image’s license or permissions and follow the applicable terms, including attribution when required. Public availability does not automatically grant reuse rights, and educational use is not a universal exemption from copyright.

This scenario connects technology skills with the framework’s intellectual-property and ethical-use competencies. The exact rights and limitations depend on applicable law, license terms, and context, so a teacher should not promise that all classroom copying is exempt. A reliable study answer recognizes the need to check the rights attached to the specific material.

Question 10: identify a recursive base case

Recursion

A recursive function reduces a positive integer n by 1 on each call. What is needed to ensure the recursion stops?

  1. A base case that returns when n reaches a stopping value
  2. A global variable that increases forever
  3. A second recursive call on the same n
  4. A comment describing the intended result
Answer: A. A recursive algorithm needs a base case that terminates the chain of calls. If each call reduces n, a condition such as n equals 0 can stop the recursion, assuming the input is valid and the recursive step reaches that value.

When tracing recursion, keep each call’s parameter and local state separate. Follow the recursive step until the base case, then trace returns in reverse order. A function that calls itself without reaching a base case may continue until a resource limit or error. The precise behavior depends on the language, but the algorithmic need for a terminating condition is central.

Review your reasoning, not just the letters

For each item, write the assumption you used and identify the framework area. If you missed Question 1, practice pre-test loop conditions and final variable state. If you missed Question 2, review search preconditions and preprocessing cost. If you missed Question 3, work base conversion with explicit signedness and width. If you missed Question 4, make a contrast chart for DNS, DHCP, transport, and application protocols. If you missed Question 5, trace a few inputs and count iterations as a function of n.

A correct answer reached by guessing is not strong evidence of readiness. Explain why the distractors are wrong and create a new problem with changed values. If the same reasoning works on a different array, language, or network scenario under stated assumptions, understanding is more likely to transfer.

Review distractors as miniature lessons. A distractor may represent a specific misconception: confusing a queue with a stack, ignoring inclusive bounds, evaluating a short-circuited expression, or applying Big O to a single observed run. Write down which misconception it targets. Then create a fresh example where the correct answer changes. That is a practical way to turn answer review into learning rather than memorization.

How these questions relate to the official framework

The questions sample a small part of the official 241 competencies: conditional and iterative control flow, search algorithms, complexity analysis, number-base systems, and network concepts. The published exam framework is much broader, including software design and testing, object-oriented programming, digital responsibility, discrete math, forensics, robotics, and game or mobile development. A five-question exercise cannot represent the full syllabus.

Pearson’s official sample questions are available from the 241 preparation page with correct answers and rationales. Read those directly to see Pearson’s own examples. The sample materials illustrate formats and competencies, and Pearson says practice performance should not be used to predict the operational score. Use official rationales as feedback and continue studying the full framework.

Make a larger practice routine

A useful session can include a few items from different domains, a written explanation, and a short error review. Keep timing notes if pacing is a concern, but distinguish a timed third-party set from the official CAT. The 241 appointment is five hours total with 285 minutes of testing, but a short practice set cannot replicate its length or establish the same score scale.

Do not use these questions as a substitute for a full prep resource or claim that a specific practice percentage will pass. They are a free article exercise with original examples. Their purpose is to show how a candidate can reason through representative concepts and identify a next study action.

Common questions

Are these official Pearson questions?

No. The five items are original questions written for this article. Pearson’s official examples, answers, and rationales are linked from its preparation page.

Can I use this as a full mock exam?

No. This is a short five-question exercise and does not reproduce the full exam length or all four framework domains.

Does my score predict whether I will pass?

No. This short set is for diagnosis only and has no validated conversion to Pearson’s 240 scaled passing score.

Where can I find official sample items?

Pearson links the framework, sample questions, correct responses, and rationales from the official Computer Science 8-12 (241) preparation-materials page.