0% found this document useful (0 votes)
7 views39 pages

Important Questions Python

The document contains a comprehensive set of multiple-choice questions (MCQs) related to Python programming, organized into various sections covering topics such as problem solving, debugging, flowcharts, algorithms, and Python basics. Each section provides questions along with their correct answers, focusing on key concepts and practices in Python programming. This resource is designed for BCA 4th semester students to enhance their understanding and preparation for exams.

Uploaded by

krishthakran5483
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views39 pages

Important Questions Python

The document contains a comprehensive set of multiple-choice questions (MCQs) related to Python programming, organized into various sections covering topics such as problem solving, debugging, flowcharts, algorithms, and Python basics. Each section provides questions along with their correct answers, focusing on key concepts and practices in Python programming. This resource is designed for BCA 4th semester students to enhance their understanding and preparation for exams.

Uploaded by

krishthakran5483
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

IMPORTANT QUESTIONS (MCQ BASED)

BCA 4THSEM | INTRODUCTION TO PYTHON – 0417002

UNIT-I: MCQs (50 Questions with Answers)


Section A: Problem Solving & Program Design
1. What is the first step in problem solving?
A. Coding
B. Testing
C. Problem Definition
D. Debugging
Answer: C
2. A well-defined problem should include:
A. Only input
B. Only output
C. Input and Output
D. None
Answer: C
3. Program design mainly focuses on:
A. Writing syntax
B. Logic development
C. Execution
D. Compilation
Answer: B
4. Which is NOT a problem-solving step?
A. Analysis
B. Design
C. Compilation
D. Implementation
Answer: C
5. Problem solving requires:
A. Logical thinking
B. Memorization
C. Guessing
D. None
Answer: A

Section B: Debugging & Errors


6. Debugging means:
A. Writing code
B. Removing errors
C. Compiling code
D. Executing code
Answer: B
7. Syntax errors occur due to:
A. Wrong logic
B. Wrong syntax
C. Runtime failure
D. Hardware issue
Answer: B
8. Logical errors result in:
A. Program crash
B. Incorrect output
C. Syntax warning
D. Compilation failure
Answer: B
9. Runtime errors occur:
A. During coding
B. During compilation
C. During execution
D. Never
Answer: C
10. Which is hardest to detect?
A. Syntax error
B. Logical error
C. Runtime error
D. All
Answer: B

Section C: Documentation
11. Documentation helps in:
A. Writing code
B. Understanding code
C. Executing code
D. Debugging hardware
Answer: B
12. Internal documentation refers to:
A. Comments in code
B. Manuals
C. Reports
D. Output
Answer: A
13. External documentation includes:
A. Comments
B. User manuals
C. Variables
D. Functions
Answer: B
14. Good documentation improves:
A. Code size
B. Readability
C. Execution speed
D. Errors
Answer: B

Section D: Flowcharts & Algorithms


15. A flowchart is:
A. Graphical representation
B. Code
C. Error
D. Program
Answer: A
16. Oval symbol represents:
A. Process
B. Input/Output
C. Start/End
D. Decision
Answer: C
17. Decision box shape:
A. Rectangle
B. Diamond
C. Oval
D. Circle
Answer: B
18. Algorithm is:
A. Code
B. Step-by-step procedure
C. Error
D. Output
Answer: B
19. Flowchart helps in:
A. Coding
B. Visualization
C. Execution
D. Debugging
Answer: B
20. Algorithm must be:
A. Finite
B. Infinite
C. Random
D. Complex
Answer: A

Section E: Decision Table


21. Decision table is used for:
A. Simple logic
B. Complex conditions
C. Coding
D. Debugging
Answer: B
22. Decision table contains:
A. Conditions & Actions
B. Variables
C. Errors
D. Output only
Answer: A

Section F: Structured Programming


23. Structured programming avoids:
A. Loops
B. GOTO statements
C. Functions
D. Variables
Answer: B
24. Main aim is:
A. Speed
B. Clarity
C. Memory
D. Size
Answer: B
25. Structured programming uses:
A. Sequence
B. Selection
C. Iteration
D. All
Answer: D

Section G: Programming Methodologies


