Docsity

CE181 CEOE Computer Science Exam, Exams of Technology

Toggle sidebar
bg1
CE181 CEOE Computer Science Exam
Question 1. Which data structure uses LIFO (Last In, First Out) principle?
A) Queue
B) Stack
C) Array
D) Linked list
Answer: B
Explanation: A stack operates on the LIFO principle, meaning the last element added is the first to be
removed.
Question 2. Which sorting algorithm has the average case time complexity of O(n log n)?
A) Bubble Sort
B) Insertion Sort
C) Merge Sort
D) Selection Sort
Answer: C
Explanation: Merge Sort consistently has an average and worst-case time complexity of O(n log n),
making it efficient for large datasets.
Question 3. In object-oriented programming, which principle hides the internal state of an object?
A) Inheritance
B) Encapsulation
C) Polymorphism
D) Abstraction
Answer: B
Explanation: Encapsulation involves hiding the internal details of an object and exposing only necessary
interfaces.
Question 4. Which SDLC model emphasizes iterative development with incremental releases?
A) Waterfall
B) V-Model
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b
pf3c
pf3d
pf3e
pf3f
pf40
pf41
pf42
pf43
pf44
pf45
pf46
pf47

Partial preview of the text

Download CE181 CEOE Computer Science Exam and more Exams Technology in PDF only on Docsity!

Question 1. Which data structure uses LIFO (Last In, First Out) principle? A) Queue B) Stack C) Array D) Linked list Answer: B Explanation: A stack operates on the LIFO principle, meaning the last element added is the first to be removed. Question 2. Which sorting algorithm has the average case time complexity of O(n log n)? A) Bubble Sort B) Insertion Sort C) Merge Sort D) Selection Sort Answer: C Explanation: Merge Sort consistently has an average and worst-case time complexity of O(n log n), making it efficient for large datasets. Question 3. In object-oriented programming, which principle hides the internal state of an object? A) Inheritance B) Encapsulation C) Polymorphism D) Abstraction Answer: B Explanation: Encapsulation involves hiding the internal details of an object and exposing only necessary interfaces. Question 4. Which SDLC model emphasizes iterative development with incremental releases? A) Waterfall B) V-Model

C) Spiral D) Agile Answer: D Explanation: Agile methodology promotes iterative and incremental development, allowing for flexibility and continuous feedback. Question 5. Which control structure is used to execute a block of code repeatedly based on a condition? A) if-else B) for loop C) switch-case D) break Answer: B Explanation: A for loop executes a block of code multiple times depending on the specified condition. Question 6. Which programming language feature allows a function to call itself? A) Loop B) Recursion C) Polymorphism D) Encapsulation Answer: B Explanation: Recursion occurs when a function calls itself to solve a problem by breaking it into smaller subproblems. Question 7. Which data type is used to store textual data in most programming languages? A) int B) float C) string D) boolean Answer: C

B) Binary C) Hexadecimal D) Octal Answer: B Explanation: The binary number system is base 2, using only digits 0 and 1. Question 12. How is the hexadecimal number 1A converted to decimal? A) 26 B) 16 C) 10 D) 20 Answer: A Explanation: 1A in hex = (1 × 16) + (10 × 1) = 16 + 10 = 26. Question 13. Which data encoding scheme assigns a unique number to each character? A) ASCII B) JPEG C) MPEG D) MP Answer: A Explanation: ASCII assigns unique numeric codes to characters for text representation. Question 14. Which data structure provides fast access to elements via keys? A) Array B) Hash table C) Linked list D) Stack Answer: B Explanation: Hash tables provide quick retrieval of data based on key-value pairs.

Question 15. In a linked list, what is the primary advantage over an array? A) Random access B) Dynamic size and efficient insertions/deletions C) Fixed size D) Better cache performance Answer: B Explanation: Linked lists allow dynamic memory allocation and efficient insertions/deletions but do not support fast random access. Question 16. Which sorting algorithm is generally considered the most efficient for large datasets? A) Bubble Sort B) Quick Sort C) Selection Sort D) Insertion Sort Answer: B Explanation: Quick Sort has an average case of O(n log n) and performs well on large datasets. Question 17. Which programming paradigm emphasizes functions and immutability? A) Procedural B) Object-oriented C) Functional D) Logic Answer: C Explanation: Functional programming emphasizes the use of pure functions and immutability. Question 18. Which phase of SDLC involves defining what the software should do? A) Design B) Requirements gathering

