Praxis Computer Science (5652) — Questions and Answers
Question 1: Which statement about pseudocode is accurate?
- It is a binary format read by the CPU
- It only works for object-oriented designs
- It must compile without errors before use
- It describes an algorithm in plain, structured language without strict syntax rules (Correct answer)
Correct answer: It describes an algorithm in plain, structured language without strict syntax rules
Pseudocode is an informal, human-readable outline of an algorithm not tied to any language's syntax.
Question 2: In garbage-collected languages, which practice most reduces GC pause impact in a hot code path?
- Disabling the just-in-time compiler
- Minimizing short-lived object allocations, such as by reusing buffers (Correct answer)
- Calling the garbage collector manually after every operation
- Allocating larger objects more frequently
Correct answer: Minimizing short-lived object allocations, such as by reusing buffers
Fewer allocations mean less garbage to collect, reducing GC frequency and pause time.
Question 3: A hash table with separate chaining has n keys stored in m buckets. What is the expected time for a successful search assuming uniform hashing?
- O(m)
- O(log n)
- O(1 + n/m) (Correct answer)
- O(n log m)
Correct answer: O(1 + n/m)
Expected search time is proportional to the load factor n/m plus the constant hash computation.
Question 4: What is the vanishing gradient problem in deep neural networks?
- Weights grow too large during backpropagation
- Gradients shrink exponentially as they propagate backward, halting learning in early layers (Correct answer)
- Activation functions return zero for all inputs
- The network overfits to training data
Correct answer: Gradients shrink exponentially as they propagate backward, halting learning in early layers
The vanishing gradient problem occurs when gradients become extremely small during backpropagation, preventing early layers from learning effectively.
Question 5: A defect found in requirements costs far less to fix than one found in production primarily because of what?
- Testers earn more than analysts
- Requirements documents are shorter
- Rework compounds as the defect propagates through design, code, and deployment (Correct answer)
- Production servers charge hourly fees
Correct answer: Rework compounds as the defect propagates through design, code, and deployment
Defect cost grows with each lifecycle phase because more downstream artifacts must be reworked.
Question 6: In memory management, what is 'fragmentation'?
- The breaking of large pages into smaller pages to support fine-grained access control
- The process of splitting a file across multiple disk sectors
- Wasted memory space that cannot be used due to how memory allocations are laid out (Correct answer)
- A technique to speed up memory access by caching frequently used addresses
Correct answer: Wasted memory space that cannot be used due to how memory allocations are laid out
Fragmentation refers to memory that is technically free but unusable — external fragmentation is unusable space between allocations, and internal fragmentation is wasted space within allocations.
Question 7: What is the purpose of a semaphore in concurrent programming?
- To measure CPU utilization across cores
- To allocate virtual memory pages to processes
- To synchronize access to shared resources by controlling how many threads can access a section simultaneously (Correct answer)
- To schedule threads based on priority
Correct answer: To synchronize access to shared resources by controlling how many threads can access a section simultaneously
A semaphore is an integer-based synchronization primitive that uses wait (P) and signal (V) operations to control concurrent access to shared resources.
Question 8: What is Direct Memory Access (DMA)?
- A CPU feature allowing registers to address memory directly without a bus
- A mechanism that lets I/O devices transfer data directly to/from memory without CPU involvement (Correct answer)
- A mode where the CPU bypasses cache to read directly from RAM
- A technique for mapping memory-mapped I/O registers into the address space
Correct answer: A mechanism that lets I/O devices transfer data directly to/from memory without CPU involvement
DMA offloads bulk data transfer work to a DMA controller, freeing the CPU to execute other instructions while the transfer proceeds in parallel.
Question 9: What does the isolation level SERIALIZABLE guarantee?
- All reads come from a snapshot taken at database startup
- Transactions produce the same result as some serial execution order (Correct answer)
- Writes are applied without logging
- Transactions never acquire locks
Correct answer: Transactions produce the same result as some serial execution order
SERIALIZABLE is the strictest isolation level, making concurrent execution equivalent to some serial schedule.
Question 10: What is a fundamental principle of Security & Authentication in Computer Science practice?
- Ignoring industry guidelines
- Following established standards and best practices (Correct answer)
- Working in isolation without guidance
- Using outdated methods
Correct answer: Following established standards and best practices
Following established standards and best practices ensures quality and consistency in Security & Authentication.
Question 11: In the ACID properties of transactions, 'isolation' means:
- Transactions either fully complete or fully roll back
- Concurrent transactions do not interfere with each other's intermediate states (Correct answer)
- Data survives system crashes
- Constraints remain valid after each transaction
Correct answer: Concurrent transactions do not interfere with each other's intermediate states
Isolation ensures concurrent transactions behave as if executed serially, hiding intermediate states.
Question 12: Which security measure is essential for protecting Computer Science digital systems?
- Sharing login credentials
- Implementing multi-factor authentication (Correct answer)
- Using simple passwords
- Disabling firewalls
Correct answer: Implementing multi-factor authentication
Multi-factor authentication adds extra layers of security beyond passwords, significantly reducing unauthorized access risk.
Question 13: What does 'endianness' describe in computer architecture?
- The order in which bytes of a multi-byte value are stored in memory (Correct answer)
- The direction data flows across the system bus
- The bit ordering within a single byte of data
- The alignment requirement of data types in memory
Correct answer: The order in which bytes of a multi-byte value are stored in memory
Big-endian stores the most significant byte at the lowest address; little-endian stores the least significant byte first — this matters when exchanging binary data across systems.
Question 14: Which technique best prevents cross-site scripting (XSS) in a web application?
- Output encoding and sanitizing user-supplied content (Correct answer)
- Using longer session timeouts
- Hashing all cookies
- Disabling HTTPS
Correct answer: Output encoding and sanitizing user-supplied content
Encoding or sanitizing user content before rendering prevents injected scripts from executing in the browser.
Question 15: An attacker submits the input ' OR '1'='1 into a login form and gains access. Which vulnerability does this exploit?
- Cross-site scripting (XSS)
- Cross-site request forgery (CSRF)
- SQL injection (Correct answer)
- Buffer overflow
Correct answer: SQL injection
Injecting SQL syntax into unparameterized queries to alter their logic is a classic SQL injection attack.
Question 16: Which algorithm design technique does merge sort primarily use?
- Backtracking
- Dynamic programming
- Greedy strategy
- Divide and conquer (Correct answer)
Correct answer: Divide and conquer
Merge sort splits the array in half, recursively sorts each half, and merges the results.
Question 17: Which technique resolves hash collisions by probing successive slots within the table itself?
- Separate chaining
- Open addressing (Correct answer)
- Rehashing only
- Bucket sort
Correct answer: Open addressing
Open addressing stores all entries in the table array and probes alternative slots on collision.
Question 18: A transaction reads a row that another uncommitted transaction has modified. If the second transaction rolls back, what anomaly occurred?
- Non-repeatable read
- Phantom read
- Lost update
- Dirty read (Correct answer)
Correct answer: Dirty read
Reading uncommitted data that may later be rolled back is called a dirty read.
Question 19: A multithreaded program on 8 cores shows almost no speedup over the single-threaded version. Threads frequently update the same shared counter. What is the likely cause?
- The CPU lacks floating-point units
- Lock contention and cache-line contention on the shared counter (Correct answer)
- The compiler disabled all optimizations
- The threads have too much stack space
Correct answer: Lock contention and cache-line contention on the shared counter
Serialized access to a shared counter forces threads to wait and invalidate each other's cache lines.
Question 20: A table's primary key must be:
- Numeric only
- Unique and not null (Correct answer)
- Auto-incrementing
- Indexed with a full-text index
Correct answer: Unique and not null
A primary key uniquely identifies each row and cannot contain NULL values.
Question 21: What is the role of an artifact repository (such as Nexus or Artifactory) in a deployment pipeline?
- Monitoring production servers for failures
- Hosting the application's source code and pull requests
- Storing versioned build outputs so the same artifact can be promoted across environments (Correct answer)
- Running automated tests against the application
Correct answer: Storing versioned build outputs so the same artifact can be promoted across environments
Artifact repositories store immutable versioned binaries, ensuring the exact artifact tested in staging is deployed to production.
Question 22: The 'pesticide paradox' in testing states that what happens over time?
- Developers write fewer bugs as they age
- Test environments become identical to production
- Repeatedly running the same tests stops finding new defects (Correct answer)
- Automated tests become faster with each run
Correct answer: Repeatedly running the same tests stops finding new defects
Like pests resisting the same pesticide, remaining defects evade unchanged test suites, so tests must evolve.
Question 23: Which scenario describes a replay attack?
- An attacker modifies DNS records to redirect users
- An attacker retransmits a captured valid authentication message to gain unauthorized access (Correct answer)
- An attacker floods a server with traffic to make it unavailable
- An attacker guesses passwords from a dictionary of common words
Correct answer: An attacker retransmits a captured valid authentication message to gain unauthorized access
Replay attacks reuse intercepted legitimate messages, which is why protocols use nonces and timestamps.
Question 24: What is the main purpose of a compiler?
- To convert source code into machine code (Correct answer)
- To execute code line by line
- To optimize memory usage
- To debug programs
Correct answer: To convert source code into machine code
A compiler is a program that translates source code written in a high-level programming language (like C++ or Java) into machine code or an intermediate code. This machine code is a low-level language that a computer's processor can directly understand and execute. The compilation process typically involves lexical analysis, parsing, semantic analysis, and code generation.
Question 25: A programmer needs constant-time insertion and deletion at both ends of a sequence. Which structure fits best?
- Doubly linked list (deque) (Correct answer)
- Binary search tree
- Singly linked list
- Dynamic array
Correct answer: Doubly linked list (deque)
A doubly linked list or deque supports O(1) insertion and removal at both head and tail.
Question 26: What is the purpose of the Translation Lookaside Buffer (TLB)?
- To translate assembly mnemonics into machine opcodes
- To buffer data between the CPU and L2 cache
- To store the interrupt descriptor table for fast interrupt dispatch
- To cache recently used virtual-to-physical address translations for faster memory access (Correct answer)
Correct answer: To cache recently used virtual-to-physical address translations for faster memory access
The TLB is a small hardware cache that stores recent page-table lookups, avoiding expensive full page-table walks on every memory access.
Question 27: A REST endpoint returns different representations (JSON or XML) of the same resource based on a request header. Which header drives this content negotiation?
- Cache-Control
- Authorization
- Origin
- Accept (Correct answer)
Correct answer: Accept
The Accept header tells the server which media types the client can process, enabling content negotiation.
Question 28: Which of the following is an example of an infinite loop?
- while (x > 0) { x = x - 1; } where x starts at 5
- for (i = 0; i < 10; i++) { print(i); }
- while (x > 0) { print(x); } where x starts at 5 and never changes (Correct answer)
- do { x++; } while (x < 3); where x starts at 0
Correct answer: while (x > 0) { print(x); } where x starts at 5 and never changes
Since x is never modified inside the loop, the condition x > 0 stays true forever.
Question 29: A certificate authority's private key is compromised. What is the most serious consequence?
- DNS servers stop resolving domain names
- Attackers can issue fraudulent certificates that browsers will trust, enabling impersonation of any website (Correct answer)
- All previously encrypted traffic is immediately decrypted
- All user passwords stored on websites are exposed
Correct answer: Attackers can issue fraudulent certificates that browsers will trust, enabling impersonation of any website
With a CA's signing key, attackers can forge trusted certificates and impersonate legitimate sites in man-in-the-middle attacks.
Question 30: What does CPU pipelining achieve in processor design?
- Executes multiple instructions in a single clock cycle
- Reduces the number of registers needed by the CPU
- Increases the clock frequency by reducing pipeline depth
- Overlaps the execution stages of multiple instructions to increase throughput (Correct answer)
Correct answer: Overlaps the execution stages of multiple instructions to increase throughput
Pipelining divides instruction execution into stages (fetch, decode, execute, etc.) so that different instructions occupy different stages simultaneously, improving overall throughput.
Question 31: What does 'false sharing' refer to in parallel programming?
- Threads on different cores modifying separate variables that share a cache line (Correct answer)
- Copying data instead of passing a reference
- Two threads reading the same immutable data
- A thread sharing a lock it never uses
Correct answer: Threads on different cores modifying separate variables that share a cache line
When independent variables occupy the same cache line, writes by one core invalidate the line for others.
Question 32: Which authentication factor category does a fingerprint belong to?
- Something you know
- Something you are (Correct answer)
- Somewhere you are
- Something you have
Correct answer: Something you are
Biometrics such as fingerprints are inherence factors, i.e., something you are.
Question 33: An attacker changes /api/invoices/1001 to /api/invoices/1002 and reads another customer's invoice. What vulnerability is this?
- Broken object level authorization (IDOR) (Correct answer)
- SQL injection
- Cross-site scripting
- Clickjacking
Correct answer: Broken object level authorization (IDOR)
Failing to verify the caller owns the referenced object is broken object level authorization, the top API risk in the OWASP API Security Top 10.
Question 34: In the context of network switches, what does a MAC address table map?
- Ports to VLAN passwords
- IP addresses to hostnames
- MAC addresses to IP addresses
- MAC addresses to switch ports (Correct answer)
Correct answer: MAC addresses to switch ports
A switch learns which MAC addresses are reachable through which physical ports to forward frames efficiently.
Question 35: A web application stores user passwords using bcrypt. What is the primary security benefit of bcrypt over a plain SHA-256 hash?
- It is deliberately slow and includes a salt, making brute-force and rainbow table attacks harder (Correct answer)
- It compresses the password to save database space
- It encrypts the password so it can be recovered if needed
- It produces a longer hash output that cannot be reversed
Correct answer: It is deliberately slow and includes a salt, making brute-force and rainbow table attacks harder
Bcrypt is an adaptive, salted hashing function designed to be computationally expensive, which slows brute-force and defeats precomputed rainbow tables.
Question 36: An API supports conditional requests. A client sends If-None-Match with a previously received ETag, and the resource is unchanged. What should the server return?
- 200 OK with the full body
- 410 Gone
- 404 Not Found
- 304 Not Modified with no body (Correct answer)
Correct answer: 304 Not Modified with no body
When the ETag still matches, the server returns 304 Not Modified so the client can reuse its cached copy.
Question 37: Which database property ensures that a transaction is either fully completed or fully rolled back?
- Durability
- Consistency
- Isolation
- Atomicity (Correct answer)
Correct answer: Atomicity
Atomicity guarantees all-or-nothing execution of a transaction.
Question 38: What is the worst-case time complexity of quicksort when the pivot is always the smallest element?
- O(n)
- O(log n)
- O(n^2) (Correct answer)
- O(n log n)
Correct answer: O(n^2)
A consistently bad pivot creates maximally unbalanced partitions, degrading quicksort to O(n^2).
Question 39: Which attack involves an adversary secretly relaying and possibly altering communication between two parties who believe they are talking directly?
- Phishing attack
- Man-in-the-middle attack (Correct answer)
- Denial-of-service attack
- Dictionary attack
Correct answer: Man-in-the-middle attack
A man-in-the-middle attacker intercepts traffic between two parties, potentially reading or modifying it undetected.
Question 40: What is the importance of staying current with trends in Security & Authentication for Computer Science?
- Trends do not affect professional practice
- It is not necessary once certified
- It is only required for new professionals
- It ensures practices remain effective and relevant (Correct answer)
Correct answer: It ensures practices remain effective and relevant
Staying current with industry trends ensures that professional practices remain effective, relevant, and aligned with evolving standards.
Question 41: What is the core concept of virtual memory?
- It gives each process the illusion of a large, contiguous private address space mapped to physical RAM (Correct answer)
- It compresses data in RAM to effectively double available memory
- It extends RAM by using CPU registers as additional storage
- It allows multiple processes to directly share the same physical memory addresses
Correct answer: It gives each process the illusion of a large, contiguous private address space mapped to physical RAM
Virtual memory uses page tables to map each process's virtual addresses to physical RAM frames, abstracting physical memory limits and providing process isolation.
Question 42: What advantage do containers have over traditional virtual machines for deployment?
- Containers each include a full guest operating system for stronger isolation
- Containers eliminate the need for any host operating system
- Containers can only run one at a time per host
- Containers share the host OS kernel, making them lighter and faster to start (Correct answer)
Correct answer: Containers share the host OS kernel, making them lighter and faster to start
Containers virtualize at the OS level and share the host kernel, so they use fewer resources and start in seconds compared to VMs.
Question 43: A service is CPU-bound at 100% on one core while other cores sit idle. Which change most directly improves throughput?
- Parallelizing the workload across multiple cores (Correct answer)
- Reducing the log file size
- Increasing the network bandwidth
- Adding more disk storage
Correct answer: Parallelizing the workload across multiple cores
A single-threaded CPU-bound workload benefits from splitting work across the idle cores.
Question 44: A relation is in second normal form (2NF) when it is in 1NF and:
- Every determinant is a candidate key
- No transitive dependencies exist
- No non-key attribute depends on only part of a composite key (Correct answer)
- All attributes are atomic
Correct answer: No non-key attribute depends on only part of a composite key
2NF eliminates partial dependencies of non-key attributes on a composite primary key.
Question 45: How does collaboration enhance Security & Authentication in Computer Science?
- It creates unnecessary meetings
- It brings diverse perspectives and improves outcomes (Correct answer)
- It reduces individual accountability
- It slows down the process
Correct answer: It brings diverse perspectives and improves outcomes
Collaboration brings together different viewpoints and expertise, leading to better decision-making and outcomes.
Question 46: Which technique mitigates brute-force attacks against a login endpoint?
- Disabling HTTPS to reduce server load
- Rate limiting and account lockout after repeated failed attempts (Correct answer)
- Using shorter session timeouts
- Storing passwords in plaintext for faster comparison
Correct answer: Rate limiting and account lockout after repeated failed attempts
Throttling attempts and locking accounts after failures drastically slow automated password guessing.
Question 47: Why is it dangerous for a login page to report 'username not found' versus 'incorrect password' as separate errors?
- It enables user enumeration, letting attackers confirm which usernames exist (Correct answer)
- It slows down the login process for legitimate users
- It bypasses TLS encryption on the response
- It causes the session cookie to be exposed
Correct answer: It enables user enumeration, letting attackers confirm which usernames exist
Distinct error messages let attackers enumerate valid accounts to target with password attacks.
Question 48: Why is HMAC preferred over a simple hash of message-plus-secret (hash(key || message)) for message authentication?
- HMAC does not require a secret key
- HMAC is significantly faster to compute than a single hash
- HMAC's nested construction resists length-extension attacks that affect naive concatenation with Merkle-Damgard hashes (Correct answer)
- HMAC encrypts the message as well as authenticating it
Correct answer: HMAC's nested construction resists length-extension attacks that affect naive concatenation with Merkle-Damgard hashes
HMAC's double-hash structure prevents length-extension attacks possible against plain hash(key || message) with hashes like SHA-256.
Question 49: What is the primary advantage of using a multi-level page table over a single-level page table?
- Multi-level tables reduce memory used by the page table for sparse address spaces (Correct answer)
- Multi-level tables eliminate the need for a TLB
- Single-level tables always use more RAM than multi-level tables regardless of address space usage
- Multi-level tables allow faster address translation for all accesses
Correct answer: Multi-level tables reduce memory used by the page table for sparse address spaces
Multi-level page tables only allocate inner table pages when the corresponding virtual address range is used, reducing memory overhead for processes with sparse virtual address spaces.
Question 50: A web application makes 50 separate small database queries to render one page. What is the most effective optimization?
- Switch the page to HTTPS
- Batch the queries into fewer round trips (Correct answer)
- Minify the JavaScript files
- Add more RAM to the web server
Correct answer: Batch the queries into fewer round trips
Combining many small queries reduces per-request network and query overhead, the dominant cost here.
Question 51: An organization requires biometric login. Which factor category does a fingerprint scan represent?
- Something you are (Correct answer)
- Something you know
- Something you have
- Somewhere you are
Correct answer: Something you are
Biometrics like fingerprints are inherence factors, classified as 'something you are'.
Question 52: Which traversal of a binary search tree visits nodes in ascending sorted order?
- In-order (Correct answer)
- Post-order
- Level-order
- Pre-order
Correct answer: In-order
In-order traversal visits left subtree, node, then right subtree, yielding sorted order in a BST.
Question 53: What distinguishes authentication from authorization?
- Authorization always happens before authentication
- They are interchangeable terms for login
- Authentication grants permissions; authorization verifies passwords
- Authentication verifies identity; authorization determines what that identity is allowed to do (Correct answer)
Correct answer: Authentication verifies identity; authorization determines what that identity is allowed to do
Authentication answers 'who are you' while authorization answers 'what are you allowed to do'.
Question 54: In a circular queue implemented with an array of size k, what condition typically indicates the queue is full when one slot is kept empty?
- front == 0
- (rear + 1) % k == front (Correct answer)
- rear == front
- rear == k - 1
Correct answer: (rear + 1) % k == front
Keeping one slot empty lets (rear + 1) % k == front unambiguously signal a full queue.
Question 55: What does the SQL statement 'DELETE FROM orders;' do without a WHERE clause?
- Deletes only the first row
- Raises a syntax error
- Deletes the orders table structure
- Removes all rows from the orders table (Correct answer)
Correct answer: Removes all rows from the orders table
DELETE without WHERE removes every row but leaves the table definition intact, unlike DROP TABLE.
Question 56: Why do routers decrement the TTL field in an IP header?
- To measure the packet's transmission speed
- To prioritize older packets
- To encrypt the packet incrementally
- To prevent packets from looping forever in the network (Correct answer)
Correct answer: To prevent packets from looping forever in the network
TTL limits a packet's lifetime so routing loops cannot circulate it indefinitely.
Question 57: What is the purpose of general-purpose registers in a CPU?
- To buffer data transferred over the system bus
- To store the operating system's kernel code
- To provide fast, on-chip storage for operands and intermediate results (Correct answer)
- To cache frequently accessed main memory pages
Correct answer: To provide fast, on-chip storage for operands and intermediate results
General-purpose registers are the fastest storage available to the CPU, used to hold operands and results during instruction execution without requiring memory accesses.
Question 58: In an inode-based file system, what does an inode NOT typically store?
- The file's size
- Pointers to data blocks
- File permission bits
- The file's name (Correct answer)
Correct answer: The file's name
File names live in directory entries that map names to inode numbers, not in the inode itself.
Question 59: Which practice best protects an API key used by a server-side integration?
- Committing it to the public Git repository for easy access
- Passing it as a URL query parameter so it appears in logs
- Embedding it in the mobile app's source code
- Storing it in environment variables or a secrets manager and rotating it periodically (Correct answer)
Correct answer: Storing it in environment variables or a secrets manager and rotating it periodically
Secrets belong in environment variables or a secrets manager with rotation, never in client code, repos, or logged URLs.
Question 60: Which principle underpins Total Quality Management (TQM) in Computer Science?
- Top-down control only
- Quality is only the QA department's job
- Minimize customer feedback
- Everyone in the organization is responsible for quality (Correct answer)
Correct answer: Everyone in the organization is responsible for quality
TQM is based on the principle that quality is everyone's responsibility, from leadership to front-line workers.
Question 61: A profiler shows a program spends 80% of its time in one function. According to Amdahl's Law, what is the maximum overall speedup if that function is made infinitely fast?
- 80x
- 1.25x
- 5x (Correct answer)
- 20x
Correct answer: 5x
With 20% of the runtime unaffected, the speedup limit is 1/0.2 = 5x.
Question 62: What is the role of the Translation Lookaside Buffer (TLB) in a virtual memory system?
- It stores recently accessed disk blocks to speed up I/O
- It caches recent virtual-to-physical address translations to speed up memory access (Correct answer)
- It maps system calls to kernel function addresses
- It holds the process control blocks for all running processes
Correct answer: It caches recent virtual-to-physical address translations to speed up memory access
The TLB is a fast hardware cache that stores recent page table entries, allowing virtual-to-physical address translation without a full page table lookup on most accesses.
Question 63: In a min-heap with n elements, what is the time complexity of finding the maximum element?
- O(n) (Correct answer)
- O(log n)
- O(n log n)
- O(1)
Correct answer: O(n)
The maximum in a min-heap must be a leaf, so roughly half the nodes must be scanned, giving O(n).
Question 64: Which data structure change most directly improves lookup performance from O(n) to average O(1)?
- Replacing a hash table with a sorted array
- Replacing a linked list with a hash table (Correct answer)
- Replacing an array with a binary search tree
- Replacing a queue with a stack
Correct answer: Replacing a linked list with a hash table
Hash tables provide average constant-time lookups versus linear scans through a linked list.
Question 65: Which of the following is true about a trie (prefix tree) storing strings over a fixed alphabet?
- It cannot store strings sharing prefixes
- Lookup time depends on key length, not the number of keys (Correct answer)
- It requires the strings to be sorted first
- Lookup time is O(log n) in the number of keys
Correct answer: Lookup time depends on key length, not the number of keys
A trie walks one node per character, so search cost is proportional to the key's length.
Question 66: Which traversal method visits all nodes of a binary tree in ascending order?
- Pre-order traversal
- Level-order traversal
- Post-order traversal
- In-order traversal (Correct answer)
Correct answer: In-order traversal
In-order traversal visits the left subtree, then the root node, and finally the right subtree. When applied to a Binary Search Tree (BST), this specific order ensures that all nodes are visited in ascending order of their values. This property makes in-order traversal particularly useful for retrieving sorted data from a BST.
Question 67: Which OAuth 2.0 grant type is recommended for a single-page application authenticating a user in 2020s best practice?
- Authorization code flow with PKCE (Correct answer)
- Resource owner password credentials
- Client credentials grant
- Implicit grant
Correct answer: Authorization code flow with PKCE
The authorization code flow with PKCE replaced the implicit grant as the secure standard for public clients like SPAs.
Question 68: Which data structure is most appropriate for implementing an undo feature in a text editor?
- Heap
- Queue
- Stack (Correct answer)
- Hash table
Correct answer: Stack
Undo requires reversing the most recent action first, which matches a stack's LIFO behavior.
Question 69: A query planner chooses a full table scan instead of using an available index. Which scenario most likely explains this?
- The table has a primary key
- The query uses a WHERE clause
- The query matches a large fraction of the table's rows (Correct answer)
- The index is stored in memory
Correct answer: The query matches a large fraction of the table's rows
When most rows match, sequentially scanning the table is cheaper than many random index lookups.
Question 70: What is the primary purpose of a unit test?
- To measure how many users the system supports
- To deploy code to production servers
- To check the visual design of the interface
- To verify that an individual component works correctly in isolation (Correct answer)
Correct answer: To verify that an individual component works correctly in isolation
Unit tests validate the smallest testable pieces of code independently of the rest of the system.
Question 71: During an incident, a team follows a documented runbook. What is a runbook?
- A log file that records all deployment history
- A dashboard displaying real-time metrics
- A step-by-step guide of procedures for handling specific operational scenarios (Correct answer)
- A tool that automatically rolls back failed deployments
Correct answer: A step-by-step guide of procedures for handling specific operational scenarios
A runbook documents the exact operational steps for routine tasks or incident response so anyone on the team can execute them.
Question 72: What is the primary advantage of an AVL tree over a plain binary search tree?
- Lower memory usage per node
- Guaranteed O(log n) operations via balancing (Correct answer)
- Faster in-order traversal
- Support for duplicate keys
Correct answer: Guaranteed O(log n) operations via balancing
AVL rotations keep the tree height logarithmic, preventing the O(n) degeneration of an unbalanced BST.
Question 73: Which type of neural network architecture is best suited for processing sequential data such as time series or text?
- Autoencoder
- Convolutional Neural Network (CNN)
- Recurrent Neural Network (RNN) (Correct answer)
- Generative Adversarial Network (GAN)
Correct answer: Recurrent Neural Network (RNN)
RNNs maintain a hidden state that captures information from previous time steps, making them naturally suited for sequential data like text or time series.
Question 74: Which CPU scheduling algorithm can cause starvation of long jobs if short jobs keep arriving?
- Multilevel feedback with aging
- Round Robin
- First-Come First-Served
- Shortest Job First (Correct answer)
Correct answer: Shortest Job First
Shortest Job First always favors shorter jobs, so a long job may wait indefinitely.
Question 75: Which term describes the risk of becoming dependent on one cloud provider's proprietary services, making migration difficult?
- Data sovereignty
- Cloud bursting
- Vendor lock-in (Correct answer)
- Fault tolerance
Correct answer: Vendor lock-in
Vendor lock-in occurs when proprietary APIs and services make switching providers costly and complex.
Question 76: Which statement about a JWT (JSON Web Token) used as an API bearer token is TRUE?
- Its payload is only Base64URL-encoded, so anyone holding the token can read the claims (Correct answer)
- It must be stored server-side in a session table
- It cannot expire once issued
- Its payload is encrypted and unreadable without the secret
Correct answer: Its payload is only Base64URL-encoded, so anyone holding the token can read the claims
A signed JWT's payload is Base64URL-encoded, not encrypted, so signing guarantees integrity but not confidentiality.
Question 77: Which file is used to define the steps for building a Docker container image?
- package.json
- Makefile
- Dockerfile (Correct answer)
- docker-compose.yml
Correct answer: Dockerfile
A Dockerfile contains the ordered instructions Docker uses to build a container image layer by layer.
Question 78: Which of the following is a characteristic of a NoSQL document database like MongoDB compared to a relational database?
- Data stored strictly in normalized tables
- Mandatory foreign key constraints
- Flexible schema with data stored as JSON-like documents (Correct answer)
- Requires SQL joins for all queries
Correct answer: Flexible schema with data stored as JSON-like documents
Document databases store semi-structured documents and do not enforce a fixed table schema.
Question 79: What is the primary advantage of using a hash table?
- Allows fast data retrieval in O(1) time (Correct answer)
- Uses less memory than other structures
- Maintains sorted order of elements
- Best suited for sequential access
Correct answer: Allows fast data retrieval in O(1) time
The primary advantage of using a hash table is its ability to provide average O(1) time complexity for data retrieval, insertion, and deletion operations. This constant time access is achieved by mapping keys directly to array indices using a hash function, making it incredibly fast for lookup-intensive tasks.
Question 80: What does the 'exec()' family of system calls do in Unix/Linux?
- Terminates the calling process and spawns a replacement
- Allocates additional heap memory for the current process
- Creates a new process alongside the calling process
- Replaces the current process's memory image with a new program while retaining the PID (Correct answer)
Correct answer: Replaces the current process's memory image with a new program while retaining the PID
exec() replaces the calling process's code, data, and stack with a new program loaded from an executable file, keeping the same PID but completely new execution context.
Question 81: In an adjacency matrix representation of a graph with V vertices, how long does it take to check whether an edge exists between two given vertices?
- O(V)
- O(E)
- O(V^2)
- O(1) (Correct answer)
Correct answer: O(1)
An adjacency matrix stores edge existence in a 2D array cell, allowing constant-time lookup.
Question 82: What is the purpose of a feasibility study in Computer Science project planning?
- To start the project immediately
- To determine if a project is viable and worth pursuing (Correct answer)
- To assign team roles
- To create a marketing plan
Correct answer: To determine if a project is viable and worth pursuing
A feasibility study evaluates whether a project is technically, financially, and operationally viable before committing resources.
Question 83: What is the time complexity of binary search in a sorted array?
- O(n)
- O(1)
- O(log n) (Correct answer)
- O(n log n)
Correct answer: O(log n)
Binary search works by repeatedly dividing the search interval in half, eliminating a large portion of the data with each comparison. This logarithmic reduction in the search space results in a time complexity of O(log n), making it highly efficient for large sorted arrays.
Question 84: Why does UDP offer lower latency than TCP for real-time video streaming?
- It skips connection setup, acknowledgments, and retransmissions (Correct answer)
- It uses smaller IP headers
- It always takes shorter network routes
- It compresses payloads automatically
Correct answer: It skips connection setup, acknowledgments, and retransmissions
UDP avoids TCP's handshake, ordering, and retransmission overhead, trading reliability for speed.
Question 85: What advantage does a microkernel architecture have over a monolithic kernel?
- It eliminates the need for device drivers
- It requires no inter-process communication
- Faster system calls due to fewer context switches
- Better fault isolation since drivers run in user space (Correct answer)
Correct answer: Better fault isolation since drivers run in user space
Microkernels run services like drivers in user space, so a crashing driver is less likely to take down the whole system.
Question 86: A subnet uses the mask 255.255.255.192. How many usable host addresses does it provide?
- 64
- 30
- 62 (Correct answer)
- 126
Correct answer: 62
A /26 subnet has 64 addresses, minus the network and broadcast addresses, leaving 62 usable hosts.
Question 87: Which property must a cryptographic hash function have so that it is infeasible to find two different inputs producing the same output?
- Forward secrecy
- Homomorphism
- Collision resistance (Correct answer)
- Key secrecy
Correct answer: Collision resistance
Collision resistance means no attacker can feasibly find any two distinct inputs with identical hash values.
Question 88: What is the primary function of an operating system?
- To directly execute machine code
- To manage hardware and software resources (Correct answer)
- To provide power to the system
- To serve as an antivirus
Correct answer: To manage hardware and software resources
The operating system (OS) is the core software that manages all the hardware and software resources of a computer. It acts as an intermediary between applications and hardware, handling tasks such as memory management, process scheduling, file system operations, and input/output. Without an OS, applications cannot run, and users cannot interact with the computer.
Question 89: What is benchmarking in the context of Computer Science quality management?
- Testing equipment functionality
- Comparing performance against best practices or competitors (Correct answer)
- Recording daily activities
- Setting minimum acceptable standards
Correct answer: Comparing performance against best practices or competitors
Benchmarking involves comparing your processes and performance metrics to industry best practices to identify improvement areas.
Question 90: What is the main purpose of a salt when hashing passwords?
- To make the hash output shorter and faster to compare
- To allow the original password to be recovered by administrators
- To ensure identical passwords produce different hashes, defeating precomputed lookup tables (Correct answer)
- To encrypt the hash so it can be safely transmitted
Correct answer: To ensure identical passwords produce different hashes, defeating precomputed lookup tables
A unique random salt per password makes each hash unique, so rainbow tables and cross-user comparisons are useless.
Question 91: Which metric best captures how a system's response time degrades for its slowest requests?
- Mean response time
- Average throughput
- Tail latency, such as the 99th percentile (Correct answer)
- CPU clock speed
Correct answer: Tail latency, such as the 99th percentile
High-percentile latency reveals worst-case user experience that averages hide.
Question 92: What is the primary goal of quality assurance in Computer Science?
- Reducing staff numbers
- Completing tasks as quickly as possible
- Ensuring consistent standards and continuous improvement (Correct answer)
- Finding someone to blame for errors
Correct answer: Ensuring consistent standards and continuous improvement
Quality assurance focuses on maintaining consistent standards and identifying opportunities for continuous improvement in processes and outcomes.
Question 93: What is a stakeholder analysis in Computer Science planning?
- A financial audit
- A staff satisfaction survey
- Identifying and assessing the interests and influence of affected parties (Correct answer)
- A competitive market review
Correct answer: Identifying and assessing the interests and influence of affected parties
Stakeholder analysis identifies all parties affected by or having influence over a project, helping manage expectations and engagement.
Question 94: What problem does normalization primarily aim to reduce?
- Disk fragmentation
- Data redundancy and update anomalies (Correct answer)
- Network latency
- Query execution time
Correct answer: Data redundancy and update anomalies
Normalization organizes data to minimize redundancy and prevent insert, update, and delete anomalies.
Question 95: A query plan shows a full table scan on a large table filtered by a WHERE clause on 'email'. What is the most likely fix?
- Create an index on the email column (Correct answer)
- Switch the table to a different schema
- Rewrite the query using SELECT *
- Add more RAM to the server
Correct answer: Create an index on the email column
An index on the filtered column lets the optimizer avoid scanning every row.
Question 96: What condition must hold, among others, for a deadlock to occur in a system?
- Use of virtual memory
- Circular wait among processes holding resources (Correct answer)
- More threads than CPU cores
- All processes running at the same priority
Correct answer: Circular wait among processes holding resources
Deadlock requires mutual exclusion, hold-and-wait, no preemption, and circular wait.
Question 97: In a microservices system, an API gateway primarily serves to:
- Provide a single entry point that routes requests to backend services (Correct answer)
- Replace all databases with one shared schema
- Store user passwords in plaintext for speed
- Compile services into a single binary
Correct answer: Provide a single entry point that routes requests to backend services
An API gateway is the unified front door that routes, authenticates, and often rate-limits requests to services.
Question 98: What is the primary purpose of a container orchestration platform like Kubernetes?
- Replacing the need for operating systems on servers
- Automating deployment, scaling, and management of containerized applications across clusters (Correct answer)
- Compiling application source code into container images
- Providing a version control system for containers
Correct answer: Automating deployment, scaling, and management of containerized applications across clusters
Orchestrators schedule containers onto machines, scale them, restart failures, and manage networking across a cluster.
Question 99: Which query returns employees whose salary is above the company average?
- SELECT name FROM emp WHERE salary > AVG(salary);
- SELECT name FROM emp WHERE salary > (SELECT AVG(salary) FROM emp); (Correct answer)
- SELECT name, AVG(salary) FROM emp WHERE salary > AVG;
- SELECT name FROM emp HAVING salary > AVG(salary);
Correct answer: SELECT name FROM emp WHERE salary > (SELECT AVG(salary) FROM emp);
Aggregate functions cannot appear directly in WHERE, so a subquery computes the average first.
Question 100: A team subjects a web service to sustained load beyond expected peak to find its breaking point. Which testing type is this?
- Alpha testing
- Compatibility testing
- Stress testing (Correct answer)
- Unit testing
Correct answer: Stress testing
Stress testing pushes a system beyond normal operating limits to observe how and when it fails.
Praxis Computer Science (5652)
The Praxis Computer Science (5652) exam assesses the knowledge and skills required of beginning computer science teachers, covering programming, algorithms and computational thinking, computing systems, data concepts, and the broader impacts of computing. It is used for educator licensure across the United States.
Exam Rules
- You can skip questions and return to them later
- Flag questions for review before submitting
- No feedback shown until you submit the entire exam
- Unanswered questions count as wrong — answer everything
- 10 pretest questions are mixed in and don't affect your score
- Timer auto-submits when time runs out
- Your progress is auto-saved every 30 seconds