26. Top-down approach starts with:
A. Details
B. Main problem
C. Coding
D. Output
Answer: B
27. Bottom-up approach starts with:
A. Small modules
B. Whole system
C. Output
D. Input
Answer: A
28. Top-down divides into:
A. Modules
B. Errors
C. Output
D. Syntax
Answer: A
29. Bottom-up combines:
A. Modules
B. Errors
C. Code
D. Inputs
Answer: A

Section H: Python Basics


30. Python is:
A. Compiled
B. Interpreted
C. Assembly
D. Machine
Answer: B
31. Python was developed by:
A. Dennis Ritchie
B. James Gosling
C. Guido van Rossum
D. Bjarne Stroustrup
Answer: C
32. Python program executes line by line:
A. True
B. False
Answer: A
33. File extension of Python:
A. .java
B. .py
C. .cpp
D. .exe
Answer: B

Section I: Python Program Structure


34. Which is correct?
A. Indentation matters
B. No indentation needed
C. Only brackets
D. Only semicolons
Answer: A
35. Python uses indentation for:
A. Syntax
B. Structure
C. Both
D. None
Answer: C
36. Entry point in Python:
A. main() required
B. Not required
C. Optional
D. None
Answer: B

Section J: Elements of Python


37. Variable is:
A. Constant
B. Storage location
C. Function
D. Operator
Answer: B
38. Python is dynamically typed:
A. True
B. False
Answer: A
39. Keywords are:
A. Variables
B. Reserved words
C. Functions
D. Values
Answer: B
40. Identifier must not start with:
A. Letter
B. Number
C. Underscore
D. Alphabet
Answer: B

Section K: Memory & Execution


41. Python stores variables in:
A. CPU
B. Memory
C. Disk
D. Cache
Answer: B
42. Garbage collection is:
A. Manual
B. Automatic
C. Not present
D. Error
Answer: B

Section L: Miscellaneous
43. Which is not a programming language?
A. Python
B. HTML
C. Java
D. C++
Answer: B
44. Compiler converts:
A. High-level to machine
B. Machine to high
C. Code to error
D. None
Answer: A
45. Interpreter executes:
A. Whole code
B. Line by line
C. No execution
D. None
Answer: B
46. Which is high-level language?
A. Machine
B. Assembly
C. Python
D. Binary
Answer: C
47. Error-free program is:
A. Buggy
B. Correct
C. Syntax error
D. Runtime error
Answer: B
48. Algorithm should be:
A. Ambiguous
B. Clear
C. Complex
D. Random
Answer: B
49. Flowchart symbol for process:
A. Rectangle
B. Circle
C. Diamond
D. Oval
Answer: A
50. Testing ensures:
A. Code writing
B. Error detection
C. Compilation
D. Design
Answer: B
UNIT-II: Python MCQs (50 Questions with Answers)

Section A: Python Basics & Interpreter


1. Python interpreter is used to:
A. Compile code
B. Execute code line by line
C. Convert to machine code
D. None
Answer: B
2. Python shell is used for:
A. Writing large programs
B. Interactive execution
C. Compilation
D. Debugging only
Answer: B
3. Python can be used as:
A. Calculator
B. Compiler
C. Assembler
D. None
Answer: A
4. Which mode executes one line at a time?
A. Script mode
B. Interactive mode
C. Both
D. None
Answer: B
5. Indentation in Python is used for:
A. Decoration
B. Syntax structure
C. Comments
D. Output
Answer: B

Section B: Identifiers, Keywords, Literals


6. Identifier is:
A. Keyword
B. Variable name
C. Operator
D. Value
Answer: B
7. Which is invalid identifier?
A. var1
B. _name
C. 1value
D. name_1
Answer: C
8. Keywords are:
A. User-defined
B. Reserved words
C. Variables
D. Constants
Answer: B
9. Which is a keyword?
A. define
B. for
C. loop
D. iterate
Answer: B
10. Literal represents:
A. Variable
B. Fixed value
C. Function
D. Operator
Answer: B

Section C: Strings & Data


11. Strings in Python are enclosed in:
A. {}
B. []
C. '' or ""
D. ()
Answer: C
12. Strings are:
A. Mutable
B. Immutable
C. Integer
D. Float
Answer: B