Explanation: 'w' mode opens a file for writing and overwrites existing content. Question 22. What is the primary purpose of the ALU in the CPU? A) Fetch instructions B) Control data flow C) Perform arithmetic and logical operations D) Store data temporarily Answer: C Explanation: The Arithmetic Logic Unit (ALU) performs all arithmetic and logical operations. Question 23. Which type of memory is typically used to cache data closer to the CPU for faster access? A) RAM B) Cache C) Hard drive D) ROM Answer: B Explanation: Cache memory is faster and used to store frequently accessed data close to the CPU. Question 24. Which number system is used in digital electronics for compact data representation? A) Decimal B) Binary C) Octal D) Hexadecimal Answer: D Explanation: Hexadecimal provides a compact way to represent binary data, especially in digital electronics. Question 25. What is the main advantage of using a binary number system in computers? A) Easy to understand

B) Simplifies circuit design using two states C) Compatible with decimal arithmetic D) Supports more data types Answer: B Explanation: Binary simplifies digital circuit design because it only involves two states (0 and 1). Question 26. Which data structure is best suited for implementing a priority queue? A) Array B) Stack C) Heap D) Linked list Answer: C Explanation: A heap is an efficient data structure for implementing priority queues. Question 27. Which algorithmic technique involves solving a problem by dividing it into subproblems? A) Dynamic programming B) Divide and conquer C) Greedy D) Backtracking Answer: B Explanation: Divide and conquer involves breaking a problem into smaller subproblems, solving each recursively. Question 28. Which programming paradigm is based on the concept of objects containing data and methods? A) Procedural B) Object-oriented C) Functional D) Logical

Question 32. Which data type is used to represent true or false values? A) int B) boolean C) string D) float Answer: B Explanation: Boolean data type stores only two values: True or False. Question 33. Which file mode is used to append data to an existing file in Python? A) 'r' B) 'w' C) 'a' D) 'x' Answer: C Explanation: 'a' mode opens a file for appending, adding data to the end without truncating. Question 34. Which component of the CPU performs arithmetic operations? A) Control unit B) Register C) ALU D) Cache Answer: C Explanation: The ALU (Arithmetic Logic Unit) performs arithmetic and logical operations. Question 35. Which type of memory is used for the main working memory in a computer? A) Cache B) RAM C) ROM D) Hard disk

Answer: B Explanation: RAM (Random Access Memory) is the primary memory used for active data and program execution. Question 36. Binary addition 1011 + 1101 results in what binary number? A) 11000 B) 10100 C) 11100 D) 10000 Answer: C Explanation: 1011 + 1101 = 11100 in binary, similar to decimal addition with carry-over. Question 37. Which data structure is most suitable for implementing a depth-first search? A) Queue B) Stack C) Heap D) Array Answer: B Explanation: Depth-first search uses a stack (either explicitly or via recursion) to keep track of traversal. Question 38. Which programming principle promotes code reusability by creating new classes from existing ones? A) Encapsulation B) Inheritance C) Polymorphism D) Abstraction Answer: B Explanation: Inheritance allows new classes to reuse and extend existing classes.

C) float() D) toInt() Answer: B Explanation: The int() function converts a string representing a number into an integer. Question 43. Which file mode in Python is used to create a new file and write data? A) 'r' B) 'w' C) 'a' D) 'x' Answer: D Explanation: 'x' mode creates a new file; if the file exists, it raises an error. Question 44. Which component of the CPU is responsible for temporarily storing data during processing? A) Cache B) Register C) RAM D) Hard drive Answer: B Explanation: Registers are small, fast storage locations within the CPU used during processing. Question 45. Which number system is most compact for representing large binary data? A) Decimal B) Octal C) Hexadecimal D) Binary Answer: C Explanation: Hexadecimal provides a compact and human-readable representation of binary data.

