BCS Bachelor of Computer Science — Questions and Answers
Question 1: What is the best-case time complexity of Insertion Sort?
- O(1)
- O(n log n)
- O(n²)
- O(n) (Correct answer)
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 2: Which graph algorithm detects negative weight cycles?
- Bellman-Ford algorithm (Correct answer)
- Prim's algorithm
- Kruskal's algorithm
- Dijkstra'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 3: What is the time complexity of inserting an element into a hash table on average?
- O(n log n)
- O(n)
- O(log n)
- O(1) (Correct answer)
Correct answer: O(1)
Hash table insertion is O(1) on average due to direct address computation via the hash function.
Question 4: Dynamic programming is best used when a problem exhibits which two properties?
- Recursion and backtracking
- Overlapping subproblems and optimal substructure (Correct answer)
- Divide and conquer and memoization
- Greedy choice and optimal substructure
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 5: What does the term 'thrashing' refer to in operating systems?
- Hard disk fragmentation
- CPU overheating under heavy load
- Excessive context switching with no useful work
- Excessive paging activity where the OS spends more time swapping pages than executing processes (Correct answer)
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 6: What is the Model-View-Controller (MVC) architectural pattern?
- A database design methodology
- A network communication protocol
- A testing framework for web applications
- A pattern separating an application into Model (data), View (UI), and Controller (logic) components (Correct answer)
Correct answer: A pattern separating an application into Model (data), View (UI), and Controller (logic) components
MVC separates an application into three components: Model (data and business logic), View (user interface presentation), and Controller (handles input and updates the model).
Question 7: Which graduate-level path most directly extends a BCS degree for someone interested in academic research?
- Master of Fine Arts (MFA)
- Master of Business Administration (MBA)
- Juris Doctor (JD)
- Master of Science or Ph.D. in Computer Science (Correct answer)
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 8: What does NAT (Network Address Translation) primarily accomplish?
- Assigns static IP addresses to devices
- Maps private IP addresses to a public IP address (Correct answer)
- Encrypts all outbound traffic
- Filters incoming packets by port
Correct answer: Maps private IP addresses to a public IP address
NAT allows multiple devices with private IP addresses to share a single public IP address when communicating over the internet.
Question 9: Which programming paradigm treats computation as the evaluation of mathematical functions and avoids changing state?
- Procedural Programming
- Object-Oriented Programming
- Event-Driven Programming
- Functional Programming (Correct answer)
Correct answer: Functional Programming
Functional programming emphasizes pure functions, immutability, and avoids side effects or shared state.
Question 10: What does SQL JOIN do?
- Merges two databases into one
- Deletes duplicate rows
- Creates a new table from query results
- 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 11: What is the time complexity of binary search on a sorted array of n elements?
- O(n)
- O(1)
- O(log n) (Correct answer)
- O(n²)
Correct answer: O(log n)
Binary search repeatedly halves the search space, resulting in O(log n) time complexity.
Question 12: What is a design pattern in software engineering?
- A specific coding language syntax rule
- A reusable solution to a commonly occurring problem in software design (Correct answer)
- A type of software testing framework
- A mandatory coding standard imposed by a company
Correct answer: A reusable solution to a commonly occurring problem in software design
A design pattern is a proven, reusable template that describes how to solve a recurring design problem in a specific context within software systems.
Question 13: Which quantifier asserts that a property holds for all elements in the domain?
- Unique quantifier (∃!)
- Bounded quantifier
- Universal quantifier (∀) (Correct answer)
- Existential quantifier (∃)
Correct answer: Universal quantifier (∀)
The universal quantifier ∀ (for all) asserts that the given predicate is true for every element in the specified domain.
Question 14: What is context switching in an operating system?
- Switching between user accounts
- Switching between kernel and user mode
- Saving the state of a running process and restoring the state of another process (Correct answer)
- Changing network configurations
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 a critical section in concurrent programming?
- Code that handles hardware interrupts
- A section of memory reserved for the OS
- The most computationally expensive part of the code
- 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 16: Which cryptographic protocol is used to secure communications over a computer network in HTTPS?
- TLS/SSL (Correct answer)
- FTP
- SMTP
- SSH
Correct answer: TLS/SSL
TLS (Transport Layer Security), formerly SSL, encrypts data transmitted over HTTPS connections.
Question 17: What is the space complexity of a recursive Fibonacci function without memoization?
- O(2^n)
- O(1)
- O(n²)
- O(n) (Correct answer)
Correct answer: O(n)
The recursive call stack grows to depth n, resulting in O(n) space complexity.
Question 18: What data structure is typically used to implement Breadth-First Search (BFS)?
- Heap
- Array
- Stack
- Queue (Correct answer)
Correct answer: Queue
BFS uses a queue to process nodes level by level in FIFO order.
Question 19: What type of file system does Linux primarily use?
- FAT32
- NTFS
- HFS+
- ext4 (Correct answer)
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 20: Which of the following best describes a deadlock in an operating system?
- A memory overflow causing a system crash
- A scheduling priority inversion between two threads
- A process consuming 100% CPU indefinitely
- A set of processes each waiting for a resource held by another in the set (Correct answer)
Correct answer: A set of processes each waiting for a resource held by another in the set
Deadlock occurs when a group of processes are permanently blocked because each holds a resource that another process in the group needs.
Question 21: Which data structure uses LIFO (Last In, First Out) ordering?
- Queue
- Linked List
- Stack (Correct answer)
- Heap
Correct answer: Stack
A stack follows LIFO ordering, where the last element pushed is the first one popped.
Question 22: What is a deadlock in operating systems?
- When a process terminates unexpectedly
- When the OS runs out of virtual memory
- 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 23: What is the difference between DELETE and TRUNCATE in SQL?
- They are identical commands
- DELETE is for DDL; TRUNCATE is for DML
- TRUNCATE can use a WHERE clause; DELETE cannot
- 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 24: What is the height of a complete binary tree with n nodes?
- O(n)
- O(√n)
- O(log n) (Correct answer)
- 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 25: In Round Robin scheduling, what parameter determines how long each process runs before being preempted?
- Priority value
- Time quantum (Correct answer)
- Burst time
- Arrival time
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 26: What is the purpose of a Translation Lookaside Buffer (TLB)?
- Buffer network packets
- Cache CPU instructions
- Cache recent virtual-to-physical address translations to speed up memory access (Correct answer)
- Store recently accessed disk blocks
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 27: What property must a min-heap satisfy?
- Every parent is less than or equal to its children (Correct answer)
- All leaves are at the same level
- Every parent is greater than its children
- Left child is always smaller than right child
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 28: What is the role of the OS kernel?
- Manage hardware resources and provide services to user-space programs (Correct answer)
- Handle network communication exclusively
- Manage user applications only
- Provide a graphical interface
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 29: In software engineering, what is the purpose of the 'Agile' development methodology?
- To document requirements exhaustively before implementation
- To complete all planning before any coding begins
- To separate development and operations teams for efficiency
- To deliver working software incrementally through iterative development (Correct answer)
Correct answer: To deliver working software incrementally through iterative development
Agile focuses on iterative development, delivering working software in short cycles called sprints with continuous feedback.
Question 30: In the context of OS, what is a semaphore?
- A memory management unit
- A type of file system
- A synchronization primitive used to control access to shared resources (Correct answer)
- A hardware interrupt signal
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 31: Which algorithm finds the shortest path in a weighted graph with non-negative edge weights?
- Bellman-Ford
- Dijkstra's algorithm (Correct answer)
- Floyd-Warshall
- Prim's algorithm
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.
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