Section D: Operators
13. Arithmetic operator example:
A. +
B. ==
C. and
D. =
Answer: A
14. Relational operator:
A. +
B. ==
C. and
D. =
Answer: B
15. Logical operator:
A. +
B. ==
C. and
D. =
Answer: C
16. Assignment operator:
A. ==
B. =
C. +
D. and
Answer: B
17. Ternary operator syntax:
A. if-else
B. condition ? true : false
C. Python uses if else in one line
D. None
Answer: C
18. Bitwise AND operator:
A. &
B. &&
C. and
D. |
Answer: A
19. Increment operator (++) in Python:
A. Exists
B. Not exists
C. Optional
D. None
Answer: B
20. Expression: 5 // 2 gives:
A. 2.5
B. 2
C. 3
D. 1
Answer: B

Section E: Input & Output


21. Input function in Python:
A. scan()
B. input()
C. read()
D. get()
Answer: B
22. Output function:
A. print()
B. echo()
C. display()
D. show()
Answer: A
23. input() returns:
A. int
B. float
C. string
D. boolean
Answer: C

Section F: Control Statements


24. Conditional statement:
A. loop
B. if
C. function
D. class
Answer: B
25. Loop example:
A. if
B. for
C. print
D. input
Answer: B
26. Infinite loop occurs when:
A. Condition false
B. Condition always true
C. Syntax error
D. Runtime error
Answer: B
27. Exit function:
A. exit()
B. stop()
C. break()
D. quit()
Answer: A

Section G: break, continue, pass


28. break statement:
A. Skip iteration
B. Exit loop
C. Do nothing
D. Repeat loop
Answer: B
29. continue statement:
A. Exit loop
B. Skip current iteration
C. Stop program
D. None
Answer: B
30. pass statement:
A. Exit loop
B. Skip iteration
C. Do nothing
D. Stop program
Answer: C

Section H: Functions
31. Function defined using:
A. func
B. define
C. def
D. function
Answer: C
32. Function returns value using:
A. break
B. return
C. print
D. pass
Answer: B
33. Default argument means:
A. Fixed value
B. Optional parameter
C. Mandatory
D. None
Answer: B
34. Function without return gives:
A. Error
B. None
C. 0
D. False
Answer: B

Section I: Errors & Exceptions


35. Exception is:
A. Syntax error
B. Runtime error
C. Logical error
D. None
Answer: B
36. try block is used for:
A. Loop
B. Exception handling
C. Function
D. Input
Answer: B
37. except block:
A. Handles error
B. Creates error
C. Ignores error
D. None
Answer: A

Section J: Iteration & Recursion


38. Recursion is:
A. Loop
B. Function calling itself
C. Condition
D. Error
Answer: B
39. Iteration uses:
A. Functions
B. Loops
C. Errors
D. Variables
Answer: B
40. Base case in recursion:
A. Infinite loop
B. Stopping condition
C. Error
D. None
Answer: B

Section K: Conditional Execution


41. if statement is:
A. Loop
B. Conditional
C. Function
D. Variable
Answer: B
42. else is used for:
A. Loop
B. Alternate execution
C. Function
D. Error
Answer: B
43. Nested if means:
A. Multiple loops
B. if inside if
C. Function
D. None
Answer: B

Section L: Return Statement


44. return exits:
A. Loop
B. Function
C. Program
D. Condition
Answer: B
45. return can send:
A. Value
B. Variable
C. Expression
D. All
Answer: D

Section M: Miscellaneous
46. Python supports:
A. OOP
B. Functional
C. Procedural
D. All
Answer: D
47. Python is:
A. Case sensitive
B. Case insensitive
C. Both
D. None
Answer: A
48. Indentation error is:
A. Syntax error
B. Logical error
C. Runtime error
D. None
Answer: A
49. “elif” stands for:
A. else if
B. else loop
C. if else
D. none
Answer: A
50. Correct recursion requires:
A. Loop
B. Base condition
C. Variable
D. Operator
Answer: B

UNIT III (Recursion, Strings, Lists) – 50 MCQs

Section A: Recursion Basics


