Bachelor of Software Engineering (B.S.W.E.) Comprehensive Exit Exam — Questions and Answers
Question 1: Which transport layer protocol provides reliable, ordered, and error-checked delivery of data?
- ICMP
- TCP (Correct answer)
- UDP
- ARP
Correct answer: TCP
TCP (Transmission Control Protocol) establishes a connection and guarantees reliable, ordered data delivery with flow control and error checking.
Question 2: What is the time complexity of merge sort in all cases?
- O(log n)
- O(n log n) (Correct answer)
- O(n²)
- O(n)
Correct answer: O(n log n)
Merge sort guarantees O(n log n) in best, average, and worst cases because it always divides the array in half and merges linearly.
Question 3: What is Inter-Process Communication (IPC)?
- A protocol for network communication between servers
- A hardware interrupt mechanism
- Mechanisms that allow processes to exchange data and synchronize actions (Correct answer)
- A method for CPUs to communicate with GPUs
Correct answer: Mechanisms that allow processes to exchange data and synchronize actions
IPC refers to OS mechanisms—such as pipes, message queues, shared memory, and sockets—that allow separate processes to communicate and coordinate.
Question 4: What is a heap data structure?
- Unstructured dynamic memory
- A complete binary tree satisfying the heap property where each parent is greater or smaller than its children (Correct answer)
- A sorted doubly linked list
- A hash table with priority-based ordering
Correct answer: A complete binary tree satisfying the heap property where each parent is greater or smaller than its children
A heap is a complete binary tree where each parent is greater (max-heap) or smaller (min-heap) than its children, commonly used to implement priority queues.
Question 5: What is dynamic programming?
- Real-time data stream processing
- An optimization technique solving problems by breaking them into overlapping subproblems and caching results (Correct answer)
- Programming that modifies itself at runtime
- A programming paradigm like object-oriented design
Correct answer: An optimization technique solving problems by breaking them into overlapping subproblems and caching results
Dynamic programming solves problems by breaking them into overlapping subproblems, storing results (memoization) to avoid redundant computation.
Question 6: Which SQL aggregate function returns the number of rows matching a condition?
- COUNT() (Correct answer)
- SUM()
- MAX()
- AVG()
Correct answer: COUNT()
COUNT() returns the number of rows that match a specified condition or the total rows in a result set.
Question 7: What does ORM stand for in software development?
- Object Relational Mapping (Correct answer)
- Open Resource Management
- Object Response Method
- Optimized Read Model
Correct answer: Object Relational Mapping
Object Relational Mapping (ORM) converts data between object-oriented programming languages and relational databases automatically.
Question 8: In file systems, what is an inode?
- An entry in the directory listing of a file
- A block of data storing file contents
- A virtual device driver for storage
- A data structure storing metadata about a file (permissions, size, timestamps) but not the file name (Correct answer)
Correct answer: A data structure storing metadata about a file (permissions, size, timestamps) but not the file name
An inode is a data structure in Unix-like file systems that contains metadata about a file, such as ownership, permissions, size, and pointers to data blocks, but not the filename itself.
Question 9: What is a deadlock in operating systems?
- CPU overheating under maximum load
- A system crash caused by hardware failure
- A corrupted file system requiring repair
- A situation where processes wait indefinitely for resources held by each other (Correct answer)
Correct answer: A situation where processes wait indefinitely for resources held by each other
A deadlock occurs when two or more processes are permanently blocked, each waiting for resources that are held by the other.
Question 10: Which data structure provides O(1) average-case time complexity for both insertion and lookup?
- Binary search tree
- Linked list
- Hash table (Correct answer)
- Heap
Correct answer: Hash table
A hash table uses a hash function to map keys to buckets, achieving O(1) average time for insert and lookup operations.
Question 11: What is the time complexity of inserting an element at the beginning of an array?
- O(n) (Correct answer)
- O(1)
- O(log n)
- O(n²)
Correct answer: O(n)
Inserting at the beginning of an array requires shifting all n existing elements one position to the right, resulting in O(n) time.
Question 12: What is the three-way handshake in TCP?
- A method for exchanging encryption keys in TLS
- A three-step process for closing a TCP connection gracefully
- A three-step process (SYN, SYN-ACK, ACK) for establishing a TCP connection between client and server (Correct answer)
- A three-packet process for sending large files over TCP
Correct answer: A three-step process (SYN, SYN-ACK, ACK) for establishing a TCP connection between client and server
The TCP three-way handshake establishes a connection: the client sends SYN, the server responds with SYN-ACK, and the client sends ACK to confirm.
Question 13: What is a context switch in operating systems?
- The process of saving the state of a running process and loading the state of another process (Correct answer)
- Changing the priority of a running process
- Switching between user mode and kernel mode
- Changing the CPU's instruction set architecture at runtime
Correct answer: The process of saving the state of a running process and loading the state of another process
A context switch is when the OS saves the current process state (registers, program counter) and restores a previously saved state to run a different process.
Question 14: What is a foreign key in a relational database?
- A field referencing the primary key of another table (Correct answer)
- A primary key in a different format
- A unique identifier generated automatically
- An encrypted key for secure access
Correct answer: A field referencing the primary key of another table
A foreign key is a column that establishes a referential link between two tables by pointing to the primary key of another table.
Question 15: What is polymorphism in object-oriented programming?
- Hiding implementation details inside a class using access modifiers
- The ability to inherit from multiple parent classes simultaneously
- The ability of different objects to respond to the same interface in different ways (Correct answer)
- Converting one primitive data type into another automatically
Correct answer: The ability of different objects to respond to the same interface in different ways
Polymorphism allows objects of different types to be treated through a common interface, with each type providing its own implementation of the expected behavior.
Question 16: What is a SQL injection attack?
- Overloading a database server with excessive queries
- Inserting malicious SQL code into an input field to manipulate or exploit a database (Correct answer)
- Intercepting SQL queries in transit over the network
- Injecting malware into a SQL Server installation
Correct answer: Inserting malicious SQL code into an input field to manipulate or exploit a database
SQL injection occurs when an attacker inserts malicious SQL statements into an input field that is directly incorporated into a database query, allowing unauthorized data access or manipulation.
Question 17: What distinguishes breadth-first search (BFS) from depth-first search (DFS)?
- BFS only works on trees; DFS only works on graphs
- BFS visits all neighbors at the current level before going deeper; DFS goes as deep as possible first (Correct answer)
- BFS uses a stack; DFS uses a queue
- BFS visits nodes randomly; DFS visits them sorted
Correct answer: BFS visits all neighbors at the current level before going deeper; DFS goes as deep as possible first
BFS explores a graph level by level using a queue, visiting all nodes at depth d before any node at depth d+1.
Question 18: What does the CAP theorem state about distributed databases?
- Compression, Authentication, and Performance are the key metrics
- Consistency, Availability, and Partition tolerance cannot all be guaranteed simultaneously (Correct answer)
- Create, Access, and Persist define the fundamental database operations
- Caching, Archiving, and Processing are the core database operations
Correct answer: Consistency, Availability, and Partition tolerance cannot all be guaranteed simultaneously
The CAP theorem states that a distributed system can only guarantee two of three properties: Consistency, Availability, and Partition tolerance.
Question 19: What is a deadlock in database systems?
- When a database server goes offline
- When two or more transactions wait indefinitely for each other's locks (Correct answer)
- When a query takes too long to execute
- When a database runs out of storage space
Correct answer: When two or more transactions wait indefinitely for each other's locks
A deadlock occurs when two or more transactions each hold a lock the other needs, causing all of them to wait indefinitely.
Question 20: What is the purpose of a semaphore in concurrent programming?
- To schedule CPU time for kernel threads
- To allocate memory dynamically
- To detect memory leaks at runtime
- To control access to a shared resource by multiple threads or processes (Correct answer)
Correct answer: To control access to a shared resource by multiple threads or processes
A semaphore is a synchronization primitive that controls access to shared resources by maintaining a counter and using wait/signal operations.
Question 21: What is the primary advantage of a layered architecture?
- Faster performance
- Separation of concerns with clear layer responsibilities (Correct answer)
- Reduced number of classes
- Easier database access
Correct answer: Separation of concerns with clear layer responsibilities
Layered architecture separates concerns across presentation, business logic, and data layers, making systems easier to maintain and test.
Question 22: What is the correct distinction between concurrency and parallelism?
- Concurrency uses multiple processors; parallelism uses a single processor with interleaving
- Concurrency is about managing multiple tasks; parallelism is about executing multiple tasks simultaneously (Correct answer)
- They are synonymous terms used interchangeably in modern computing
- Concurrency applies only to I/O-bound work; parallelism applies only to CPU-bound work
Correct answer: Concurrency is about managing multiple tasks; parallelism is about executing multiple tasks simultaneously
Concurrency structures a program to handle multiple tasks (possibly interleaved on one core), while parallelism actually runs multiple tasks at the exact same time across multiple processors.
Question 23: Which SQL command removes a table and all its data permanently?
- DROP (Correct answer)
- DELETE
- REMOVE
- TRUNCATE
Correct answer: DROP
DROP TABLE removes the entire table structure along with all its data and the schema definition from the database.
Question 24: What is code coverage in software testing?
- How many developers reviewed the code
- The total number of test cases written
- The elapsed time to run the full test suite
- The percentage of source code executed during test runs (Correct answer)
Correct answer: The percentage of source code executed during test runs
Code coverage measures the percentage of source code lines, branches, or paths that are actually executed when the test suite runs.
Question 25: What is Dijkstra's algorithm used for?
- Searching for values in binary trees
- Finding the shortest path from a source to all nodes in a weighted graph (Correct answer)
- Lossless data compression
- Sorting arrays in ascending order
Correct answer: Finding the shortest path from a source to all nodes in a weighted graph
Dijkstra's algorithm finds the shortest path from a source node to all other nodes in a weighted graph with non-negative edge weights.
Question 26: Analysis and design document generation is the process of _______.
- Reverse engineering (Correct answer)
- Software re-engineering
- Software engineering
- Re-engineering
Correct answer: Reverse engineering
Reverse engineering is the process of analyzing a system to understand its components, interrelationships, and design, often by working backward from an existing product. This frequently involves generating design and analysis documents from existing code or systems to comprehend their structure and functionality.
Question 27: What property defines a binary search tree (BST)?
- A sorted array is stored as a tree structure
- Only leaf nodes contain data values
- Every node must have exactly two children
- Left subtree values are smaller and right subtree values are larger than each node (Correct answer)
Correct answer: Left subtree values are smaller and right subtree values are larger than each node
A BST ensures each node's left subtree contains only smaller values and the right subtree contains only larger values, enabling O(log n) average search.
Question 28: Which software process model is best suited for projects with well-understood, stable requirements?
- Agile/Scrum
- Spiral model
- Extreme Programming
- Waterfall model (Correct answer)
Correct answer: Waterfall model
The Waterfall model works best when requirements are fully known and unlikely to change because it follows a rigid sequential phase structure.
Question 29: What is the main difference between TCP and UDP?
- TCP is reliable with acknowledgments; UDP is faster but unreliable (Correct answer)
- TCP is wireless; UDP is wired
- TCP is for video streaming; UDP is for text
- TCP uses IPv6; UDP uses IPv4
Correct answer: TCP is reliable with acknowledgments; UDP is faster but unreliable
TCP provides reliable, ordered, error-checked delivery with acknowledgments, while UDP is connectionless and faster but offers no delivery guarantees.
Question 30: What data structure uses LIFO (Last In, First Out) ordering?
- Linked List
- Binary Tree
- Queue
- Stack (Correct answer)
Correct answer: Stack
A stack uses LIFO ordering where the last element pushed is the first one popped, like a stack of plates.
Question 31: What is memoization in algorithm design?
- A specific memory allocation strategy for performance
- Writing inline code documentation and comments
- Caching the results of function calls to avoid redundant computation on repeated inputs (Correct answer)
- A debugging technique for tracing variable values
Correct answer: Caching the results of function calls to avoid redundant computation on repeated inputs
Memoization stores the results of expensive function calls so that when the same inputs occur again, the cached result is returned immediately.
Bachelor of Software Engineering (B.S.W.E.) Comprehensive Exit Exam
The B.S.W.E. exit exam assesses graduating software engineering students across core computing disciplines including algorithms, data structures, operating systems, computer networks, database systems, and software engineering principles.
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