Computer Science & IT MCQ & Objective Questions
Computer Science & IT is a crucial subject for students preparing for school and competitive exams in India. Mastering this field not only enhances your understanding of technology but also significantly boosts your exam scores. Practicing MCQs and objective questions is an effective way to reinforce your knowledge and identify important questions that frequently appear in exams.
What You Will Practise Here
Fundamentals of Computer Science
Data Structures and Algorithms
Operating Systems Concepts
Networking Basics and Protocols
Database Management Systems
Software Engineering Principles
Programming Languages Overview
Exam Relevance
Computer Science & IT is an integral part of the curriculum for CBSE, State Boards, and competitive exams like NEET and JEE. Questions often focus on theoretical concepts, practical applications, and problem-solving skills. Common patterns include multiple-choice questions that test your understanding of key concepts, definitions, and the ability to apply knowledge in various scenarios.
Common Mistakes Students Make
Confusing similar concepts in data structures, such as arrays and linked lists.
Overlooking the importance of algorithms and their time complexities.
Misunderstanding the functions and roles of different operating system components.
Neglecting to practice coding problems, leading to difficulty in programming questions.
Failing to grasp the fundamentals of networking, which can lead to errors in related MCQs.
FAQs
Question: What are the best ways to prepare for Computer Science & IT exams?Answer: Regular practice of MCQs, understanding key concepts, and reviewing past exam papers are effective strategies.
Question: How can I improve my problem-solving skills in Computer Science?Answer: Engage in coding exercises, participate in study groups, and tackle a variety of practice questions.
Start your journey towards mastering Computer Science & IT today! Solve our practice MCQs to test your understanding and enhance your exam preparation. Remember, consistent practice is the key to success!
Q. How many usable IP addresses are available in a subnet with a /29 subnet mask?
Show solution
Solution
A /29 subnet mask provides 8 total addresses, of which 6 are usable for hosts after excluding the network and broadcast addresses.
Correct Answer:
B
— 6
Learn More →
Q. If a binary search algorithm is implemented recursively, what is its space complexity due to recursion?
A.
O(1)
B.
O(log n)
C.
O(n)
D.
O(n log n)
Show solution
Solution
The space complexity of a recursive binary search is O(log n) due to the call stack.
Correct Answer:
B
— O(log n)
Learn More →
Q. If a binary search algorithm is implemented recursively, what is the space complexity?
A.
O(1)
B.
O(log n)
C.
O(n)
D.
O(n log n)
Show solution
Solution
The space complexity is O(log n) due to the recursive call stack.
Correct Answer:
B
— O(log n)
Learn More →
Q. If a binary search algorithm is implemented recursively, what is the space complexity due to recursion?
A.
O(n)
B.
O(log n)
C.
O(1)
D.
O(n log n)
Show solution
Solution
The space complexity of a recursive binary search is O(log n) due to the call stack used for recursion.
Correct Answer:
B
— O(log n)
Learn More →
Q. If a binary search algorithm returns -1, what does it indicate?
A.
The element is found
B.
The element is not in the array
C.
The array is empty
D.
The array is sorted
Show solution
Solution
A return value of -1 typically indicates that the searched element is not present in the array.
Correct Answer:
B
— The element is not in the array
Learn More →
Q. If a binary search is performed on a sorted array of size n, what is the space complexity?
A.
O(1)
B.
O(n)
C.
O(log n)
D.
O(n log n)
Show solution
Solution
The space complexity of binary search is O(1) when implemented iteratively, as it uses a constant amount of space.
Correct Answer:
A
— O(1)
Learn More →
Q. If a binary search is performed on an array of 32 elements, how many iterations will it take in the worst case?
Show solution
Solution
The worst-case number of iterations is log2(32) = 5.
Correct Answer:
C
— 6
Learn More →
Q. If a binary search is performed on an array of size 16, how many comparisons are needed in the worst case?
Show solution
Solution
The maximum number of comparisons needed is log2(16) = 4, but since we start counting from 0, it takes 5 comparisons.
Correct Answer:
D
— 7
Learn More →
Q. If a binary search is performed on an array of size 16, how many comparisons will be made in the worst case?
Show solution
Solution
In the worst case, binary search will make log2(16) = 4 comparisons.
Correct Answer:
D
— 5
Learn More →
Q. If a binary search is performed on an array of size 16, how many comparisons will it take in the worst case?
Show solution
Solution
In the worst case, binary search will take log2(16) = 4 comparisons, but since we start counting from 0, it will take 5 comparisons.
Correct Answer:
D
— 5
Learn More →
Q. If a binary tree has 'n' nodes, what is the maximum height of the tree?
A.
n
B.
log n
C.
n/2
D.
n-1
Show solution
Solution
The maximum height of a binary tree occurs when the tree is skewed (like a linked list), resulting in a height of n.
Correct Answer:
A
— n
Learn More →
Q. If a binary tree has 15 nodes, what is the maximum height of the tree?
Show solution
Solution
The maximum height of a binary tree with 15 nodes occurs when the tree is skewed, which can have a height of 15.
Correct Answer:
D
— 5
Learn More →
Q. If a binary tree has a height of 'h', what is the minimum number of nodes it can have?
A.
h
B.
h + 1
C.
2^h - 1
D.
2^h
Show solution
Solution
The minimum number of nodes in a binary tree of height h is h + 1, which occurs in a skewed tree.
Correct Answer:
B
— h + 1
Learn More →
Q. If a binary tree has a height of h, what is the maximum number of nodes it can have?
A.
2^h - 1
B.
2^h
C.
h^2
D.
h!
Show solution
Solution
The maximum number of nodes in a binary tree of height h is 2^h - 1, which occurs in a complete binary tree.
Correct Answer:
A
— 2^h - 1
Learn More →
Q. If a binary tree has n nodes, what is the maximum number of leaf nodes it can have?
A.
n
B.
n/2
C.
n/3
D.
n/2 + 1
Show solution
Solution
In a binary tree, the maximum number of leaf nodes can be n, which occurs in a degenerate tree.
Correct Answer:
A
— n
Learn More →
Q. If a binary tree is balanced, what is the maximum height of the tree in terms of the number of nodes 'n'?
A.
O(n)
B.
O(log n)
C.
O(n log n)
D.
O(1)
Show solution
Solution
In a balanced binary tree, the maximum height is O(log n), as the tree is structured to minimize height.
Correct Answer:
B
— O(log n)
Learn More →
Q. If a dataset has 200 points and you apply K-means clustering with K=4, how many points will be assigned to each cluster on average?
Show solution
Solution
If K=4 and there are 200 points, on average, each cluster will have 200/4 = 50 points assigned to it.
Correct Answer:
A
— 50
Learn More →
Q. If a device has an IP address of 172.16.5.10 with a subnet mask of 255.255.255.0, what is its network address?
A.
172.16.5.0
B.
172.16.5.10
C.
172.16.0.0
D.
172.16.5.255
Show solution
Solution
The network address is determined by the IP address and subnet mask; for 172.16.5.10/24, the network address is 172.16.5.0.
Correct Answer:
A
— 172.16.5.0
Learn More →
Q. If a graph has 5 vertices and 10 edges, what is the maximum number of edges it can have?
Show solution
Solution
In a simple undirected graph, the maximum number of edges is given by the formula V(V-1)/2, which for 5 vertices is 5(5-1)/2 = 10.
Correct Answer:
C
— 20
Learn More →
Q. If a graph has 5 vertices and 10 edges, what is the maximum number of iterations Dijkstra's algorithm will perform?
Show solution
Solution
Dijkstra's algorithm will perform at most V iterations, where V is the number of vertices. In this case, it will perform 5 iterations.
Correct Answer:
A
— 5
Learn More →
Q. If a graph has 5 vertices and 10 edges, what is the maximum time complexity of Dijkstra's algorithm using an adjacency matrix?
A.
O(10)
B.
O(5^2)
C.
O(5 log 5)
D.
O(10 + 5^2)
Show solution
Solution
Using an adjacency matrix, the time complexity of Dijkstra's algorithm is O(V^2), which in this case is O(5^2) or O(25).
Correct Answer:
B
— O(5^2)
Learn More →
Q. If a graph has 5 vertices and 7 edges, what is the maximum number of edges in a simple undirected graph?
Show solution
Solution
In a simple undirected graph, the maximum number of edges is given by the formula V(V-1)/2. For 5 vertices, it is 5(5-1)/2 = 10.
Correct Answer:
A
— 10
Learn More →
Q. If a graph has 5 vertices and 7 edges, what is the maximum number of edges in a complete graph with 5 vertices?
Show solution
Solution
In a complete graph with V vertices, the maximum number of edges is given by V*(V-1)/2. For 5 vertices, it is 5*(5-1)/2 = 10.
Correct Answer:
A
— 10
Learn More →
Q. If a graph has 5 vertices and 7 edges, what is the maximum number of edges it can have?
Show solution
Solution
In a simple undirected graph, the maximum number of edges is given by the formula V(V-1)/2, which for 5 vertices is 5(5-1)/2 = 10.
Correct Answer:
B
— 15
Learn More →
Q. If a graph has 5 vertices and 7 edges, what is the maximum number of iterations Dijkstra's algorithm will perform?
Show solution
Solution
Dijkstra's algorithm will perform at most V iterations, where V is the number of vertices. In this case, it will perform 5 iterations.
Correct Answer:
A
— 5
Learn More →
Q. If a graph has a cycle, which traversal method can detect it?
A.
Only BFS
B.
Only DFS
C.
Both BFS and DFS
D.
Neither BFS nor DFS
Show solution
Solution
DFS can detect cycles in a graph by keeping track of visited nodes and checking for back edges.
Correct Answer:
B
— Only DFS
Learn More →
Q. If a graph has negative edge weights, which algorithm can be used instead of Dijkstra's algorithm?
A.
Prim's Algorithm
B.
Kruskal's Algorithm
C.
Bellman-Ford Algorithm
D.
Floyd-Warshall Algorithm
Show solution
Solution
The Bellman-Ford algorithm can be used instead of Dijkstra's algorithm when the graph has negative edge weights, as it can handle such cases.
Correct Answer:
C
— Bellman-Ford Algorithm
Learn More →
Q. If a graph has negative weight edges, which algorithm can be used instead of Dijkstra's?
A.
Prim's algorithm
B.
Kruskal's algorithm
C.
Bellman-Ford algorithm
D.
A* algorithm
Show solution
Solution
The Bellman-Ford algorithm can handle graphs with negative weight edges, unlike Dijkstra's algorithm.
Correct Answer:
C
— Bellman-Ford algorithm
Learn More →
Q. If a graph has negative weight edges, which algorithm should be used instead of Dijkstra's algorithm?
A.
Prim's algorithm
B.
Kruskal's algorithm
C.
Bellman-Ford algorithm
D.
Floyd-Warshall algorithm
Show solution
Solution
The Bellman-Ford algorithm should be used instead of Dijkstra's algorithm when the graph has negative weight edges, as it can handle such cases.
Correct Answer:
C
— Bellman-Ford algorithm
Learn More →
Q. If a graph has negative weight edges, which algorithm should be used instead of Dijkstra's?
A.
Prim's algorithm
B.
Kruskal's algorithm
C.
Bellman-Ford algorithm
D.
A* algorithm
Show solution
Solution
The Bellman-Ford algorithm can handle graphs with negative weight edges, unlike Dijkstra's algorithm.
Correct Answer:
C
— Bellman-Ford algorithm
Learn More →
Showing 91 to 120 of 3237 (108 Pages)