1. Recursion is:
A. Looping technique
B. Function calling itself
C. Conditional execution
D. Iteration
Answer: B
2. Recursion must have:
A. Loop
B. Base case
C. Operator
D. Variable
Answer: B
3. Without base case recursion leads to:
A. Correct output
B. Infinite recursion
C. Syntax error
D. Compilation error
Answer: B
4. Recursive function uses:
A. Stack
B. Queue
C. Array
D. File
Answer: A
5. Factorial is example of:
A. Iteration
B. Recursion
C. Condition
D. Loop
Answer: B
Section B: Stack Diagrams
6. Stack diagram shows:
A. Variables
B. Function calls
C. Errors
D. Output
Answer: B
7. Stack works on:
A. FIFO
B. LIFO
C. Random
D. None
Answer: B
8. Each recursive call creates:
A. New variable
B. New stack frame
C. Loop
D. Output
Answer: B
9. Stack overflow occurs when:
A. Too few calls
B. Too many recursive calls
C. No recursion
D. Syntax error
Answer: B

Section C: Multiple Assignment


10. Multiple assignment means:
A. One variable multiple values
B. Assigning multiple variables at once
C. Loop
D. Condition
Answer: B
11. Example of multiple assignment:
A. a = b
B. a, b = 1, 2
C. a = 1,2
D. b = a
Answer: B
12. Swapping variables uses:
A. Loop
B. Multiple assignment
C. Condition
D. Function
Answer: B

Section D: While Loop


13. while loop is:
A. Conditional loop
B. Function
C. Variable
D. Operator
Answer: A
14. while loop executes until:
A. Condition true
B. Condition false
C. Always
D. Never
Answer: B
15. Infinite loop occurs when:
A. Condition false
B. Condition always true
C. No condition
D. Error
Answer: B
16. Syntax of while loop requires:
A. {}
B. Indentation
C. ;
D. ()
Answer: B

Section E: Tables & 2D Tables


17. Table in Python can be represented using:
A. String
B. List
C. Tuple
D. Set
Answer: B
18. 2D table is:
A. Single list
B. List of lists
C. String
D. Dictionary
Answer: B
19. Accessing element in 2D list uses:
A. [i][j]
B. (i,j)
C. {i,j}
D. <i,j>
Answer: A
20. Example of 2D list:
A. [1,2,3]
B. [[1,2],[3,4]]
C. (1,2)
D. {1,2}
Answer: B

Section F: Strings Basics


21. String is:
A. Primitive
B. Compound data type
C. Operator
D. Function
Answer: B
22. Strings are:
A. Mutable
B. Immutable
C. Integer
D. Float
Answer: B
23. Length of string obtained by:
A. size()
B. count()
C. len()
D. length()
Answer: C

Section G: Traversal & for Loop


24. Traversal means:
A. Changing data
B. Accessing elements one by one
C. Deleting
D. Sorting
Answer: B
25. for loop is used for:
A. Recursion
B. Iteration
C. Condition
D. Function
Answer: B
26. Looping through string uses:
A. while
B. for
C. both
D. none
Answer: C

Section H: String Slicing


27. Slice syntax:
A. [ ]
B. ( )
C. :
D. {}
Answer: C
28. s[1:4] means:
A. index 1 to 4 inclusive
B. index 1 to 3
C. index 0 to 4
D. error
Answer: B
29. s[:] returns:
A. empty
B. full string
C. error
D. first element
Answer: B

Section I: String Comparison


30. String comparison uses:
A. ASCII values
B. Length
C. Index
D. None
Answer: A
31. "abc" < "abd" is:
A. True
B. False
C. Error
D. None
Answer: A
Section J: find() Function
32. find() is used to:
A. Replace string
B. Search substring
C. Delete string
D. Sort string
Answer: B
33. find() returns:
A. Boolean
B. Index
C. String
D. None
Answer: B
34. If substring not found:
A. Error
B. -1
C. 0
D. None
Answer: B

Section K: Lists Basics


35. List is:
A. Immutable
B. Mutable
C. Constant
D. Function
Answer: B
36. List elements are enclosed in:
A. {}
B. []
C. ()
D. <>
Answer: B
37. List can store:
A. Same type
B. Different types
C. Only integers
D. Only strings
Answer: B

Section L: List Operations


