Programming Fundamentals & Logic Flashcards
7 cards from real CPA practice questions. Tap to flip, then mark Knew It or Still Learning — missed cards come back until you master them.
Read the first 7 Programming Fundamentals & Logic flashcards as text
What is the index of the first element in a zero-indexed array with 8 elements?
Answer: 0
In zero-indexed arrays, the first element is always at index 0.
A programmer writes code that tests each input/output combination without examining internal structure. This is known as:
Answer: Black-box testing
Black-box testing evaluates software behavior based solely on inputs and expected outputs, ignoring internal implementation.
Which of the following correctly describes the concept of 'pseudocode'?
Answer: An informal high-level description of an algorithm using plain language
Pseudocode is an informal, language-agnostic description of an algorithm's logic using structured plain language.
What is the correct term for passing a copy of a variable's value to a function so that the original is unaffected?
Answer: Pass by value
Pass by value sends a copy of the argument, so any changes inside the function do not affect the original variable.
Which searching algorithm requires the data to be sorted before it can be applied?
Answer: Binary search
Binary search works by repeatedly halving the search space, which only works correctly on a sorted dataset.
What is the time complexity of accessing an element in an array by its index?
Answer: O(1)
Array index access is O(1) — constant time — because the memory address is calculated directly from the index.
In programming logic, which gate outputs TRUE when the inputs are DIFFERENT from each other?
Answer: XOR gate
The XOR (exclusive OR) gate outputs TRUE only when its two inputs have different values.