BCS Bachelor of Computer Science — Questions and Answers
Question 1: What is spooling in operating systems?
- A method of CPU scheduling
- Compressing files to save disk space
- Storing data temporarily in a buffer while it waits to be processed by a slower device, like a printer (Correct answer)
- Defragmenting the hard drive
Correct answer: Storing data temporarily in a buffer while it waits to be processed by a slower device, like a printer
Spooling (Simultaneous Peripheral Operations On-Line) buffers I/O data to disk so that fast processes are not forced to wait for slow devices like printers.
Question 2: In computer networks, what is the difference between a hub and a switch?
- A hub broadcasts to all ports; a switch forwards to specific ports using MAC addresses (Correct answer)
- A hub uses IP addresses; a switch uses MAC addresses for routing
- A hub is faster than a switch due to simpler hardware
- A hub operates at Layer 3; a switch at Layer 2
Correct answer: A hub broadcasts to all ports; a switch forwards to specific ports using MAC addresses
A hub broadcasts incoming frames to all ports while a switch learns MAC addresses and forwards frames only to the destination port.
Question 3: What is the worst-case time complexity of QuickSort?
- O(n²) (Correct answer)
- O(log n)
- O(n log n)
- O(n)
Correct answer: O(n²)
QuickSort degrades to O(n²) in the worst case when the pivot consistently picks the smallest or largest element.
Question 4: In a TCP three-way handshake, what is the correct sequence of messages?
- SYN-ACK, SYN, ACK
- ACK, SYN, SYN-ACK
- SYN, ACK, SYN-ACK
- SYN, SYN-ACK, ACK (Correct answer)
Correct answer: SYN, SYN-ACK, ACK
TCP connection establishment follows SYN → SYN-ACK → ACK, where the client sends SYN, server responds with SYN-ACK, and client confirms with ACK.
Question 5: What is an index in a database?
- A constraint that enforces uniqueness
- A copy of an entire table
- A temporary table used during queries
- A data structure that improves the speed of data retrieval at the cost of additional storage space (Correct answer)
Correct answer: A data structure that improves the speed of data retrieval at the cost of additional storage space
A database index is a data structure (like a B-tree) that allows faster row lookup on indexed columns at the cost of extra storage and slower write operations.
Question 6: In machine learning, what technique is used to prevent overfitting by randomly dropping neurons during training?
- Dropout (Correct answer)
- L2 Regularization
- Batch Normalization
- Early Stopping
Correct answer: Dropout
Dropout randomly deactivates neurons during training to prevent the network from becoming too dependent on specific pathways.
Question 7: A graph with V vertices and E edges represented as an adjacency matrix requires how much space?
- O(V)
- O(V²) (Correct answer)
- O(V + E)
- O(E)
Correct answer: O(V²)
An adjacency matrix stores a V×V boolean matrix, requiring O(V²) space regardless of the number of edges.
Question 8: In object-oriented programming, what concept allows a subclass to provide a specific implementation of a method already defined in its parent class?
- Overloading
- Encapsulation
- Overriding (Correct answer)
- Abstraction
Correct answer: Overriding
Method overriding allows a subclass to redefine a parent class method with its own specific implementation.
Question 9: What is the best-case time complexity of Insertion Sort?
- O(n²)
- O(n) (Correct answer)
- O(1)
- O(n log n)
Correct answer: O(n)
Insertion Sort achieves O(n) in the best case when the input array is already sorted, requiring only one comparison per element.
Question 10: Every night at midnight, you realize that some data are being secretly uploaded from your PC device to an unknown website. When you open the file, you discover that these documents are from the day's office job. What kind of instance is this?
- Keylogger Attack (Correct answer)
- Network Worm
- Phishing Attack
- Computer Virus
Correct answer: Keylogger Attack
A keylogger is a type of malicious software or hardware that records every keystroke made on a keyboard. If data from your daily office job is being secretly uploaded from your PC, it strongly indicates that a keylogger has captured your input, such as documents typed or accessed, and is transmitting this sensitive information to an unauthorized third party. This perfectly matches the description of data exfiltration based on user activity.
Question 11: Which sorting algorithm has a guaranteed O(n log n) time complexity in all cases?
- InsertionSort
- MergeSort (Correct answer)
- QuickSort
- BubbleSort
Correct answer: MergeSort
MergeSort always divides the array in half and merges, guaranteeing O(n log n) in best, average, and worst cases.
Question 12: In a binary search tree (BST), where is the minimum value located?
- Root node
- Rightmost node
- Leftmost node (Correct answer)
- Any leaf node
Correct answer: Leftmost node
In a BST, the minimum value is always found by traversing to the leftmost node.
Question 13: What is the purpose of a database view?
- To create physical copies of data
- To store aggregated data permanently
- To replace primary keys
- To present a virtual table based on a query, simplifying complex queries and controlling data access (Correct answer)
Correct answer: To present a virtual table based on a query, simplifying complex queries and controlling data access
A view is a virtual table defined by a SELECT query, providing a simplified interface to complex data and allowing row/column-level security.
Question 14: What is context switching in an operating system?
- Changing network configurations
- Saving the state of a running process and restoring the state of another process (Correct answer)
- Switching between user accounts
- Switching between kernel and user mode
Correct answer: Saving the state of a running process and restoring the state of another process
Context switching involves saving the CPU state (registers, program counter) of the current process and loading the saved state of the next scheduled process.
Question 15: What is Big Data's '3 Vs' model used to characterize?
- Validation, Verification, and Visualization
- Speed, Cost, and Quality of data processing
- Virtual, Volatile, and Variable storage
- Volume, Velocity, and Variety of data (Correct answer)
Correct answer: Volume, Velocity, and Variety of data
The 3 Vs of Big Data are Volume (amount), Velocity (speed), and Variety (diversity of data types).
Question 16: What is the purpose of unit testing?
- Testing individual components or functions in isolation to verify they work correctly (Correct answer)
- Testing the entire application as a whole
- Testing the user interface
- Testing performance under load
Correct answer: Testing individual components or functions in isolation to verify they work correctly
Unit testing verifies that individual functions, methods, or components work correctly in isolation, catching bugs early in the development process.
Question 17: What does the acronym 'IDE' stand for in a computer science context?
- Interface Debugging Extension
- Interactive Design Engine
- Integrated Development Environment (Correct answer)
- Internal Data Exchange
Correct answer: Integrated Development Environment
An Integrated Development Environment (IDE) combines a code editor, debugger, and compiler into one tool.
Question 18: Before granting employees access to a website, a corporation demands multi-factor authentication. Employees are required to use a security token that is texted to their mobile phones as one of the authentication elements. <br> What qualifies the employee in this system?
- Knowledge
- Facial Features
- Inherence
- Possession (Correct answer)
Correct answer: Possession
Multi-factor authentication typically relies on categories like 'something you know' (e.g., password), 'something you have' (e.g., a physical token or phone), and 'something you are' (e.g., biometric data). In this system, the security token texted to an employee's mobile phone falls under the 'possession' category. The employee must physically possess their mobile phone to receive and use this authentication element.
Question 19: What does the SQL HAVING clause do?
- Filters rows before grouping
- Filters groups after a GROUP BY clause is applied (Correct answer)
- Sorts the result set
- Joins two tables
Correct answer: Filters groups after a GROUP BY clause is applied
HAVING filters groups created by GROUP BY based on aggregate conditions, similar to how WHERE filters individual rows before grouping.
Question 20: Which page replacement algorithm suffers from Belady's Anomaly?
- Clock algorithm
- First-In First-Out (FIFO) (Correct answer)
- Least Recently Used (LRU)
- Optimal (OPT)
Correct answer: First-In First-Out (FIFO)
FIFO can suffer from Belady's Anomaly, where increasing the number of page frames counterintuitively increases the number of page faults.
Question 21: What is the difference between black-box and white-box testing?
- Black-box tests test with knowledge of internal code; white-box tests do not
- They are the same testing approach
- Black-box tests run at night; white-box tests run during the day
- Black-box tests test without knowledge of internal code; white-box tests test with full knowledge of implementation (Correct answer)
Correct answer: Black-box tests test without knowledge of internal code; white-box tests test with full knowledge of implementation
Black-box testing tests functionality from an external perspective without knowledge of internal code; white-box testing tests internal logic with full knowledge of the source code.
Question 22: Dynamic programming is best used when a problem exhibits which two properties?
- Recursion and backtracking
- Divide and conquer and memoization
- Greedy choice and optimal substructure
- Overlapping subproblems and optimal substructure (Correct answer)
Correct answer: Overlapping subproblems and optimal substructure
Dynamic programming applies when a problem has overlapping subproblems (same sub-calculations repeated) and optimal substructure (optimal solution built from optimal sub-solutions).
Question 23: What data structure is typically used to implement Breadth-First Search (BFS)?
- Queue (Correct answer)
- Heap
- Array
- Stack
Correct answer: Queue
BFS uses a queue to process nodes level by level in FIFO order.
Question 24: What does ACID stand for in database transactions?
- Atomicity, Consistency, Isolation, Durability (Correct answer)
- Atomicity, Completeness, Isolation, Distribution
- Accuracy, Completeness, Integrity, Dependability
- Access, Control, Integrity, Data
Correct answer: Atomicity, Consistency, Isolation, Durability
ACID stands for Atomicity (all-or-nothing), Consistency (valid state transitions), Isolation (concurrent transactions don't interfere), and Durability (committed data persists).
Question 25: What type of cable is used for the backbone of most modern high-speed networks?
- Coaxial cable
- Twisted pair cable
- Ethernet cable
- Fiber optic cable (Correct answer)
Correct answer: Fiber optic cable
Fiber optic cable transmits data as light pulses, offering high bandwidth, low latency, and immunity to electromagnetic interference, making it ideal for network backbones.
Question 26: Which traversal of a BST visits nodes in ascending sorted order?
- Level-order
- Inorder (Correct answer)
- Postorder
- Preorder
Correct answer: Inorder
Inorder traversal (left → root → right) of a BST produces nodes in non-decreasing sorted order.
Question 27: In Round Robin scheduling, what parameter determines how long each process runs before being preempted?
- Time quantum (Correct answer)
- Burst time
- Arrival time
- Priority value
Correct answer: Time quantum
The time quantum (or time slice) defines the fixed time interval each process is allowed to run before the CPU is given to the next process in the ready queue.
Question 28: What is the purpose of an internship requirement in many BCS programs?
- To satisfy the general education writing requirement
- To allow students to earn a second minor automatically
- To replace the final two semesters of coursework
- To give students real-world industry experience that complements classroom learning (Correct answer)
Correct answer: To give students real-world industry experience that complements classroom learning
Internships provide hands-on professional experience, helping students apply CS theory in real workplace environments.
Question 29: A relation R on set A is said to be an equivalence relation if it is:
- Reflexive and transitive only
- Reflexive, symmetric, and transitive (Correct answer)
- Reflexive and antisymmetric
- Symmetric and transitive only
Correct answer: Reflexive, symmetric, and transitive
An equivalence relation must satisfy all three properties: reflexivity (aRa), symmetry (aRb ⟹ bRa), and transitivity (aRb ∧ bRc ⟹ aRc).
Question 30: What does the acronym TCP stand for?
- Transmission Control Protocol (Correct answer)
- Transfer Control Protocol
- Transport Communication Protocol
- Terminal Connection Protocol
Correct answer: Transmission Control Protocol
TCP stands for Transmission Control Protocol, providing reliable, ordered, and error-checked data delivery.
Question 31: Which SQL command is used to retrieve data from a database?
- SELECT (Correct answer)
- DELETE
- INSERT
- UPDATE
Correct answer: SELECT
The SELECT statement retrieves data from one or more tables, with optional filtering (WHERE), grouping (GROUP BY), and sorting (ORDER BY) clauses.
Question 32: The payroll department of an organization sends an email to all of its employees. It specifies that in order for their paychecks to be sent to their accounts, the employees must transmit their updated banking information by the end of the day. <br> When questioned, the payroll division asserts that they have never sent such an email. What sort of example is that?
- Computer Virus
- Keylogger Attack
- Phishing Attack (Correct answer)
- Malware Insertion Point
Correct answer: Phishing Attack
A phishing attack involves sending fraudulent communications that appear to originate from a legitimate and trusted source, such as a company's payroll department. The goal is to deceive recipients into divulging sensitive information, like banking details, or performing actions that compromise security. The scenario, where an email requests updated banking information but the legitimate payroll department denies sending it, is a classic example of a phishing attempt designed to steal financial data.
Question 33: For its newest autonomous vehicles, Ford Motor Company plans to create its own sensors. What scenario, where these sensors are simulated, would not constitute a parameter for testing?
- Whether the sensor can judge distance from different obstacles
- Whether a swerve around a bend would cause a car accident (Correct answer)
- Whether the sensor can sense multiple obstacles simultaneously
- No incidents will be simulated
Correct answer: Whether a swerve around a bend would cause a car accident
The question asks for a scenario that would *not* be a parameter for testing the *sensors* themselves. While a swerve causing an accident is a critical outcome for an autonomous vehicle, it tests the entire vehicle's control system, decision-making algorithms, and safety protocols, not solely the sensor's ability to detect and judge obstacles. Sensor testing focuses on their accuracy, range, and ability to perceive the environment, not the vehicle's reaction to that perception.
Question 34: A relation that is reflexive, antisymmetric, and transitive is called a:
- Bijective relation
- Total order
- Partial order (Correct answer)
- Equivalence relation
Correct answer: Partial order
A partial order is defined as a relation that is reflexive, antisymmetric, and transitive; the ≤ relation on integers is a classic example.
Question 35: What is the time complexity of accessing an element by index in an array?
- O(n)
- O(n²)
- O(log n)
- O(1) (Correct answer)
Correct answer: O(1)
Array index access is O(1) because the memory address is computed directly from the base address and index using arithmetic.
Question 36: What is a zombie process?
- A process that has finished execution but still has an entry in the process table (Correct answer)
- A runaway process consuming all memory
- A process infected by malware
- A process running with maximum CPU priority
Correct answer: A process that has finished execution but still has an entry in the process table
A zombie process has completed execution but remains in the process table because its parent has not yet called wait() to read its exit status.
Question 37: In the context of OS, what is a semaphore?
- A synchronization primitive used to control access to shared resources (Correct answer)
- A hardware interrupt signal
- A memory management unit
- A type of file system
Correct answer: A synchronization primitive used to control access to shared resources
A semaphore is a synchronization tool that uses wait() and signal() operations to coordinate access to shared resources and prevent race conditions.
Question 38: Which data structure would be most efficient for implementing a priority queue?
- Heap (Correct answer)
- Array
- Linked List
- Hash Table
Correct answer: Heap
A Heap (typically a binary heap) provides O(log n) insertion and O(1) peek operations, making it ideal for priority queues.
Question 39: Which set operation produces elements that are in either set A or set B but not in both?
- Union (A ∪ B)
- Symmetric difference (A △ B) (Correct answer)
- Intersection (A ∩ B)
- Difference (A − B)
Correct answer: Symmetric difference (A △ B)
The symmetric difference A △ B contains all elements that belong to A or B but not to their intersection, formally (A ∪ B) − (A ∩ B).
Question 40: Which of the following codes, when run, will result in a TRUE statement?
- ((NOT (true)) OR (false AND true))
- ((true AND false) AND (false OR true))
- ((true OR false) AND NOT (false OR NOT (true)) (Correct answer)
- ((NOT(true AND false)) AND (false OR true))
Correct answer: ((true OR false) AND NOT (false OR NOT (true))
Let's evaluate the expression step-by-step. First, `(true OR false)` simplifies to `true`. Next, `NOT (true)` is `false`, so `(false OR NOT (true))` becomes `(false OR false)`, which is `false`. Applying `NOT` again, `NOT (false OR NOT (true))` evaluates to `NOT (false)`, which is `true`. Finally, combining the simplified parts, `true AND true` results in a `TRUE` statement.
Question 41: What does a subnet mask define?
- Which portion of an IP address identifies the network vs. host (Correct answer)
- The broadcast address only
- The default gateway address
- The maximum number of routers
Correct answer: Which portion of an IP address identifies the network vs. host
A subnet mask uses binary 1s to identify the network portion and binary 0s to identify the host portion of an IP address.
Question 42: What does SQL JOIN do?
- Creates a new table from query results
- Merges two databases into one
- Deletes duplicate rows
- Combines rows from two or more tables based on a related column (Correct answer)
Correct answer: Combines rows from two or more tables based on a related column
A JOIN clause combines rows from two or more tables based on a matching condition between related columns, typically primary and foreign key pairs.
Question 43: What is 17 mod 5?
- 2 (Correct answer)
- 1
- 4
- 3
Correct answer: 2
17 divided by 5 gives quotient 3 and remainder 2, so 17 mod 5 = 2.
Question 44: What type of file system does Linux primarily use?
- NTFS
- ext4 (Correct answer)
- FAT32
- HFS+
Correct answer: ext4
Linux primarily uses the ext4 (fourth extended filesystem) as its default file system, offering journaling, large file support, and improved performance over its predecessors.
Question 45: What property must a min-heap satisfy?
- Every parent is less than or equal to its children (Correct answer)
- Every parent is greater than its children
- Left child is always smaller than right child
- All leaves are at the same level
Correct answer: Every parent is less than or equal to its children
A min-heap requires every parent node to be less than or equal to its children, ensuring the minimum is always at the root.
Question 46: Which graph algorithm detects negative weight cycles?
- Prim's algorithm
- Bellman-Ford algorithm (Correct answer)
- Dijkstra's algorithm
- Kruskal's algorithm
Correct answer: Bellman-Ford algorithm
Bellman-Ford can detect negative weight cycles by checking if distances can still be reduced after V-1 relaxations.
Question 47: What is the purpose of a foreign key in a relational database?
- To uniquely identify each row in a table
- To index frequently queried columns
- To encrypt sensitive column values
- To enforce referential integrity between tables (Correct answer)
Correct answer: To enforce referential integrity between tables
A foreign key enforces referential integrity by ensuring a value in one table corresponds to an existing primary key in another table.
Question 48: In propositional logic, which law states that P ∨ (Q ∧ R) ≡ (P ∨ Q) ∧ (P ∨ R)?
- Distributive law (Correct answer)
- Associative law
- De Morgan's law
- Absorption law
Correct answer: Distributive law
The distributive law in propositional logic allows OR to distribute over AND (and vice versa), giving P ∨ (Q ∧ R) ≡ (P ∨ Q) ∧ (P ∨ R).
Question 49: Which HTTP status code indicates that a requested resource was permanently moved?
- 500 Internal Server Error
- 200 OK
- 404 Not Found
- 301 Moved Permanently (Correct answer)
Correct answer: 301 Moved Permanently
HTTP 301 tells clients and search engines that the resource has permanently moved to a new URL.
Question 50: Which algorithm finds the shortest path in a weighted graph with non-negative edge weights?
- Floyd-Warshall
- Bellman-Ford
- Prim's algorithm
- Dijkstra's algorithm (Correct answer)
Correct answer: Dijkstra's algorithm
Dijkstra's algorithm greedily finds the shortest path from a source to all vertices in graphs with non-negative weights.
Question 51: What is the primary purpose of a thesis or capstone project in a BCS program?
- To satisfy a minimum credit-hour requirement
- To replace the final exam in all courses
- To fulfill a general education elective requirement
- To demonstrate applied mastery of CS concepts through an independent project (Correct answer)
Correct answer: To demonstrate applied mastery of CS concepts through an independent project
A capstone or thesis project requires students to apply their accumulated CS knowledge to solve a substantial real-world problem.
Question 52: Which graduate-level path most directly extends a BCS degree for someone interested in academic research?
- Master of Science or Ph.D. in Computer Science (Correct answer)
- Master of Business Administration (MBA)
- Master of Fine Arts (MFA)
- Juris Doctor (JD)
Correct answer: Master of Science or Ph.D. in Computer Science
A Master of Science or Ph.D. in Computer Science deepens research skills and provides credentials for academic and R&D careers.
Question 53: In operating systems, what is a race condition?
- A situation where the outcome depends on unpredictable ordering of concurrent operations (Correct answer)
- A CPU scheduling algorithm that favors shorter jobs
- A deadlock involving exactly two processes
- A memory leak caused by dangling pointers
Correct answer: A situation where the outcome depends on unpredictable ordering of concurrent operations
A race condition occurs when multiple threads or processes access shared data concurrently and the final result depends on execution order.
Question 54: What is the difference between a process and a thread?
- Threads are heavyweight; processes are lightweight
- A thread is a unit of execution within a process; processes have separate memory spaces (Correct answer)
- They are identical in all modern operating systems
- Processes share memory; threads do not
Correct answer: A thread is a unit of execution within a process; processes have separate memory spaces
A process has its own separate memory space and resources, while threads within the same process share memory and resources but have separate execution contexts.
Question 55: In graph theory, what is a Hamiltonian path?
- A path that visits every edge exactly once
- A path that returns to the starting vertex
- The shortest path between two vertices
- A path that visits every vertex exactly once (Correct answer)
Correct answer: A path that visits every vertex exactly once
A Hamiltonian path visits every vertex in a graph exactly once; it does not need to return to the starting vertex.
Question 56: What is the role of the OS kernel?
- Manage user applications only
- Manage hardware resources and provide services to user-space programs (Correct answer)
- Provide a graphical interface
- Handle network communication exclusively
Correct answer: Manage hardware resources and provide services to user-space programs
The OS kernel is the core component that manages CPU scheduling, memory, device drivers, file systems, and provides system call interfaces to user-space programs.
Question 57: Which accreditation body specifically evaluates computing programs in the United States?
- ABET (Correct answer)
- NAAB
- ACEN
- AACSB
Correct answer: ABET
ABET (Accreditation Board for Engineering and Technology) accredits computing programs including Computer Science degrees in the US.
Question 58: Which logic gate produces a HIGH output only when all inputs are HIGH?
- NAND gate
- XOR gate
- OR gate
- AND gate (Correct answer)
Correct answer: AND gate
An AND gate outputs HIGH (1) only when every one of its inputs is HIGH (1).
Question 59: What is the purpose of code reviews in software development?
- To generate documentation from code
- To evaluate developer performance for salary decisions
- To find bugs, improve code quality, share knowledge, and ensure coding standards before merging code (Correct answer)
- To automatically test code
Correct answer: To find bugs, improve code quality, share knowledge, and ensure coding standards before merging code
Code reviews allow team members to examine each other's code for bugs, design issues, style violations, and opportunities for improvement before changes are merged.
Question 60: What is the difference between DELETE and TRUNCATE in SQL?
- TRUNCATE can use a WHERE clause; DELETE cannot
- DELETE is for DDL; TRUNCATE is for DML
- They are identical commands
- DELETE removes specific rows with a WHERE clause and is logged; TRUNCATE removes all rows and is faster (Correct answer)
Correct answer: DELETE removes specific rows with a WHERE clause and is logged; TRUNCATE removes all rows and is faster
DELETE removes specific rows (or all rows) with transaction logging, while TRUNCATE removes all rows more efficiently by deallocating data pages and cannot be filtered with WHERE.
Question 61: What is the height of a complete binary tree with n nodes?
- O(log n) (Correct answer)
- O(n)
- O(n²)
- O(√n)
Correct answer: O(log n)
A complete binary tree with n nodes has a height of floor(log₂ n), which is O(log n).
Question 62: Which computing concept describes the minimum number of steps required to solve a problem regardless of the algorithm used?
- Space complexity
- Amortized complexity
- Lower bound complexity (Correct answer)
- Worst-case complexity
Correct answer: Lower bound complexity
Lower bound complexity establishes the theoretical minimum effort any algorithm must expend to solve a given problem.
Question 63: In object-oriented programming, what is encapsulation?
- Creating multiple implementations of the same interface
- Bundling data and methods that operate on that data within a class, restricting direct access from outside (Correct answer)
- Overriding parent class methods
- Inheriting properties from a parent class
Correct answer: Bundling data and methods that operate on that data within a class, restricting direct access from outside
Encapsulation bundles data (attributes) and methods together in a class and restricts external access using access modifiers (private, protected, public).
Question 64: What is a heap data structure primarily used for?
- Balancing binary trees
- Sorting linked lists
- Implementing priority queues (Correct answer)
- Storing key-value pairs
Correct answer: Implementing priority queues
Heaps efficiently implement priority queues by maintaining the heap property to give O(log n) insert/extract-min operations.
Question 65: What is the purpose of the page table in virtual memory management?
- To schedule processes
- To map virtual addresses to physical memory addresses (Correct answer)
- To manage I/O device registers
- To store the process code
Correct answer: To map virtual addresses to physical memory addresses
A page table maintains the mapping between a process's virtual page numbers and the corresponding physical frame numbers in RAM.
Question 66: You create a program that enables you to do several mathematical operations (such as addition, subtraction, multiplication, and division) on a collection of integers taken from a database. <br> The real test results, however, return a random value, which makes you believe that your code contains a randomizing variable.
- Rerunning the code (Correct answer)
- Code Tracing
- Using a code visualizer
- Using DISPLAY statements at different points of code
Correct answer: Rerunning the code
If the test results return a 'random value' and you suspect a 'randomizing variable,' the most direct way to confirm this behavior is to rerun the code multiple times. If the output consistently changes with each execution, it provides strong evidence that a random or non-deterministic element is influencing the results. While other debugging methods can help locate the variable, rerunning the code directly demonstrates the suspected random behavior.
Question 67: What is the CIDR notation for a subnet mask of 255.255.255.0?
- /24 (Correct answer)
- /32
- /16
- /8
Correct answer: /24
255.255.255.0 in binary has 24 consecutive 1-bits in the network portion, represented as /24 in CIDR notation.
Question 68: Which data structure uses LIFO (Last In, First Out) ordering?
- Stack (Correct answer)
- Heap
- Linked List
- Queue
Correct answer: Stack
A stack follows LIFO ordering, where the last element pushed is the first one popped.
Question 69: Which course in a BCS program would specifically address how hardware components interact with software?
- Database Systems
- Human-Computer Interaction
- Software Requirements Engineering
- Computer Organization and Architecture (Correct answer)
Correct answer: Computer Organization and Architecture
Computer Organization and Architecture examines CPU design, memory hierarchy, and how software instructions are executed by hardware.
Question 70: In version control with Git, what does the command 'git rebase' do?
- Merges two branches creating a merge commit
- Moves or replays commits onto a new base commit (Correct answer)
- Reverts the repository to a previous state
- Creates a new branch from the current commit
Correct answer: Moves or replays commits onto a new base commit
Git rebase moves a sequence of commits to begin at a new base commit, creating a linear project history.
Question 71: In graph theory, which algorithm finds the shortest path between all pairs of vertices?
- Bellman-Ford Algorithm
- Prim's Algorithm
- Floyd-Warshall Algorithm (Correct answer)
- Dijkstra's Algorithm
Correct answer: Floyd-Warshall Algorithm
Floyd-Warshall computes shortest paths between every pair of vertices in O(V³) using dynamic programming.
Question 72: In the context of a BCS degree, what is 'computational thinking'?
- The ability to type code faster than average
- Using only mathematical proofs to solve problems
- Memorizing programming language syntax
- A problem-solving approach involving decomposition, pattern recognition, abstraction, and algorithms (Correct answer)
Correct answer: A problem-solving approach involving decomposition, pattern recognition, abstraction, and algorithms
Computational thinking is a structured problem-solving methodology that breaks problems into solvable steps using decomposition, abstraction, and algorithmic design.
Question 73: Which condition is NOT one of the four necessary conditions for deadlock (Coffman conditions)?
- Mutual exclusion
- Circular wait
- Hold and wait
- Preemption (Correct answer)
Correct answer: Preemption
The four Coffman conditions are mutual exclusion, hold and wait, no preemption, and circular wait — preemption being present actually prevents deadlock, not causes it.
Question 74: Which CPU scheduling algorithm may cause starvation for low-priority processes?
- Round Robin
- Shortest Job First
- First-Come First-Served
- Priority Scheduling (Correct answer)
Correct answer: Priority Scheduling
Priority Scheduling can cause starvation when high-priority processes continuously arrive and prevent low-priority processes from ever executing.
Question 75: Which proof technique assumes the negation of what you want to prove and derives a contradiction?
- Direct proof
- Proof by contradiction (Correct answer)
- Proof by induction
- Proof by contrapositive
Correct answer: Proof by contradiction
Proof by contradiction (reductio ad absurdum) assumes ¬P is true and then logically derives a contradiction, thereby proving P must be true.
Question 76: What is a critical section in concurrent programming?
- The most computationally expensive part of the code
- Code that handles hardware interrupts
- A section of memory reserved for the OS
- A segment of code that accesses shared resources and must not be executed by more than one process simultaneously (Correct answer)
Correct answer: A segment of code that accesses shared resources and must not be executed by more than one process simultaneously
A critical section is a code segment that accesses shared data and must execute atomically to prevent race conditions in concurrent systems.
Question 77: Which data structure uses LIFO (Last In, First Out) ordering?
- Queue
- Deque
- Stack (Correct answer)
- Priority Queue
Correct answer: Stack
A Stack follows LIFO ordering where the last element inserted is the first to be removed.
Question 78: Which machine learning technique is used when labeled training data is unavailable?
- Reinforcement Learning
- Unsupervised Learning (Correct answer)
- Transfer Learning
- Supervised Learning
Correct answer: Unsupervised Learning
Unsupervised learning finds patterns in data without labeled examples, using methods like clustering and dimensionality reduction.
Question 79: What does CPU pipelining achieve?
- Executes a single instruction faster by parallelizing its stages
- Increases clock speed by reducing voltage
- Overlaps execution of multiple instructions to improve throughput (Correct answer)
- Stores frequently accessed data closer to the CPU
Correct answer: Overlaps execution of multiple instructions to improve throughput
Pipelining divides instruction execution into stages so multiple instructions can be processed simultaneously, improving throughput.
Question 80: What is a deadlock in operating systems?
- When the OS runs out of virtual memory
- When a process terminates unexpectedly
- When a process uses 100% CPU
- When two or more processes wait indefinitely for resources held by each other (Correct answer)
Correct answer: When two or more processes wait indefinitely for resources held by each other
A deadlock occurs when two or more processes are each waiting for a resource held by another, creating a circular wait with no progress possible.
Question 81: What does the acronym REST stand for in the context of web services?
- Responsive End-to-end Service Technology
- Remote Execution State Transfer
- Representational State Transfer (Correct answer)
- Resource Encapsulation Standard Template
Correct answer: Representational State Transfer
REST stands for Representational State Transfer, an architectural style for distributed hypermedia systems.
Question 82: What is the Agile software development methodology primarily focused on?
- Delivering working software in short iterations with continuous feedback (Correct answer)
- Completing detailed documentation before coding begins
- Following a strict sequential phase-by-phase process
- Maximizing the number of developers on a project
Correct answer: Delivering working software in short iterations with continuous feedback
Agile focuses on iterative development, delivering working software frequently, and responding to change over following a fixed plan.
Question 83: What is the value of the expression ¬(P ∧ Q) when P = True and Q = False?
- True (Correct answer)
- Undefined
- False
- Both True and False
Correct answer: True
P ∧ Q = True ∧ False = False, and ¬False = True, so the expression evaluates to True.
Question 84: What does the term 'thrashing' refer to in operating systems?
- Excessive paging activity where the OS spends more time swapping pages than executing processes (Correct answer)
- CPU overheating under heavy load
- Excessive context switching with no useful work
- Hard disk fragmentation
Correct answer: Excessive paging activity where the OS spends more time swapping pages than executing processes
Thrashing occurs when a system spends more time handling page faults and swapping pages than executing actual process instructions, severely degrading performance.
Question 85: Which concept in computer science refers to the property that a system continues to function correctly even when some components fail?
- Scalability
- Fault tolerance (Correct answer)
- Modularity
- Portability
Correct answer: Fault tolerance
Fault tolerance is the ability of a system to continue operating properly in the event of component failures.
Question 86: Which abstract data type operates on the principle of FIFO?
- Stack
- Queue (Correct answer)
- Graph
- Tree
Correct answer: Queue
A queue follows First In, First Out (FIFO) ordering, where elements are inserted at the rear and removed from the front.
Question 87: What does the OSI model's Transport Layer primarily provide?
- End-to-end communication and error recovery (Correct answer)
- Physical signal transmission
- Routing between networks
- Session establishment
Correct answer: End-to-end communication and error recovery
The Transport Layer (Layer 4) provides end-to-end communication, segmentation, flow control, and error recovery via protocols like TCP.
Question 88: What is the purpose of a Translation Lookaside Buffer (TLB)?
- Cache recent virtual-to-physical address translations to speed up memory access (Correct answer)
- Buffer network packets
- Store recently accessed disk blocks
- Cache CPU instructions
Correct answer: Cache recent virtual-to-physical address translations to speed up memory access
The TLB is a fast hardware cache that stores recent page table entries to avoid slow page table lookups in main memory on every memory access.
Question 89: Which design pattern separates object construction from representation, allowing the same construction process to create different representations?
- Builder pattern (Correct answer)
- Decorator pattern
- Singleton pattern
- Observer pattern
Correct answer: Builder pattern
The Builder pattern separates the construction of a complex object from its representation, allowing different representations to be created through the same process.
Question 90: Which normal form eliminates partial dependencies on composite primary keys?
- First Normal Form (1NF)
- Boyce-Codd Normal Form (BCNF)
- Second Normal Form (2NF) (Correct answer)
- Third Normal Form (3NF)
Correct answer: Second Normal Form (2NF)
2NF requires that the table is in 1NF and that every non-key attribute is fully functionally dependent on the entire composite primary key, not just part of it.
Question 91: The bank will request your phone number when you visit to open a new account so they can link it to your account in the event of an incident. Which of the following best sums up the justification?
- It is done to protect the account from phishing attempts
- It is to alleviate privacy concerns
- It is done to set up multi-factor authentication (Correct answer)
- It is done to set up asymmetric authentication mechanisms
Correct answer: It is done to set up multi-factor authentication
Providing a phone number when opening a new bank account is primarily done to set up multi-factor authentication (MFA). MFA adds an essential layer of security by requiring more than one method of verification, such as a password combined with a one-time code sent to the registered phone. This significantly enhances account protection against unauthorized access, as an attacker would need both the password and access to the phone.
Question 92: What is the time complexity of binary search on a sorted array of n elements?
- O(1)
- O(log n) (Correct answer)
- O(n²)
- O(n)
Correct answer: O(log n)
Binary search repeatedly halves the search space, resulting in O(log n) time complexity.
Question 93: Which cryptographic concept ensures that a sender cannot deny sending a message?
- Confidentiality
- Non-repudiation (Correct answer)
- Integrity
- Availability
Correct answer: Non-repudiation
Non-repudiation uses digital signatures to provide proof of origin so a sender cannot later deny transmitting a message.
Question 94: What is the time complexity of inserting an element into a hash table on average?
- O(1) (Correct answer)
- O(n)
- O(n log n)
- O(log n)
Correct answer: O(1)
Hash table insertion is O(1) on average due to direct address computation via the hash function.
Question 95: What is the primary purpose of a compiler in the software development process?
- To debug and profile application performance
- To translate high-level source code into machine code (Correct answer)
- To manage memory allocation during program execution
- To execute source code line by line at runtime
Correct answer: To translate high-level source code into machine code
A compiler translates entire high-level source code into machine code before program execution.
Question 96: Which layer of the OSI model is responsible for end-to-end communication and error recovery?
- Data Link layer
- Session layer
- Network layer
- Transport layer (Correct answer)
Correct answer: Transport layer
The Transport layer (Layer 4) is responsible for end-to-end communication, error recovery, and flow control between hosts.
Question 97: What is the main advantage of using a hash table over a sorted array for lookups?
- Hash tables offer O(1) average-case lookup (Correct answer)
- Hash tables maintain sorted order automatically
- Hash tables support range queries efficiently
- Hash tables use less memory
Correct answer: Hash tables offer O(1) average-case lookup
Hash tables provide O(1) average-case time for insert, delete, and lookup by computing a direct index from the key.
Question 98: What is the space complexity of a recursive Fibonacci function without memoization?
- O(1)
- O(n²)
- O(2^n)
- O(n) (Correct answer)
Correct answer: O(n)
The recursive call stack grows to depth n, resulting in O(n) space complexity.
Question 99: What is virtual memory?
- Memory used exclusively by the OS kernel
- RAM that has been overclocked
- A technique that uses disk space to extend the apparent available RAM (Correct answer)
- Cache memory on the CPU
Correct answer: A technique that uses disk space to extend the apparent available RAM
Virtual memory uses a portion of the hard disk (swap space or page file) to simulate additional RAM, allowing processes to use more memory than physically available.
Question 100: Which process state transition occurs when a running process is preempted by a higher-priority process?
- Running → Ready (Correct answer)
- Ready → Running
- Running → Blocked
- Blocked → Ready
Correct answer: Running → Ready
When a running process is preempted, it transitions from Running back to Ready, waiting to regain CPU time.
BCS Bachelor of Computer Science
The BCS Bachelor of Computer Science qualification covers core computing principles including data structures, algorithms, database management, and operating systems. It is aligned with BCS Higher Education Qualifications (HEQ) and equivalent to an undergraduate degree in IT.
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