38. Length of list:
A. size()
B. len()
C. count()
D. length()
Answer: B
39. List traversal uses:
A. for loop
B. while loop
C. both
D. none
Answer: C

Section M: Advanced Concepts


40. Recursion vs iteration difference:
A. No difference
B. Recursion uses function calls
C. Iteration uses stack
D. None
Answer: B
41. Stack memory stores:
A. Variables
B. Function calls
C. Output
D. Errors
Answer: B

Section N: Mixed Concept Questions


42. Nested list means:
A. Single list
B. List inside list
C. Tuple
D. String
Answer: B
43. Python indexing starts from:
A. 1
B. 0
C. -1
D. None
Answer: B
44. Negative index means:
A. Error
B. Reverse indexing
C. Loop
D. None
Answer: B
45. s[-1] gives:
A. First element
B. Last element
C. Error
D. None
Answer: B

Section O: Practical Understanding


46. while True creates:
A. Error
B. Infinite loop
C. Function
D. Output
Answer: B
47. Recursive depth depends on:
A. Loop
B. Stack size
C. Variable
D. Operator
Answer: B
48. Multiple assignment improves:
A. Speed
B. Readability
C. Errors
D. Memory
Answer: B
49. 2D list used for:
A. Table representation
B. Loop
C. Function
D. Error
Answer: A
50. Strings can be traversed using:
A. for loop
B. while loop
C. both
D. none
Answer: C
UNIT IV : Lists + OOP – 50 MCQs

Section A: Looping & Counting


1. Loop is used for:
A. Decision making
B. Repetition
C. Storage
D. Input
Answer: B
2. Counting in loops refers to:
A. Storing values
B. Tracking iterations
C. Sorting
D. Deleting
Answer: B
3. Which loop is best for counting?
A. if
B. while
C. for
D. def
Answer: C
4. Counter variable is:
A. Fixed
B. Changes each iteration
C. Constant
D. None
Answer: B

Section B: List Basics


5. List is:
A. Immutable
B. Mutable
C. Constant
D. Function
Answer: B
6. List elements are enclosed in:
A. {}
B. []
C. ()
D. <>
Answer: B
7. List can store:
A. Only integers
B. Same type
C. Different types
D. Only strings
Answer: C

Section C: Accessing Elements


8. List indexing starts from:
A. 1
B. 0
C. -1
D. None
Answer: B
9. Negative indexing means:
A. Error
B. Reverse indexing
C. Loop
D. None
Answer: B
10. list[0] gives:
A. Last element
B. First element
C. Middle
D. Error
Answer: B

Section D: List Length & Membership


11. Length of list:
A. size()
B. len()
C. count()
D. length()
Answer: B
12. Membership operator:
A. ==
B. in
C. =
D. &
Answer: B
13. "x in list" checks:
A. Index
B. Presence
C. Length
D. Type
Answer: B

Section E: Lists and for Loop


14. List traversal uses:
A. if
B. for loop
C. def
D. class
Answer: B
15. Looping through list returns:
A. Index
B. Values
C. Both
D. None
Answer: B
16. range() is used with:
A. while
B. for
C. def
D. class
Answer: B

Section F: List Operations


17. append() is used to:
A. Delete element
B. Add element
C. Sort list
D. Reverse
Answer: B
18. insert() adds element at:
A. End
B. Specific position
C. Start only
D. Random
Answer: B
19. remove() deletes:
A. Index
B. Value
C. All
D. None
Answer: B
20. pop() removes:
A. First
B. Last
C. Middle
D. Random
Answer: B

Section G: List Deletion


21. del keyword is used to:
A. Add
B. Delete
C. Sort
D. Reverse
Answer: B
22. del list[1] deletes:
A. First element
B. Second element
C. Last
D. All
Answer: B

Section H: Cloning Lists


23. Cloning means:
A. Copying list
B. Deleting list
C. Sorting
D. Reversing
Answer: A
24. list1 = list2 creates:
A. Copy
B. Reference
C. Error
D. None
Answer: B
25. [Link]() creates:
A. Reference
B. New list
C. Error
D. None
Answer: B

Section I: Nested Lists