Question 46. Which data structure allows sequential access to elements with dynamic resizing? A) Array B) List C) Stack D) Queue Answer: B Explanation: Lists (e.g., Python lists) allow dynamic resizing and sequential access. Question 47. Which algorithmic technique is used in Dijkstra’s algorithm for shortest paths? A) Dynamic programming B) Greedy C) Divide and conquer D) Backtracking Answer: B Explanation: Dijkstra's algorithm uses a greedy approach to find the shortest path in a weighted graph. Question 48. Which concept in object-oriented programming allows objects of different classes to be treated as instances of a common superclass? A) Encapsulation B) Inheritance C) Polymorphism D) Abstraction Answer: C Explanation: Polymorphism enables different classes to be treated uniformly via shared superclass interfaces. Question 49. Which SDLC model involves iterative development with risk analysis at each cycle? A) Waterfall

Question 53. Which number system is base 8? A) Decimal B) Octal C) Hexadecimal D) Binary Answer: B Explanation: Octal is base 8, using digits 0-7. Question 54. How is the decimal number 255 represented in hexadecimal? A) FF B) 100 C) EE D) 0xFF Answer: A Explanation: 255 in decimal converts to FF in hexadecimal. Question 55. Which component in computer architecture manages the communication between the CPU and peripherals? A) Memory controller B) I/O controller C) ALU D) Control unit Answer: B Explanation: The I/O controller manages data transfer between the CPU and input/output devices. Question 56. Which sorting algorithm repeatedly swaps adjacent elements to sort a list? A) Bubble Sort B) Merge Sort

C) Quick Sort D) Heap Sort Answer: A Explanation: Bubble Sort compares and swaps adjacent elements, gradually moving larger elements to the end. Question 57. Which programming paradigm uses facts and rules to derive conclusions? A) Procedural B) Object-oriented C) Functional D) Logic Answer: D Explanation: Logic programming, like Prolog, uses facts and rules to infer new information. Question 58. In Agile development, which practice involves continuous feedback from users? A) Waterfall B) Sprint reviews C) Requirement gathering D) Coding Answer: B Explanation: Sprint reviews in Agile allow stakeholders to provide ongoing feedback. Question 59. Which phase of SDLC focuses on creating detailed design specifications? A) Requirements gathering B) Design C) Implementation D) Testing Answer: B Explanation: The design phase involves creating detailed specifications for development.

B) Octal C) Hexadecimal D) Binary Answer: C Explanation: Hexadecimal is compact and aligns well with binary data, making it suitable for programming. Question 64. Which data structure maintains elements in the order of insertion and allows duplicates? A) Set B) List C) Dictionary D) Heap Answer: B Explanation: Lists maintain order and allow duplicates, unlike sets. Question 65. Which algorithmic approach is used in Kruskal’s algorithm? A) Divide and conquer B) Greedy C) Dynamic programming D) Backtracking Answer: B Explanation: Kruskal’s algorithm uses a greedy approach to find the minimum spanning tree. Question 66. Which concept in object-oriented programming enables objects to have different behaviors based on their class? A) Encapsulation B) Inheritance C) Polymorphism D) Abstraction

Answer: C Explanation: Polymorphism allows objects of different classes to be treated through a common interface with different behaviors. Question 67. Which SDLC model is especially suitable for projects with changing requirements? A) Waterfall B) Spiral C) V-Model D) Sequential Answer: B Explanation: Spiral model emphasizes iterative development, accommodating changing requirements. Question 68. Which control structure is used for selecting among multiple options? A) if-else B) switch-case C) for D) while Answer: B Explanation: 'switch-case' allows selection among multiple discrete options. Question 69. In Python, which statement is used to handle multiple exceptions? A) try-except B) try-except-else C) try-except-finally D) All of the above Answer: D Explanation: All these construct handle exceptions, with 'try-except-finally' adding cleanup code. Question 70. Which data type is used to represent true or false in most programming languages?