D278 ITSW 2113
Scripting & Programming
LATEST FA REVIEW
Q&S
©2024/2025
,1. What is the time complexity of a binary search algorithm in a
sorted array?
- a) O(n)
- b) O(n log n)
- c) O(log n)
- d) O(n^2)
- ANS: c) O(log n)
2. Which of the following data structures is typically used to
implement recursion?
- a) Queue
- b) Stack
- c) Graph
- d) Linked list
- ANS: b) Stack
3. Which of the following statements about Python dictionaries
is true?
©2024/2025
, - a) They are indexed by integers.
- b) They maintain the order of insertion as keys.
- c) They do not allow duplicate keys.
- d) Keys can be mutable.
- ANS: c) They do not allow duplicate keys.
4. In object-oriented programming, which of the following is a
mechanism to achieve encapsulation?
- a) Inheritance
- b) Polymorphism
- c) Abstraction
- d) Encapsulation
- ANS: d) Encapsulation
5. Which of the following is a characteristic of functional
programming?
- a) Statefulness
- b) Immutability
- c) Sequential execution
- d) Object modification
- ANS: b) Immutability
©2024/2025
Scripting & Programming
LATEST FA REVIEW
Q&S
©2024/2025
,1. What is the time complexity of a binary search algorithm in a
sorted array?
- a) O(n)
- b) O(n log n)
- c) O(log n)
- d) O(n^2)
- ANS: c) O(log n)
2. Which of the following data structures is typically used to
implement recursion?
- a) Queue
- b) Stack
- c) Graph
- d) Linked list
- ANS: b) Stack
3. Which of the following statements about Python dictionaries
is true?
©2024/2025
, - a) They are indexed by integers.
- b) They maintain the order of insertion as keys.
- c) They do not allow duplicate keys.
- d) Keys can be mutable.
- ANS: c) They do not allow duplicate keys.
4. In object-oriented programming, which of the following is a
mechanism to achieve encapsulation?
- a) Inheritance
- b) Polymorphism
- c) Abstraction
- d) Encapsulation
- ANS: d) Encapsulation
5. Which of the following is a characteristic of functional
programming?
- a) Statefulness
- b) Immutability
- c) Sequential execution
- d) Object modification
- ANS: b) Immutability
©2024/2025