Computer Science Quiz

Questions: 16 · 10 minutes
1. A program must repeatedly search a sorted list of one million distinct numbers. Which approach most efficiently uses the fact that the list is sorted?
Check each number from the beginning until a match is found
Compare with the middle number and repeatedly discard half of the remaining list
Randomly sample positions until the number appears
Sort the list again before every search
2. What most clearly distinguishes a traditional compiler from an interpreter?
A compiler can process numbers, while an interpreter can process only text
A compiler finds every logical error automatically
A compiler is used only for operating systems
A compiler typically translates source code into a target form before execution
3. A print server must process jobs in the same order they arrive. Which data structure best fits this requirement?
A stack, removing the most recently added job first
A set, selecting any stored job next
A tree, always removing the job with the longest name
A queue, removing the earliest added job first
4. A program scans every element of a large array in order and runs faster than another version that accesses the same elements in a scattered pattern. What best explains the difference?
Sequential access changes the array's declared data type
Sequential access usually benefits from spatial locality in the cache
Scattered access forces the processor to use recursion
Scattered access automatically increases algorithmic complexity to O(n²)
5. A website needs to store user passwords responsibly. Which method is most appropriate?
Store a unique salted cryptographic hash for each password
Encrypt every password with the same key stored beside the database
Encode passwords with Base64 before saving them
Store password hints instead of the passwords themselves
6. A model is trained on thousands of emails already labeled “spam” or “not spam.” What type of machine learning is this?
Dimensionality reduction without labels
Unsupervised learning
Reinforcement learning
Supervised learning
7. You need only the customers who have at least one matching order in another SQL table. Which join is the standard choice?
CROSS JOIN
LEFT JOIN
INNER JOIN
FULL OUTER JOIN
8. A recursive function keeps calling itself until the program exhausts its call stack. What is the most likely design problem?
It uses local variables instead of global variables
Its return type is too small
It lacks a reachable base case that stops the recursion
It was written using a high-level language
9. In an unweighted graph, which algorithm finds a path with the fewest edges from a starting vertex to every reachable vertex?
Breadth-first search
Binary search
Depth-first search
Selection sort
10. Which HTTP status code conventionally indicates that the requested resource was not found?
404
301
403
200
11. According to De Morgan's law, which expression is equivalent to NOT (A AND B)?
(NOT A) AND (NOT B)
A OR B
(NOT A) OR (NOT B)
A AND (NOT B)
12. A computer runs a program whose active memory needs exceed the available physical RAM. Which operating-system feature can temporarily use secondary storage to support its address space?
Process scheduling
File compression
Device polling
Virtual memory
13. An algorithm runs one complete loop over n items inside another complete loop over those n items. What is its typical time complexity?
Logarithmic time, O(log n)
Quadratic time, O(n²)
Linear time, O(n)
Exponential time, O(2ⁿ)
14. A live voice application prioritizes low delay and can tolerate an occasional lost packet. Which transport protocol is generally the better fit?
TCP, because it waits to deliver every packet in order
UDP, because it avoids connection and retransmission overhead
HTTP, because it defines request and response messages for web resources
DNS, because it translates domain names into network addresses
15. A database repeats a customer's address in every order row, creating inconsistent copies when the customer moves. Which design practice directly helps reduce this problem?
Caching the most recent order rows
Indexing every text column in the order table
Normalization that separates customer data from order data
Combining all related records into one larger field
16. Two processes each hold one resource while waiting indefinitely for the resource held by the other. Which condition is illustrated most directly?
Circular wait in a deadlock
Memory fragmentation
Preemptive scheduling
A cache miss
Popular tests
Narcissistic Personality Inventory (NPI)
This self-report measure is used to assess narcissism as a personality trai…
Start Test
Yale-Brown Obsessive Compulsive Scale (Y-BOCS)
This measure is used to rapidly quantify the current severity of obsessive…
Start Test
CRAFFT Screening Test (CRAFFT 2.1)
This brief screening measure is designed to identify potential alcohol and…
Start Test
Patient Health Questionnaire-9 (PHQ-9)
This measure is commonly used to quickly screen for the presence and severi…
Start Test
Maslach Burnout Inventory (MBI)
This self-report measure is used to assess occupational burnout symptoms in…
Start Test
Adolescent Anxiety Questionnaire
This measure is designed to support a brief appraisal of anxiety symptoms a…
Start Test
Emotional Creativity Inventory (ECI)
This self-report measure assesses individual differences in the originality…
Start Test
Horne–Ostberg Morningness–Eveningness Questionnaire (MEQ)
Circadian preferences influence typical patterns of alertness and sleep tim…
Start Test
Ambivalent Sexism Inventory (ASI)
This measure is designed to assess attitudes toward women, including both o…
Start Test
Internalized Misogyny Scale (IMS)
This measure is designed to assess internalized negative beliefs and stereo…
Start Test
Perceived Stress Scale (PSS-10)
This self-report measure assesses the degree to which individuals appraise…
Start Test
Impulsive Behavior Scale (SUPPS-P)
Impulsivity is a multidimensional construct that is often assessed with bri…
Start Test
Clinical Institute Withdrawal Assessment for Alcohol, Revised (CIWA-Ar)
This rating scale is used to rapidly assess the severity of alcohol withdra…
Start Test
Positive and Negative Affect Schedule (PANAS)
This measure provides a brief self-report assessment of current or typical…
Start Test
Light Triad Scale (LTS)
This self-report measure assesses prosocial personality tendencies and orie…
Start Test
Suicidal Ideation Scale
In clinical settings, the Suicidal Ideation Scale is used to structure an i…
Start Test
Body Dysmorphic Disorder Scale (BDD-D)
This brief self-report measure is designed to screen for and quantify distr…
Start Test
Beck Anxiety Inventory (BAI)
This measure is a brief self-report inventory used to screen for anxiety sy…
Start Test
Differential Test of Perfectionism
This instrument is used to screen for perfectionism-related attitudes and t…
Start Test
Locus of Control Scale
This measure assesses generalized expectancies regarding the degree to whic…
Start Test
New Apathy Scale
This brief self-report measure is used to screen for apathy-related symptom…
Start Test
Perth Alexithymia Questionnaire (PAQ)
This measure assesses individual differences in alexithymia, including diff…
Start Test
Social Intelligence Scale
This brief self-report measure is designed to support rapid screening of in…
Start Test
Fear Test
This measure is designed to evaluate individual differences in fear-related…
Start Test
Neuroticism Level Scale
The measure is intended for brief screening of an individual’s propensity t…
Start Test
Aggressiveness Indicators Screening Questionnaire
This screening tool is designed to quickly identify behavioral indicators a…
Start Test