26. Nested list means:
A. Single list
B. List inside list
C. Tuple
D. String
Answer: B
27. Access nested list:
A. list[i]
B. list[i][j]
C. list(i,j)
D. list{i,j}
Answer: B
28. Example of nested list:
A. [1,2,3]
B. [[1,2],[3,4]]
C. (1,2)
D. {1,2}
Answer: B

Section J: OOP Basics


29. OOP stands for:
A. Object Oriented Programming
B. Open Operation Program
C. Object Organized Program
D. None
Answer: A
30. Class is:
A. Object
B. Blueprint
C. Variable
D. Function
Answer: B
31. Object is:
A. Function
B. Instance of class
C. Loop
D. Variable
Answer: B

Section K: Classes & Objects


32. Class defined using:
A. def
B. class
C. function
D. object
Answer: B
33. Object creation:
A. class()
B. def()
C. variable()
D. None
Answer: A
34. self refers to:
A. Class
B. Object
C. Function
D. Variable
Answer: B

Section L: Methods
35. Method is:
A. Variable
B. Function inside class
C. Loop
D. Operator
Answer: B
36. Constructor method:
A. init()
B. init()
C. start()
D. create()
Answer: B

Section M: Standard Libraries


37. Library is:
A. Function
B. Collection of modules
C. Variable
D. Class
Answer: B
38. math module is:
A. Library
B. Function
C. Operator
D. Class
Answer: A
39. import keyword is used for:
A. Loop
B. Module loading
C. Function
D. Class
Answer: B

Section N: Advanced Understanding


40. len(list) returns:
A. Elements
B. Length
C. Index
D. Value
Answer: B
41. List slicing uses:
A. :
B. []
C. ()
D. {}
Answer: A
42. list[::-1] does:
A. Sort
B. Reverse
C. Delete
D. Copy
Answer: B

Section O: Mixed Questions


43. append() adds element at:
A. Start
B. End
C. Middle
D. Random
Answer: B
44. remove() fails if:
A. Element present
B. Element absent
C. List empty
D. None
Answer: B
45. Nested loop is used for:
A. Single list
B. 2D list
C. String
D. Function
Answer: B

Section P: Practical Understanding


46. list + list means:
A. Add elements
B. Concatenation
C. Multiply
D. Delete
Answer: B
47. list * 2 means:
A. Double values
B. Repeat list
C. Error
D. None
Answer: B
48. class contains:
A. Methods
B. Variables
C. Both
D. None
Answer: C
49. Object interacts using:
A. Functions
B. Methods
C. Loops
D. Variables
Answer: B
50. Python supports OOP:
A. Yes
B. No
C. Partial
D. None
Answer: A

UNIT V: Data Structures + Searching & Sorting (50 MCQs)

Section A: Arrays & Lists


1. Array is:
A. Collection of same type elements
B. Mixed elements
C. Function
D. Operator
Answer: A
2. Python list is:
A. Fixed size
B. Dynamic
C. Immutable
D. Constant
Answer: B
3. Array index starts from:
A. 1
B. 0
C. -1
D. None
Answer: B
4. List allows:
A. Same type only
B. Different types
C. No values
D. Fixed values
Answer: B

Section B: Sets
5. Set is:
A. Ordered
B. Unordered
C. Indexed
D. Mutable string
Answer: B
6. Set does not allow:
A. Integers
B. Duplicates
C. Strings
D. Floats
Answer: B
7. Set is defined using:
A. []
B. ()
C. {}
D. <>
Answer: C
8. Set elements are:
A. Ordered
B. Unique
C. Indexed
D. Sorted
Answer: B

Section C: Stack
9. Stack follows:
A. FIFO
B. LIFO
C. Random
D. None
Answer: B
10. Stack operations:
A. push, pop
B. add, delete
C. insert, remove
D. none
Answer: A
11. push means:
A. Remove element
B. Add element
C. Search
D. Sort
Answer: B
12. pop means:
A. Add
B. Remove
C. Search
D. None
Answer: B

Section D: Queue
13. Queue follows:
A. LIFO
B. FIFO
C. Random
D. None
Answer: B
14. Queue operations:
A. push, pop
B. enqueue, dequeue
C. add, remove
D. none
Answer: B
15. enqueue means:
A. Remove
B. Add
C. Search
D. Sort
Answer: B
16. dequeue removes from:
A. End
B. Front
C. Middle
D. Random
Answer: B

