Which of the following is an example of data abstraction?
Loading test…
Loading test…
15 questions
Which of the following is an example of data abstraction?
A recursive procedure power(base, exp) computes base raised to the power exp using the rule: power(base, exp) = base * power(base, exp - 1), with the base case power(base, 0) = 1.
How many total calls to power (including the initial call) are made when computing power(3, 4)?
A digital audio file encodes sound by sampling the audio signal at regular intervals (e.g., 44,100 times per second) and storing each sample as a binary number. Which of the following changes would INCREASE the accuracy of the digital audio representation?
A researcher studying online misinformation downloads 10 million public tweets using Twitter's API and analyzes which types of false claims spread fastest. The tweets are publicly posted but the users did not know their data would be used for research.
Which of the following BEST represents the ethical tension in this scenario?
Which of the following problems has a REASONABLE (polynomial-time) algorithm, and which is considered to have only UNREASONABLE (exponential-time) algorithms for large inputs?
A program runs four tasks. Tasks A and B can run in parallel (no dependencies between them). Task C depends on the output of Task A. Task D depends on the outputs of both B and C.
Assuming unlimited parallel processors, what is the minimum time to complete all four tasks?
A company's website is attacked by a botnet — thousands of compromised computers simultaneously send requests to the website, overwhelming its server and making it unavailable to legitimate users.
This attack is called a:
A health app automatically logs a user's GPS location every 5 minutes throughout the day. Over a year, this produces a detailed record of everywhere the user went.
Which of the following BEST describes a privacy concern raised by this data collection practice?
A student is developing an app to help users log daily exercise. During testing, a user reports: "When I enter 0 minutes of exercise, the app crashes." The student had not considered zero as a valid input.
This situation illustrates which challenge in program development?
Two students are collaborating on a program. Student A writes the data-storage module and Student B writes the display module. They agree that the display module will call getData() to retrieve values, regardless of how Student A internally stores the data.
This agreement BEST demonstrates which concept?
A delivery company needs to find a route that visits 30 cities and returns home with the lowest total distance. An exact algorithm guaranteed to find the optimal route would take an impractically long time. Which approach is MOST appropriate?
Which of the following BEST describes the difference between a problem that has a reasonable algorithm and one that requires an unreasonable algorithm in the CSP framework?
A wireless network uses radio waves to transmit data from a laptop to a router. The router connects to the Internet via a fiber optic cable. At each step in this transmission, what is the fundamental representation of data?
A government proposes using AI-powered surveillance cameras throughout a city to automatically identify and track individuals by face in real time to reduce crime.
A civil liberties advocate argues this innovation has significant harmful effects. Which of the following BEST articulates the advocate's concern?
Two programmers are refactoring a 200-line program to reduce code duplication. Programmer A extracts every block of three or more repeated lines into its own procedure. Programmer B extracts only blocks that compute something conceptually meaningful. Which approach is MORE consistent with good procedural abstraction, and why?