Section E: Searching Techniques


17. Linear search checks:
A. First element only
B. All elements
C. Last element only
D. Middle only
Answer: B
18. Linear search complexity:
A. O(1)
B. O(n)
C. O(log n)
D. O(n²)
Answer: B
19. Binary search requires:
A. Unsorted list
B. Sorted list
C. Random list
D. None
Answer: B
20. Binary search complexity:
A. O(n)
B. O(log n)
C. O(n²)
D. O(1)
Answer: B

Section F: Binary Search Logic


21. Binary search works by:
A. Checking all elements
B. Dividing list
C. Sorting
D. Looping
Answer: B
22. Middle index formula:
A. (low + high) / 2
B. low + high
C. high - low
D. none
Answer: A

Section G: Sorting Basics


23. Sorting means:
A. Searching
B. Arranging data
C. Deleting
D. Adding
Answer: B
24. Sorted order can be:
A. Ascending
B. Descending
C. Both
D. None
Answer: C

Section H: Bubble Sort


25. Bubble sort compares:
A. Random elements
B. Adjacent elements
C. First and last
D. None
Answer: B
26. Bubble sort complexity:
A. O(n)
B. O(n²)
C. O(log n)
D. O(1)
Answer: B
27. Bubble sort is:
A. Fastest
B. Simplest
C. Complex
D. None
Answer: B
Section I: Selection Sort
28. Selection sort selects:
A. Maximum
B. Minimum
C. Random
D. Both
Answer: B
29. Selection sort complexity:
A. O(n)
B. O(n²)
C. O(log n)
D. O(1)
Answer: B
30. Selection sort swaps:
A. Adjacent
B. Minimum with first
C. Random
D. None
Answer: B

Section J: Insertion Sort


31. Insertion sort builds:
A. Sorted list step by step
B. Random list
C. Reverse list
D. None
Answer: A
32. Insertion sort complexity:
A. O(n²)
B. O(n)
C. O(log n)
D. O(1)
Answer: A
33. Insertion sort compares:
A. All elements
B. Previous elements
C. Next elements
D. None
Answer: B

Section K: Advanced Concepts


34. Best case of insertion sort:
A. O(n)
B. O(n²)
C. O(log n)
D. O(1)
Answer: A
35. Worst case of bubble sort:
A. O(n)
B. O(n²)
C. O(log n)
D. O(1)
Answer: B

Section L: Comparison Questions


36. Fastest search method:
A. Linear
B. Binary
C. Bubble
D. Selection
Answer: B
37. Binary search cannot work on:
A. Sorted list
B. Unsorted list
C. Array
D. List
Answer: B

Section M: Data Structure Behaviour


38. Stack top element accessed by:
A. Bottom
B. Top
C. Middle
D. None
Answer: B
39. Queue insertion occurs at:
A. Front
B. Rear
C. Middle
D. None
Answer: B

Section N: Python Concepts


40. Python list behaves like:
A. Array
B. Stack
C. Queue
D. All
Answer: D
41. set() removes:
A. Duplicates
B. Values
C. Index
D. None
Answer: A

Section O: Practical Questions


42. Searching element in unsorted list:
A. Binary
B. Linear
C. Bubble
D. Selection
Answer: B
43. Sorting required for binary search:
A. Yes
B. No
C. Optional
D. None
Answer: A

Section P: Final Concepts


44. Bubble sort swaps when:
A. Ordered
B. Unordered
C. Equal
D. None
Answer: B
45. Selection sort reduces:
A. Comparisons
B. Swaps
C. Memory
D. None
Answer: B

Section Q: Mixed Questions


46. Stack overflow occurs when:
A. Empty
B. Full
C. Half
D. None
Answer: B
47. Queue underflow occurs when:
A. Empty
B. Full
C. Half
D. None
Answer: A
48. Best case of linear search:
A. O(n)
B. O(1)
C. O(log n)
D. O(n²)
Answer: B
49. Worst case of linear search:
A. O(n)
B. O(1)
C. O(log n)
D. O(n²)
Answer: A
50. Sorting improves:
A. Searching speed
B. Memory
C. Code
D. None
Answer: A

You might also like