UPPSC Polytechnic Lecturer 2021 Previous Year Questions (PYQs) with Solutions
Real questions from the UPPSC Polytechnic Lecturer 2021 paper, solved. Every question below shows its options, the correct answer, and a full text solution — free to read, no login needed. Open any question to practice it interactively inside its course.
- Questions:
- 197
- With solutions:
- 196
- Tagged UPPSC Polytechnic Lecturer 2021 in the bank:
- 345
- Q1.UPPSC 2021
A point P(5, 1) is rotated by 90° about a pivot point (2, 2). What is the coordinate of new transformed point P′ ?
- A.
(3, 5)
- B.
(5, 3)
- C.
(2, 4)
- D.
(1, 5)
Correct answer: A
Solution
Key insight: To rotate a point about a pivot, first translate the point so the pivot is at the origin, apply the rotation, then translate back.
Step 1: Translate the point by subtracting the pivot: (5, 1) − (2, 2) = (3, −1).
Step 2: Rotate 90° counterclockwise using the rule (x, y) → (−y, x): (3, −1) → (1, 3).
Step 3: Translate back by adding the pivot: (1, 3) + (2, 2) = (3, 5).
Final answer: (3, 5).
- A.
- Q2.UPPSC 2021
The following postfix expression with single digit operands is evaluated using a stack:
8 2 3 ^ / 2 3 * + 5 1 * -Note that ^ is the exponentiation operator. After the first * operator has been evaluated, the top two stack elements, listed from top to bottom, are:
- A.
6, 1
- B.
5, 7
- C.
3, 2
- D.
1, 5
Correct answer: A
Solution
Concept: A postfix (Reverse Polish) expression is evaluated with one stack by scanning tokens from left to right. Each operand is pushed when encountered.
For a binary operator, pop the top value as b and the next value as a, compute a op b, and push the result. The order matters for subtraction, division, and exponentiation; the current stack after any token prefix is the complete evaluation state at that point.
Application: Process the expression only through the first multiplication, recording the stack from bottom to top after each token.
Push 8 → stack: [8]
Push 2 → stack: [8, 2]
Push 3 → stack: [8, 2, 3]
'^' pops b = 3 and a = 2, computes 2 cubed (23) = 8 → push 8 → stack: [8, 8]
'/' pops b = 8 and a = 8, computes a/b = 8/8 = 1 → push 1 → stack: [1]
Push 2 → stack: [1, 2]
Push 3 → stack: [1, 2, 3]
First '*' pops b = 3 and a = 2, computes a×b = 2×3 = 6 → push 6 → stack: [1, 6]
Result: The stack is [1, 6] from bottom to top, so its top two values listed from top to bottom are 6, 1.
Cross-check: Pair each postfix operator with its two preceding operands to obtain ((8 / 2 cubed) + (2×3)) − (5×1). Direct evaluation gives (8/8 + 6) − 5 = (1 + 6) − 5 = 2. The two subexpressions completed before '+' are 8/2 cubed = 1 and 2×3 = 6, independently confirming that immediately after the first '*' the stack is [1, 6] from bottom to top.
A video solution is available for this question — log in and enroll to watch it.
- A.
- Q3.UPPSC 2021
Which is the public key cryptographic algorithm among the following?
- A.
Diffie–Hellman key agreement protocol
- B.
Key generation algorithm
- C.
Signalling algorithm
- D.
None of the above
Correct answer: A
Solution
Diffie–Hellman is a public-key key agreement (key exchange) protocol used to let two parties securely establish a shared secret over an insecure channel. Purpose: Establish a shared secret (typically used to derive symmetric keys) rather than directly encrypting or signing messages.
A video solution is available for this question — log in and enroll to watch it.
- A.
- Q4.UPPSC 2021
Which type of routing protocol uses the shortest path first algorithm?
- A.
Distance vector
- B.
Link state
- C.
Hybrid
- D.
Sliding window
Correct answer: B
Solution
The Shortest Path First (SPF) algorithm is also known as Dijkstra’s algorithm , which is used by Link State routing protocols such as OSPF
A video solution is available for this question — log in and enroll to watch it.
- A.
- Q5.UPPSC 2021
For solving complex software problems, the best project team is —
- A.
Closed paradigm
- B.
Open paradigm
- C.
Random paradigm
- D.
Synchronous paradigm
Correct answer: B
Solution
For complex software problems, the Open paradigm team is considered best because: It enables free and frequent communication among team members, improving problem understanding.
Members can share ideas openly, encouraging creativity and diverse solutions.Collaboration is flexible and adaptive, allowing the team to respond quickly to changing requirements.
This approach supports scalable, iterative problem-solving suitable for large, complex, and dynamic projects.
- A.
- Q6.UPPSC 2021
Which of the following is not a logical database structure?
- A.
Tree
- B.
Relation
- C.
Network
- D.
Chain
Correct answer: D
Solution
Definition: Logical database structures define how data is organized and how relationships between data items are represented and accessed. Common logical database models include: Tree structure — hierarchical parent–child organization (used in hierarchical databases).
- A.
- Q7.UPPSC 2021
If relation R has X tuples and relation S has Y tuples, then the result of join on relation R and S will have up to _______ tuples.
- A.
X/Y
- B.
X*Y
- C.
X+Y
- D.
X-Y
Correct answer: B
Solution
For two relations R(X tuples) and S(Y tuples) : The maximum number of tuples in a join result is obtained in a Cartesian product , which yields X × Y tuples.
Natural join or equi-join will produce ≤ X × Y , but the maximum possible is X × Y .
- A.
- Q8.UPPSC 2021
What is the worst-case time complexity of search operation on unordered and ordered list using linear search algorithm respectively?
- A.
O(n) and O(1)
- B.
O(n) and O(log n)
- C.
O(n) and O(n)
- D.
O(log n) and O(log n)
Correct answer: C
Solution
Using linear search : 1️⃣ Unordered list: You may need to check every element in the worst case. ➡ Worst-case time = O(n) 2️⃣ Ordered list: Even though the list is sorted, linear search still checks elements one by one until the key is found or list ends. ➡ Worst-case time = O(n) Thus for unordered and ordered lists respectively: ➡ O(n) and O(n)
- A.
- Q9.UPPSC 2021
A functional dependency X → Y is trivial, if —
- A.
X ⊂ Y
- B.
X ⊇ Y
- C.
X ≠ Y
- D.
None of the above
Correct answer: B
Solution
A functional dependency X → Y is trivial when: ➡ Y is a subset of X That means: ✔ All attributes of Y are already contained in X This is written as: ➡ X ⊇ Y Therefore, the dependency is trivial.
- A.
- Q10.UPPSC 2021
An original intelligible message fed into the algorithm as input is known as ________, while the coded message produced as output is called the ________.
- A.
decryption, encryption
- B.
plain text, cipher text
- C.
deciphering, enciphering
- D.
cipher, plain text
Correct answer: B
Solution
The original readable message given as input is called Plain Text .
The coded/encoded message produced as output is called Cipher Text .
A video solution is available for this question — log in and enroll to watch it.
- A.
- Q11.UPPSC 2021
TCL commands are —
- A.
SELECT and INSERT
- B.
GRANT and REVOKE
- C.
UPDATE and TRUNCATE
- D.
COMMIT and ROLLBACK
Correct answer: D
Solution
TCL stands for Transaction Control Language . TCL commands manage transactions in a database. The two main TCL commands are: COMMIT — saves the transaction permanently
ROLLBACK — undoes the transaction
- A.
- Q12.UPPSC 2021
Which of the following is the correct recurrence relation related to the complexity of binary search?
- A.
T(n) = T(n/2) + O(n)
- B.
T(n) = T(n/2) + 1
- C.
T(n) = 2T(n/2) + O(n)
- D.
T(n) = 2T(n/2) + 1
Correct answer: B
Solution
Key idea: Binary search halves the search space each step and does only constant work (a few comparisons) at each step.
One recursive call on n/2
Plus constant-time work (comparison), i.e., Θ(1)
Base case: T(1) = Θ(1)
Therefore the recurrence is:
T(n) = T(n/2) + Θ(1)
Quick derivation by unfolding:
T(n) = T(n/2) + 1 = T(n/4) + 2 = ... = T(n/2^k) + k
Stop when n/2^k = 1, so k = log2 n. Hence T(n) = T(1) + log2 n = Θ(log n).
Master theorem confirmation:
a = 1, b = 2 so n^{log_b a} = n^0 = 1; f(n) = Θ(1). This matches the case that yields Θ(log n).
Conclusion: The correct recurrence for binary search is T(n) = T(n/2) + Θ(1), which solves to Θ(log n).
Why the other recurrences are not appropriate:
T(n) = T(n/2) + O(n): Implies linear extra work per level, not constant, so it does not describe binary search.
T(n) = 2T(n/2) + O(n): Describes algorithms that recurse on both halves and do linear merging work (e.g., mergesort), giving higher complexity.
T(n) = 2T(n/2) + 1: Two recursive calls process both halves and lead to Θ(n) overall, not the logarithmic behavior of binary search.
- A.
- Q13.UPPSC 2021
What is the output of the following program? #include <stdio.h> void f00 (int *P) { *P = 200; } int main() { int a = 100; f00(&a); printf("%d", a); return 0; }
- A.
100
- B.
200
- C.
Compile time error
- D.
Runtime error
Correct answer: B
Solution
Answer: 200 — the program prints 200. In main(), variable a is initialized to 100.
- A.
- Q14.UPPSC 2021
There are 5 cities in a network. The cost of building a road directly between i & j is the entry C(i, j) in the matrix C below. An infinite entry indicates that there is a mountain in the way and so a road cannot be built. The least cost of making all the cities reachable from each other is —
C(i, j)
1
2
3
4
5
1
0
3
5
11
9
2
3
0
3
9
8
3
5
3
0
∞
10
4
11
9
∞
0
7
5
9
8
10
7
0
- A.
18
- B.
21
- C.
23
- D.
None of the above
Correct answer: B
Solution
A Minimum Spanning Tree (MST) of a connected weighted graph is a subset of edges that connects every vertex using the minimum possible total edge weight, contains no cycles, and uses exactly (number of vertices − 1) edges. Kruskal's algorithm builds an MST greedily: sort all edges by weight and repeatedly add the smallest remaining edge, skipping any edge that would create a cycle, until every vertex is connected.
For the 5 cities, list every usable edge (finite entries only) with its weight and sort by increasing cost:
(1-2) = 3
(2-3) = 3
(1-3) = 5
(4-5) = 7
(2-5) = 8
(2-4) = 9
(1-5) = 9
(3-5) = 10
(1-4) = 11
The edge (3-4) is not usable, since C(3, 4) = ∞.
Apply Kruskal's rule, adding an edge only if it does not close a cycle:
Add (1-2) = 3 — connects {1, 2}.
Add (2-3) = 3 — connects {1, 2, 3}.
Skip (1-3) = 5 — both endpoints are already in {1, 2, 3}, so adding it would form a cycle.
Add (4-5) = 7 — connects {4, 5}.
Add (2-5) = 8 — the smallest remaining edge that joins the two separate groups {1, 2, 3} and {4, 5}.
Stop — 4 edges have now been added for 5 vertices, so every city is in one connected component.
Total MST cost = 3 + 3 + 7 + 8 = 21.
Cross-check: the tree uses exactly 5 − 1 = 4 edges and every city — 1, 2, 3, 4, 5 — appears in the final connected set, confirming it is a valid spanning tree. No cheaper alternative exists: the only other edges crossing between {1, 2, 3} and {4, 5} at this stage were (1-5) = 9 and (3-5) = 10, both costlier than the chosen (2-5) = 8, and every unchosen edge inside a single group only closes a cycle, so 21 cannot be improved.
Therefore, the least cost of making all cities reachable from each other is 21.
- A.
- Q15.UPPSC 2021
Which one of the following is the restriction of indirect addressing?
- A.
Page-size ≤ 2ᵏ
- B.
Page-size ≤ 2ᵏ⁻¹
- C.
Page-size ≥ 2ᵏ
- D.
Page-size ≥ 2ᵏ⁻¹
Correct answer: B
Solution
Key idea: indirect addressing uses part of the address field to indicate indirection, reducing the bits available for the page offset.
If the address space has k bits, normally up to 2ᵏ addresses are representable.
Indirect addressing consumes one bit to indicate indirection, leaving k−1 bits available for the actual offset/page addressing.
Therefore the maximum page size is 2ᵏ⁻¹, so the restriction is:
Conclusion: Page-size ≤ 2ᵏ⁻¹. This ensures the indirect address fits within the available bits.
- A.
- Q16.UPPSC 2021
Which of the following does not reside in the activation record block of a function?
- A.
Global variable
- B.
Local variable with non-static scope
- C.
Pointers to activation record block of parent function
- D.
Function return information
Correct answer: A
Solution
An activation record (stack frame) of a function contains: Local variables (non-static)
Return address
Control link / pointer to caller's activation record
Temporary values
But global variables are not stored in the activation record because they are stored in a separate data segment , not on the stack. Therefore, global variables do not reside in the activation record block.
- A.
- Q17.UPPSC 2021
Consider the following set of functional dependencies on the schema (A, B, C). A → BC, B → C, A → B, AB → C. Then the canonical cover for this set is —
- A.
A → BC and B → C
- B.
A → BC and A → B
- C.
A → BC and AB → C
- D.
A → B and B → C
Correct answer: D
Solution
Split A → BC into two dependencies: A → B and A → C .
We now have: A → B, A → C, B → C, AB → C.
Check AB → C : it is implied by B → C (so AB → C is redundant ) — remove it.
Check A → C : since A → B and B → C hold, A → C is implied by transitivity (A→B and B→C ⇒ A→C). So A → C is redundant — remove it.
Remaining minimal set (canonical cover) is { A → B, B → C } , which is equivalent to the original set.
- A.
- Q18.UPPSC 2021
A digital computer has a common bus system for 16 registers of 32 bits each. Bus is constructed with multiplexers. The number of selection inputs in each multiplexer is ______.
- A.
8
- B.
5
- C.
4
- D.
None of the above
Correct answer: C
Solution
A multiplexer with n selection inputs can select 2ⁿ inputs. We need to select one of 16 registers, so 2ⁿ = 16 → n = log₂16 = 4 . Hence, each multiplexer needs 4 selection inputs .
- A.
- Q19.UPPSC 2021
If a transaction is aborted during its active state, it will go in a —
- A.
Failed state
- B.
Terminated state
- C.
Committed state
- D.
Partially committed state
Correct answer: A
Solution
Concept: A DBMS transaction moves through a fixed set of states. On the success path it goes Active -> Partially Committed -> Committed. On the failure path, any error while Active (or Partially Committed) pushes it into the Failed state; from Failed, a rollback runs and it then reaches Aborted, finally settling in Terminated.
Application: Here the abort/error happens while the transaction is still in the Active state -- the exact trigger for the failure path above. So it moves immediately into the Failed state; only after the subsequent rollback does it reach Aborted/Terminated.
Terminated state -- this is the last stage of the lifecycle, reached only once rollback (after a failure) or a commit has fully completed; it is not the state entered the instant the abort occurs.
Committed state -- only reached when a transaction finishes all operations successfully and those changes are made permanent; an abort rules this out entirely.
Partially committed state -- only reached once every operation has executed successfully but before commit is finalised; it belongs to the success path, so an abort during Active execution never reaches it.
So an abort during the Active state takes the transaction to the Failed state.
- A.
- Q20.UPPSC 2021
Which of the following is not a part of the built-in security of the JVM?
- A.
Class loaders
- B.
Servlets
- C.
Byte code verifier
- D.
Security manager
Correct answer: B
Solution
JVM’s built-in security components include: Class Loader → controls how classes are loaded & prevents unauthorized loading
Bytecode Verifier → checks correctness & prevents malicious code
Security Manager → enforces runtime permissions (file access, network access, etc.)
Servlets , however, are not part of the JVM security model. Servlets are part of Java EE (server-side web technology) and run on a servlet container, not inside JVM’s core security architecture.
A video solution is available for this question — log in and enroll to watch it.
- A.
- Q21.UPPSC 2021
A binary tree T has 64 leaf nodes. The number of nodes of degree 2 in T is —
- A.
64
- B.
log₂ 64
- C.
63
- D.
32
Correct answer: C
Solution
The correct option is C (63).
Explanation
In any binary tree, there is a strict relationship between the number of leaf nodes (nodes with 0 children) and the number of nodes with degree 2 (nodes with 2 children).
Let:
n₀ = number of leaf nodes (degree 0)
n₁ = number of nodes with exactly 1 child (degree 1)
n₂ = number of nodes with exactly 2 children (degree 2)
The total number of nodes (N) is:
N = n₀ + n₁ + n₂
In any tree, the total number of edges (E) is one less than the total number of nodes:
E = N - 1
Therefore,
E = n₀ + n₁ + n₂ - 1
We can also count edges based on the number of children:
Each degree 0 node contributes 0 edges.
Each degree 1 node contributes 1 edge.
Each degree 2 node contributes 2 edges.
Hence,
E = n₁ + 2n₂
Equating both expressions for E:
n₀ + n₁ + n₂ - 1 = n₁ + 2n₂
Subtracting n₁ and n₂ from both sides:
n₀ - 1 = n₂
Conclusion
For any binary tree:
n₂ = n₀ - 1
That is, the number of nodes with two children is always exactly one less than the number of leaf nodes.
Given:
n₀ = 64Therefore:
n₂ = 64 - 1 = 63
Hence, the correct answer is C (63).
- A.
- Q22.UPPSC 2021
Which of the following table contains the primary information in the data warehouse?
- A.
Primary table
- B.
Dimension table
- C.
Lookup table
- D.
Fact table
Correct answer: D
Solution
Fact table stores the primary business data (measurements, numeric facts).
Other tables (dimension, lookup) only describe the facts.
✔ Therefore, the fact table contains the primary information.
- A.
- Q23.UPPSC 2021
Which of the following clause has a <group condition>?
- A.
Select
- B.
From
- C.
Group By
- D.
Having
Correct answer: D
Solution
Group By groups the rows.
Having applies conditions on groups (group condition).
✔ Therefore, <group condition> is used in HAVING clause.
A video solution is available for this question — log in and enroll to watch it.
- A.
- Q24.UPPSC 2021
What is the number of comparisons required by an algorithm that repeatedly finds and removes the current maximum element (i.e., partial selection sort) to find the fourth largest element in the given input list of 'n' elements?
- A.
2n – 3
- B.
2n – 4
- C.
2n – 5
- D.
2(2n – 5)
Correct answer: D
Solution
The stem specifies that the algorithm repeatedly finds and removes the current maximum element (this is the well-known partial-selection-sort approach). Finding the maximum of m elements by pairwise comparison always takes exactly m − 1 comparisons, so each successive pass over the shrinking list costs one comparison less than the pass before it.
Pass 1: scan all n elements and find the maximum (the 1st largest) — this takes n − 1 comparisons. Remove it from consideration.
Pass 2: scan the remaining n − 1 elements and find their maximum (the 2nd largest) — this takes n − 2 comparisons. Remove it.
Pass 3: scan the remaining n − 2 elements and find their maximum (the 3rd largest) — this takes n − 3 comparisons. Remove it.
Pass 4: scan the remaining n − 3 elements and find their maximum (the 4th largest) — this takes n − 4 comparisons.
Total comparisons = (n − 1) + (n − 2) + (n − 3) + (n − 4) = 4n − 10 = 2(2n − 5).
In general, finding the k-th largest this way needs (n − 1) + (n − 2) + … + (n − k) = k(2n − k − 1)/2 comparisons. Substituting k = 4 gives 4(2n − 5)/2 = 2(2n − 5), matching the total above. As a check with a small case, n = 5 and k = 4: the formula gives 4×5 − 10 = 10 comparisons, the same as counting the four passes directly (4 + 3 + 2 + 1 = 10).
So the number of comparisons required to find the 4th largest element is 2(2n − 5).
- A.
- Q25.UPPSC 2021
Code Red is a —
- A.
Anti virus
- B.
Photo editing software
- C.
Computer worm
- D.
Video editing software
Correct answer: C
Solution
Code Red was a famous internet worm that infected Microsoft IIS servers in 2001. ✔ Hence, it is a computer worm .
A video solution is available for this question — log in and enroll to watch it.
- A.
- Q26.UPPSC 2021
Suppose there are two servers S₁ and S₂. S₁ is a UDP server and S₂ is a TCP server. Both servers are simultaneously maintaining 100 sessions, each with different clients. The number of sockets at both S₁ and S₂ are —
- A.
100,100
- B.
100,1
- C.
1,100
- D.
1,101
Correct answer: D
Solution
A server's socket count depends on whether its transport protocol is connectionless or connection-oriented. A connectionless (UDP) server can exchange datagrams with any number of remote peers through a single bound socket, because the socket itself carries no per-peer connection state — the peer's address arrives with each datagram. A connection-oriented (TCP) server, by contrast, keeps one socket permanently open just to listen for and accept new connection requests, and a separate, independent socket is created for every connection it accepts and keeps alive — that listening socket is never reused as a session socket.
S₁ is UDP and is simultaneously serving 100 different clients. Since UDP needs no per-client socket, S₁ uses exactly one socket for all 100 sessions: S₁ = 1.
S₂ is TCP and is simultaneously maintaining 100 established sessions. Each of the 100 sessions occupies its own connected socket, contributing 100 sockets.
On top of those 100 connected sockets, S₂'s original listening socket (the one used to accept these connections in the first place) is still open and doing its own job — it is not one of the 100 connected sockets. Adding it gives S₂ = 100 + 1 = 101.
This matches how the sockets API behaves in practice: each accepted TCP connection returns a brand-new connected-socket descriptor while the server's original listening-socket descriptor is left completely untouched and still bound to the well-known port, ready to accept the next client. So a server with 100 live TCP sessions holds 101 open sockets in total, while the UDP server needs only its one shared socket.
Result: S₁ = 1, S₂ = 101.
- A.
- Q27.UPPSC 2021
The binary equivalent of the decimal number 0.4375 is —
- A.
0.0111
- B.
0.1011
- C.
0.1100
- D.
0.1010
Correct answer: A
Solution
Convert 0.4375 to binary by multiplying the fractional part by 2 and recording the integer parts:
0.4375 × 2 = 0.875 → bit 0
0.875 × 2 = 1.75 → bit 1
0.75 × 2 = 1.5 → bit 1
0.5 × 2 = 1.0 → bit 1
Collect the bits after the point (in order): 0.0111
Alternate method: express 0.4375 as a sum of negative powers of 2:
0.25 = 2⁻2 → binary 0.01
0.125 = 2⁻3 → binary 0.001
0.0625 = 2⁻4 → binary 0.0001
Summing these binary fractions: 0.01 + 0.001 + 0.0001 = 0.0111
Therefore, the binary equivalent of 0.4375 is 0.0111
- A.
- Q28.UPPSC 2021
For a relation scheme R(ABC), assume that the attributes are prime attributes, then minimum R is which Normal Form?
- A.
1 NF
- B.
2 NF
- C.
3 NF
- D.
BCNF
Correct answer: C
Solution
Concept
A prime attribute is one that belongs to at least one candidate key; a non-prime attribute belongs to none. The normal forms differ in what they demand of every non-trivial functional dependency X → A. 3NF requires that, for each such FD, X is a superkey OR A is a prime attribute. BCNF drops the second escape clause: it requires X to be a superkey for every non-trivial FD, with no exception for prime A.
Application
Suppose every attribute of R(A, B, C) is prime, so the relation has no non-prime attribute at all.
Take any non-trivial FD X → A that holds on R. Its right-hand side A is an attribute of R, and by assumption A is prime.
The 3NF rule offers two ways to be satisfied: X is a superkey, or A is prime. Here the second clause holds for every FD because A is always prime, so the 3NF condition is met automatically.
2NF and 1NF are weaker requirements implied by 3NF, so they also hold. 1NF needs only atomic values; 2NF forbids a non-prime attribute depending on part of a key, which cannot arise when there are no non-prime attributes.
Cross-check
BCNF is not guaranteed: it ignores whether A is prime and insists X be a superkey. A relation can have an FD whose left side is not a superkey while its right side is prime. Concrete witness: R(A, B, C) with candidate keys AB and AC and the FD C → B. Every attribute is prime, yet C is not a superkey, so this FD breaks BCNF while still passing 3NF. Hence the strongest form guaranteed purely from 'all attributes prime' is 3NF, not BCNF.
- A.
- Q29.UPPSC 2021
Memory resident virus is also called —
- A.
Stealth virus
- B.
Multipartite virus
- C.
Trojan virus
- D.
Zombie virus
Correct answer: A
Solution
A memory resident virus loads itself into RAM and stays active there, hiding from detection. This hiding nature → same behavior as a stealth virus . ✔ So it is also called a stealth virus .
- A.
- Q30.UPPSC 2021
Assume that for a certain processor, a read request takes 50 ns on a cache miss and 5 ns on a cache hit. Suppose while running a program, it was observed that 80% of the processor’s read requests result in cache hit. The average read access time in nanoseconds is —
- A.
10
- B.
14
- C.
4
- D.
12
Correct answer: B
Solution
Average time = (hit_fraction × hit_time) + (miss_fraction × miss_time) Hit fraction = 0.8, Miss fraction = 0.2 Average = 0.8×5 + 0.2×50 = 4 + 10 = 14 ns
- A.
- Q31.UPPSC 2021
The minimum frame size required for a CSMA/CD based computer network running at 1 Gbps on a 200 m cable with a link speed of 2×10⁸ m/sec is -
- A.
125 bytes
- B.
250 bytes
- C.
500 bytes
- D.
None of the above
Correct answer: B
Solution

----------------------------------------

A video solution is available for this question — log in and enroll to watch it.
- A.
- Q32.UPPSC 2021
How many times is the comparison i ≥ n performed in the following program? int i = 200, n = 110; main() { while (i ≥ n) { i = i - 1; n = n + 1; } }
- A.
46
- B.
47
- C.
48
- D.
90
Correct answer: B
Solution

Short answer: 47 comparisons.
Initial values: i = 200, n = 110 → difference (gap) = i - n = 90.
Each iteration decreases i by 1 and increases n by 1, so the gap decreases by 2 each iteration.
After m iterations the gap = 90 - 2m. The loop runs while i ≥ n, i.e., while gap ≥ 0. Find smallest m with gap < 0: 90 - 2m < 0 ⇒ m > 45, so the smallest integer m = 46. Therefore the loop executes 46 iterations.
The condition i ≥ n is evaluated once before each iteration and one final time when it fails. Total comparisons = iterations + 1 = 46 + 1 = 47.
Conclusion: The comparison i ≥ n is performed 47 times.
A video solution is available for this question — log in and enroll to watch it.
- A.
- Q33.UPPSC 2021
Module-based programming language is —
- A.
C
- B.
C++
- C.
ML
- D.
Ada
Correct answer: D
Solution
Programming languages are commonly grouped by their organizing paradigm — procedural, object-oriented, functional, logic, and module-based. A module-based language builds programs around the module/package as the core unit: a construct that separates a public interface (specification) from a private implementation (body), enforces encapsulation, and supports separate compilation of units.
Among the given options, Ada is built around exactly this construct — the package. An Ada package splits into a public specification and a private body, hides implementation details behind that interface, and can be compiled separately from the units that use it. This package-centric design is why Ada is the standard textbook example cited for the module-based category.
C has no package/module keyword at all — modularity is only a convention of splitting code into header (.h) and source (.c) files, tied together by the linker, not a language-level construct.
Classical C++ (pre-C++20) still relies on the same header/source-file convention as C; in this paradigm taxonomy C++ is placed under the object-oriented category, not module-based.
ML has a genuine module system — structures, signatures, and functors — but the paradigm taxonomy classifies ML under functional languages, not module-based.
So, of the four options, only Ada is classified as the module-based programming language.
A video solution is available for this question — log in and enroll to watch it.
- A.
- Q34.UPPSC 2021
Operator overloading is —
- A.
making new C++ operators
- B.
making C++ operators work with objects
- C.
giving C++ operators more than they can handle
- D.
helping in reducing execution time
Correct answer: B
Solution
Operator overloading: Operator overloading allows existing C++ operators (for example +, -, *) to be given definitions that work with user-defined types (classes or structs). Key idea: You implement operator functions (such as operator+) to specify how an operator behaves for your class. These functions can be member functions or non-member functions.
Example: To add two Complex objects, define a function such as Complex operator+(const Complex& a, const Complex& b) that returns their sum.
A video solution is available for this question — log in and enroll to watch it.
- A.
- Q35.UPPSC 2021
Which is the root class of all AWT events in Java?
- A.
Java.awt.ActionEvent
- B.
Java.awt.AWTEvent
- C.
Java.awt.event.AWTEvent
- D.
Java.awt.event.AWTEvent.Event
Correct answer: B
Solution
All AWT events in Java are subclasses of AWTEvent , which is the root of the AWT event hierarchy.
A video solution is available for this question — log in and enroll to watch it.
- A.
- Q36.UPPSC 2021
_______ is not a type of antivirus program.
- A.
Quick Heal
- B.
McAfee
- C.
Kaspersky
- D.
Microsoft Office
Correct answer: D
Solution
Quick Heal, McAfee, and Kaspersky are all antivirus software. Microsoft Office is not antivirus software. ✔ So correct answer = Microsoft Office
- A.
- Q37.UPPSC 2021
In tear-down phase of a circuit-switched network, a signal is sent to release the resources —
- A.
to each router
- B.
to each switch
- C.
to each computer
- D.
to each server
Correct answer: B
Solution
Concept
A circuit-switched network reserves a dedicated end-to-end path before data transfer. Each switching node on that path stores local connection state and commits a channel or capacity to that circuit.
Teardown reverses setup: the network must notify every switching node that holds part of the reservation so that each node can remove its cross-connect state and return the capacity to the free pool.
Application
The established circuit passes through a sequence of circuit switches between the two end systems.
Each such switch holds local state and reserved capacity for this circuit.
A release signal therefore propagates along the established path and is processed by each switch, which frees its local reservation.
Contrast and cross-check
A router primarily forwards individual packets using routing and forwarding tables rather than holding the circuit cross-connect described here.
A computer or server is an end system; it is not the repeated intermediate resource holder along the circuit path.
If even one circuit switch were not notified, its reserved channel would remain occupied, so complete release requires notifying each switch.
Therefore, the release signal is sent to each switch on the established circuit path.
- A.
- Q38.UPPSC 2021
A utility used to specify who is allowed to connect to a service over the network and who is not, is called —
- A.
TCP shell
- B.
TCP wrappers
- C.
IP wrappers
- D.
IP shell
Correct answer: B
Solution
TCP Wrappers control access to network services using allow/deny rules.
A video solution is available for this question — log in and enroll to watch it.
- A.
- Q39.UPPSC 2021
If P is a statement, then which of the following is a tautology?
- A.
P ∧ F
- B.
P ∨ F
- C.
P ∨ ¬P
- D.
P ∧ T
Correct answer: C
Solution
A tautology is a statement that is always true. P ∨ ¬P is always true; this is the law of excluded middle . If P is true, then ¬P is false, so P ∨ ¬P is true.
- A.
- Q40.UPPSC 2021
________ indicates that the subscriber identified in the certificate has sole control and access to the private key.
- A.
OAEP
- B.
Digital Signature
- C.
PKI
- D.
Public Key Certificate
Correct answer: B
Solution
Digital Signature proves ownership/control of the private key by the certificate holder. The signer creates a signature using their private key.
- A.
- Q41.UPPSC 2021
In a binary min-heap containing 'n' numbers, the largest can be found in ______ time.
- A.
θ(n)
- B.
θ(log n)
- C.
θ(log log n)
- D.
θ(1)
Correct answer: A
Solution
In a min-heap , the minimum is at the root, but the maximum can be anywhere in the heap. Therefore, we must scan all n elements → θ(n) time
- A.
- Q42.UPPSC 2021
Which one of the following micro-operations in ALU causes overflow sometimes?
- A.
Logical shift left
- B.
Arithmetic shift left
- C.
Circular shift right
- D.
None of the above
Correct answer: B
Solution
Answer: Arithmetic shift left causes overflow sometimes. Reason (English): Arithmetic shift left multiplies a value by 2. For fixed-width signed representations, shifting left can move the sign bit out of range or otherwise exceed the representable range, producing arithmetic overflow.
Example: In 4-bit two's complement, 0100 (+4) shifted left by one becomes 1000 (which represents −8). This change of sign and incorrect numeric result indicates overflow.
Why other shifts do not cause arithmetic overflow:
Circular (rotate) shifts preserve all bits by rotating them, so no bits are lost and this does not produce arithmetic overflow.
Logical shift left also shifts in zeros and can discard the most significant bit; however, in the ALU context the term "overflow" typically refers to arithmetic overflow for signed values, and the operation that corresponds to multiplying by two (arithmetic shift left) is the standard cause of such overflow.
- A.
- Q43.UPPSC 2021
The number of attributes in a relation schema is called —
- A.
Key
- B.
Arity
- C.
Domain
- D.
Cardinality
Correct answer: B
Solution
Arity = number of attributes in a relation
Cardinality = number of tuples
- A.
- Q44.UPPSC 2021
The default parameter passing method used in C++ is —
- A.
Call by Reference
- B.
Call by Value
- C.
Call by Name
- D.
None of the above
Correct answer: B
Solution
In C++, function parameters are passed by value by default , meaning a copy of the variable is sent, not the original.
A video solution is available for this question — log in and enroll to watch it.
- A.
- Q45.UPPSC 2021
The term in which a person is continuously chased or harassed by another person or group is known as —
- A.
Phising
- B.
Bulling
- C.
Stalking
- D.
Identity theft
Correct answer: C
Solution
Stalking = repeatedly following, contacting, watching, or harassing someone in a way that causes fear or distress.
- A.
- Q46.UPPSC 2021
How many different binary trees are possible with 8 nodes?
- A.
256
- B.
128
- C.
248
- D.
1430
Correct answer: D
Solution
Formula: The number of different binary trees with n nodes equals the nth Catalan number,
C_n = 1/(n+1) * (2n choose n).
Compute for n = 8:
Step 1: Calculate the binomial coefficient (2n choose n) = (16 choose 8) = 12870.
Step 2: Apply the Catalan formula: C_8 = 1/(8+1) * 12870 = 12870 / 9 = 1430.
Answer: There are 1430 different binary trees with 8 nodes.
------------------------------------------------------------------------------------------------------
The Core Idea: Splitting the NodesEvery binary tree has exactly one root node at the very top.
If you have n nodes total, and you use 1 for the root, you have n - 1 nodes left over. These leftover nodes must be split between the left branch and the right branch.
To find the total number of possible trees, you look at every possible way to split those leftover nodes, find out how many tree shapes each side can make, and multiply them together.
Building from Scratch (Starting with 0)
Let's call the number of possible trees for a given number of nodes T(n).
0 Nodes: T(0) = 1
If you have 0 nodes, there is only 1 way to draw it: an empty space. (This might sound weird, but it's mathematically necessary for the next steps!)
1 Node: T(1) = 1
If you have 1 node, it is just the root. There is exactly 1 way to draw this.
2 Nodes: T(2) = 2
You use 1 node for the root, leaving 1 node. You can split that 1 leftover node two ways:
1 on the left, 0 on the right: (1 way for left × 1 way for right) = 1
0 on the left, 1 on the right: (1 way for left × 1 way for right) = 1
Total: 1 + 1 = 2 ways.3 Nodes: T(3) = 5
You use 1 node for the root, leaving 2 nodes. You can split them:
2 on left, 0 on right: (T(2) ways × T(0) ways) → 2 × 1 = 2
1 on left, 1 on right: (T(1) ways × T(1) ways) → 1 × 1 = 1
0 on left, 2 on right: (T(0) ways × T(2) ways) → 1 × 2 = 2
Total: 2 + 1 + 2 = 5 ways.Finding the Pattern
Do you see the pattern? For any number of nodes, we just pair up the answers from the smaller trees we already calculated. We multiply the outer numbers, move inward, multiply those, and add them all up.
Let's use our known list so far: 1, 1, 2, 5 (for 0, 1, 2, and 3 nodes).
4 Nodes: T(4) (Leaves 3 nodes to split)
(Left 3, Right 0): 5 × 1 = 5
(Left 2, Right 1): 2 × 1 = 2
(Left 1, Right 2): 1 × 2 = 2
(Left 0, Right 3): 1 × 5 = 5
Total T(4) = 5 + 2 + 2 + 5 = 145 Nodes: T(5) (Leaves 4 nodes to split)
(14 × 1) + (5 × 1) + (2 × 2) + (1 × 5) + (1 × 14)
14 + 5 + 4 + 5 + 14 = 426 Nodes: T(6) (Leaves 5 nodes to split)
(42 × 1) + (14 × 1) + (5 × 2) + (2 × 5) + (1 × 14) + (1 × 42)
42 + 14 + 10 + 10 + 14 + 42 = 1327 Nodes: T(7) (Leaves 6 nodes to split)
(132 × 1) + (42 × 1) + (14 × 2) + (5 × 5) + (2 × 14) + (1 × 42) + (1 × 132)
132 + 42 + 28 + 25 + 28 + 42 + 132 = 4298 Nodes: T(8) (Leaves 7 nodes to split)
(429 × 1) + (132 × 1) + (42 × 2) + (14 × 5) + (5 × 14) + (2 × 42) + (1 × 132) + (1 × 429)
429 + 132 + 84 + 70 + 70 + 84 + 132 + 429 = 1430 - A.
- Q47.UPPSC 2021
“Compliment Accumulator” is an example of —
- A.
Register Addressing Mode
- B.
Implied Mode
- C.
Immediate Mode
- D.
Relative Mode
Correct answer: B
Solution
“Complement Accumulator” instruction does not specify any operand . The operand (Accumulator) is already known to the CPU, so the instruction is implicit . Therefore, it uses Implied addressing mode .
- A.
- Q48.UPPSC 2021
Which one of the following is not NP-Hard problem?
- A.
Assignment problem
- B.
Travelling salesman problem
- C.
Non-linear programming
- D.
Hamiltonian cycle problem
Correct answer: A
Solution
The Assignment problem is solvable in polynomial time using the Hungarian Algorithm → therefore it is NOT NP-Hard. Other problems listed (TSP, Non-linear programming, Hamiltonian cycle) are NP-Hard.
- A.
- Q49.UPPSC 2021
What is the output of the following C program? #include <stdio.h> void main() { int a[3][2] = { {1,2}, {2,1}, {2,2} }; print("%d", a[1][0]); }
- A.
1
- B.
2
- C.
0
- D.
None of these
Correct answer: B
Solution
Answer: 2 Array contents by row: Row 0
- A.
- Q50.UPPSC 2021
How many bytes are required for encoding 200 bits?
- A.
25 Bytes
- B.
3 Bytes
- C.
4 Bytes
- D.
2 Bytes
Correct answer: A
Solution
1 byte = 8 bits 200 bits / 8 = 25 bytes
- A.
- Q51.UPPSC 2021
For the given DAG, which of the following is NOT a topological ordering?

- A.
ABCDEF
- B.
ACBDEF
- C.
ACBDFE
- D.
CBDAFE
Correct answer: D
Solution
Concept
A topological ordering of a directed acyclic graph places every vertex before every vertex reached by one of its outgoing edges.
Equivalently, for each directed edge u → v, u must occur before v in the sequence.
Application
Read the DAG constraints: A precedes B and C; B precedes D and E; C precedes D and F; and D precedes E and F.
In CBDAFE, C and B occur before A. This contradicts the edges A → C and A → B, which require A to occur before both vertices.
Therefore, CBDAFE is not a topological ordering of the given DAG.
Cross-check
Each of ABCDEF, ACBDEF, and ACBDFE places A before B and C, both B and C before D, and D before E and F. Thus, each of those sequences satisfies every directed-edge constraint.
Result
The ordering that is not topological is CBDAFE.
- A.
- Q52.UPPSC 2021
Proxy firewall filters are used at which layer?
- A.
Network layer
- B.
Session layer
- C.
Presentation layer
- D.
Application layer
Correct answer: D
Solution
Answer: Proxy firewall filters at the Application Layer (Layer 7). A proxy firewall acts as an intermediary between clients and servers and inspects application-layer data. It understands application protocols and can allow or block traffic based on protocol semantics and message content. Examples of what it inspects: HTTP requests (URLs, headers, cookies), FTP commands, SMTP messages.
- A.
- Q53.UPPSC 2021
Consider the message M = 1010001101.
The Cyclic Redundancy Check (CRC) computed using the divisor polynomial x5 + x4 + x2 + 1 is:
- A.
01110
- B.
01011
- C.
10101
- D.
10110
Correct answer: A
Solution
Concept.
A CRC treats bit strings as polynomials over GF(2). For a generator G(x) of degree n, the message M(x) is first multiplied by xn (equivalently, n zero bits are appended). The CRC is the remainder R(x) of the modulo-2 division of that padded message by G(x); the remainder always has n bits. All arithmetic is XOR-based with no carries or borrows, and the transmitted codeword is, by construction, exactly divisible by G(x).
How many zeros to pad? A generator whose highest power is n has n + 1 bits; the number of appended zeros equals n, the degree of the generator (one less than its bit length).
Application.
Write the generator. x5 + x4 + x2 + 1 has degree n = 5, so its binary form is 110101 (6 bits) and we append 5 zeros.
Pad the message. M = 1010001101 becomes 101000110100000 (five zeros appended).
Divide modulo-2. Align the generator under each leading 1 of the running dividend and XOR; bring down bits and repeat until every bit is processed.
Read the remainder. The final 5 bits left after the last XOR form the CRC:
01110.
Polynomial view.
M(x) = x9 + x7 + x3 + x2 + 1, and multiplying by x5 gives x14 + x12 + x8 + x7 + x5. Dividing this by G(x) = x5 + x4 + x2 + 1 over GF(2) leaves the remainder x3 + x2 + x, whose coefficients from x4 down to x0 are 01110 — the same result as the bit-wise division.
Cross-check.
Form the codeword by appending the remainder to M: 101000110101110. Dividing this codeword by 110101 modulo-2 leaves remainder 00000. A zero remainder confirms the CRC is correct.
Quick tip (do it faster).
You do not have to write out all 15 bits at once. Keep only a 5-bit register (n = degree of the generator), initialised to 0, and feed in the padded message one bit at a time:
Note the register's current leftmost bit, then shift the register left by one and bring in the next message bit on the right (keep only the last 5 bits).
If the leftmost bit noted in step 1 was 1, XOR the register with the generator's own lower
nbits — here10101(110101 without its own leading 1). If it was 0, do nothing this step.Repeat for every bit of the message and every appended zero. Whatever is left in the register at the end is the CRC — no need to track a full 15-bit row at each step.
This is exactly how a hardware CRC circuit (an LFSR) works, and it is faster to execute on paper than rewriting the whole padded string at every row.
- A.
- Q54.UPPSC 2021
If A = {1, {2}, 3}, the power set of A does NOT contain —
- A.
{1}
- B.
{2}
- C.
{1, 3}
- D.
{3}
Correct answer: B
Solution
Set A = {1, {2}, 3} contains three elements: 1 → an element {2} → a set , and treated as a single element 3 → an element So every subset must use 1 , {2} , and 3 exactly as they appear. {2} ✗ NOT valid , because 2 is NOT an element of A , only {2} is.
- A.
- Q55.UPPSC 2021
Which of the following is the correct way to initialize an array?
- A.
int num[6] = (2, 4, 12, 5, 45, 5)
- B.
int num[ ] = {2, 4, 12, 5, 45, 5}
- C.
int num{6} = {2, 4, 12}
- D.
int num(6) = {2, 4, 12, 5, 45, 5}
Correct answer: B
Solution
Correct C syntax for array initialization uses curly braces { } , not parentheses. Correct initialization example: int num[] = {2, 4, 12, 5, 45, 5}; You can omit the size in the square brackets; the compiler infers the array length from the number of initializer elements.
- A.
- Q56.UPPSC 2021
Suppose f(n)=n^2 logn. Consider the statements:


- A.
A, B & C are all not true.
- B.
B & C are true but A is not true.
- C.
B is true but A & C are not true.
- D.
A & B are true and C is not true.
Correct answer: C
Solution

Given f(n) = n^2 log n.
Compare with n sqrt(n) = n^{3/2}: (n^2 log n)/(n^{3/2}) = n^{1/2} log n → ∞, so f(n) grows faster than n sqrt(n) and therefore is not O(n sqrt(n)).
Compare with n^2 sqrt(n) = n^{5/2}: (n^2 log n)/(n^{5/2}) = (log n)/n^{1/2} → 0, so f(n) is asymptotically smaller and hence f(n) = O(n^2 sqrt(n)).
Compare with n^3: (n^2 log n)/n^3 = (log n)/n → 0, so f(n) = o(n^3) and therefore f(n) is not Ω(n^3).
Conclusion: The only true statement is that f(n) = O(n^2 sqrt(n)). The other two statements are false.
- A.
- Q57.UPPSC 2021
Which of the following is not a software process quality?
- A.
Productivity
- B.
Portability
- C.
Timeliness
- D.
Visibility
Correct answer: B
Solution
Software process qualities include: Productivity
Timeliness
Visibility
Portability is not a process quality. It is a software product quality .
- A.
- Q58.UPPSC 2021
Suppose in a TCP connection at any given time the receiver advertised window size is 20 kB and congestion window size is 10 kB. What should be the size of sender window to achieve flow control?
- A.
30 KB
- B.
20 KB
- C.
10 KB
- D.
Could be 10 kB or 20 kB or both
Correct answer: C
Solution
TCP sender window = min(Advertised Window, Congestion Window) min(20,10)=10 kB ✔ Final Answer: 10 kB
A video solution is available for this question — log in and enroll to watch it.
- A.
- Q59.UPPSC 2021
The inorder and preorder traversals of a binary tree are dbefagc and abdefcg respectively. The post order traversal of the binary tree is —
- A.
edbgfca
- B.
debfgca
- C.
dfebgca
- D.
defgbca
Correct answer: C
Solution
Preorder: abdefcg → first element a = root Inorder: dbef a gc Left subtree inorder: dbef
- A.
- Q60.UPPSC 2021
Which of the following protocol pairs can be used to send and retrieve emails (in that order)?
- A.
IMAP, POP3
- B.
SMTP, POP3
- C.
SMTP , MIME
- D.
IMAP , SMTP
Correct answer: B
Solution
SMTP is used for sending emails. POP3 is used for retrieving emails. Key point: SMTP handles outgoing mail delivery, and POP3 downloads incoming mail to the client, so the correct order for 'send then retrieve' is SMTP followed by POP3. SMTP
- A.
- Q61.UPPSC 2021
Which of the following is not a Cloud Computing Service?
- A.
Infrastructure as a Service (IaaS)
- B.
Platform as a Service (PaaS)
- C.
Software as a Service (SaaS)
- D.
Typing as a Service (TaaS)
Correct answer: D
Solution
Cloud services are standardly: IaaS
PaaS
SaaS
“Typing as a Service” is not a real cloud computing model.
- A.
- Q62.UPPSC 2021
A circular linked list is used to represent a queue. A single variable ‘P’ is used to access the queue. To which node should ‘P’ point so that both enqueue and dequeue operations can be performed in constant time?


- A.
rear node
- B.
front node
- C.
not possible with single pointer
- D.
node next to front
Correct answer: A
Solution
Key idea: keep P pointing to the rear node of the circular linked list.
Then front = P -> next; rear = P.
Enqueue requires quick access to the rear.
Dequeue requires quick access to the front.
Enqueue (insert element x):
If P == NULL (queue is empty): create new node; set new.next = new; set P = new.
Else: create new node; set new.next = P.next; set P.next = new; set P = new.
Dequeue (remove front element):
If P == NULL: queue is empty (underflow).
Let front = P.next.
If front == P (only one node): set P = NULL.
Else: set P.next = front.next (unlink front). Return front's value.
Because each operation uses a fixed number of pointer updates (and no traversal), both enqueue and dequeue run in O(1) time.
- A.
- Q63.UPPSC 2021
IPSec is designed to provide security at the —
- A.
Transport layer
- B.
Network layer
- C.
Application layer
- D.
Session layer
Correct answer: B
Solution
IPSec works at Network Layer (Layer 3).
A video solution is available for this question — log in and enroll to watch it.
- A.
- Q64.UPPSC 2021
In IPv4 addressing format, the number of networks allowed under Class C is —
- A.
214
- B.
27
- C.
221
- D.
224
Correct answer: C
Solution
Class C begins with bits 110 , i.e., 3 bits fixed. So usable network bits = 24 − 3 = 21 bits . Number of Class C networks=2 21
A video solution is available for this question — log in and enroll to watch it.
- A.
- Q65.UPPSC 2021
HIPPA is related to -
- A.
Finance
- B.
Health
- C.
Education
- D.
Stock market
Correct answer: B
Solution
HIPAA = Health Insurance Portability and Accountability Act It relates to health: HIPAA sets national standards for protecting patients' medical information, ensuring privacy and security. Protects medical and health records (protected health information).
A video solution is available for this question — log in and enroll to watch it.
- A.
- Q66.UPPSC 2021
The famous port and IP address scanner is —
- A.
Cain and Abel
- B.
Angry IP Scanner
- C.
Snort
- D.
Etter Cap
Correct answer: B
Solution
Angry IP Scanner is a well-known tool used specifically for IP address and port scanning .
A video solution is available for this question — log in and enroll to watch it.
- A.
- Q67.UPPSC 2021
Which of the following algorithm does NOT use divide-and-conquer strategy?
- A.
Merge sort
- B.
Quick sort
- C.
Binary sort and Stressian Multiplication
- D.
Travelling Salesperson Problem (TSP)
Correct answer: D
Solution
Correct answer: Travelling Salesperson Problem (TSP) does NOT use divide-and-conquer. Merge sort — uses divide-and-conquer: split the array into halves, sort each half recursively, then merge the sorted halves.
- A.
- Q68.UPPSC 2021
The value of Floor(8.4) + Ceil(9.9) is:
- A.
18
- B.
19
- C.
20
- D.
17
Correct answer: A
Solution
The floor function ⌊x⌋ gives the greatest integer that is less than or equal to x, so it always moves down to the nearest whole number and never rounds up.
The ceiling function ⌈x⌉ gives the least integer that is greater than or equal to x, so it always moves up to the nearest whole number whenever a fractional part exists.
Applying this to the given expression:
Since 8 ≤ 8.4 < 9, the greatest integer not exceeding 8.4 is 8; so Floor(8.4) = 8.
Since 9 < 9.9 ≤ 10, the least integer not less than 9.9 is 10; so Ceil(9.9) = 10.
Adding these: 8 + 10 = 18.
As an independent check, 8.4 lies strictly between 8 and 9, and the floor always selects the lower of the two regardless of how large the decimal part is; 9.9 lies strictly between 9 and 10, and the ceiling always selects the upper of the two regardless of how small the remaining gap is. This confirms Floor(8.4) + Ceil(9.9) = 8 + 10 = 18.
- A.
- Q69.UPPSC 2021
What is virtual inheritance in C++?
- A.
C++ technique to enhance multiple inheritance.
- B.
C++ technique to ensure that a private member of base class can be accessed.
- C.
To avoid multiple inheritance of classes.
- D.
To avoid multiple copies of the base class in derived class.
Correct answer: D
Solution
Virtual inheritance ensures that only one shared instance of a common base class exists when using multiple inheritance—this prevents duplicate base-class subobjects in the diamond problem. Problem: If class B and class C both inherit from class A, and class D inherits from both B and C, then without virtual inheritance D will contain two separate A subobjects (diamond problem).
- A.
- Q70.UPPSC 2021
Which of the following term is used to describe a threat origin and the path it takes to reach a target?
- A.
Fraud
- B.
Espionage
- C.
Malfunction
- D.
Threat vectors
Correct answer: D
Solution
A threat vector describes where a threat comes from and how it reaches the target .
A video solution is available for this question — log in and enroll to watch it.
- A.
- Q71.UPPSC 2021
A 16-bit-wide data bus is used to read a 128-bit instruction. How many bus accesses are required?
- A.
2
- B.
4
- C.
8
- D.
7
Correct answer: C
Solution
Concept
A data bus transfers a number of bits equal to its width in each access.
When the instruction size is an exact multiple of the bus width, the required number of accesses is instruction size divided by bits transferred per access.
Application
Instruction size = 128 bits; bus width = 16 bits per access.
Number of accesses = 128 bits ÷ 16 bits per access = 8.
Therefore, reading the complete instruction requires 8 bus accesses.
Cross-check
8 accesses × 16 bits per access = 128 bits, which exactly equals the instruction size.
- A.
- Q72.UPPSC 2021
Consider a noiseless channel with a bandwidth of 1000 Hz transmitting a signal with two signal levels. The maximum bit rate will be —
- A.
2000 bps
- B.
2000 kbps
- C.
1000 bps
- D.
1000 kbps
Correct answer: A
Solution
Nyquist formula:
Use R_max = 2 B log2 M.
Given bandwidth B = 1000 Hz and number of signal levels M = 2.
Compute log2 M = log2 2 = 1.
So R_max = 2 × 1000 × 1 = 2000 bits/sec (2000 bps).
A video solution is available for this question — log in and enroll to watch it.
- A.
- Q73.UPPSC 2021
In Java: double var1 = 8/3; System.out.println(var1); prints which among the following —
- A.
2
- B.
2.0
- C.
3.0
- D.
2.7
Correct answer: B
Solution
8/3 is integer division in Java (both operands int) → result 2. That 2 is then assigned to double → 2.0. So printed 2.0.
A video solution is available for this question — log in and enroll to watch it.
- A.
- Q74.UPPSC 2021
Let T(n) be defined by T(1) = 7 and T(n+1) = 3n + T(n) for all integers n ≥ 1. Which of the following represents the order of growth of T(n)?
- A.
Θ(n)
- B.
Θ(n log n)
- C.
Θ(n²)
- D.
Θ(2ⁿ)
Correct answer: C
Solution
Key idea: Unroll the recurrence and sum the arithmetic series.
Unwrap the first values: T(1) = 7, T(2) = 7 + 3·1, T(3) = 7 + 3(1+2), and so on.
General form: T(n) = 7 + 3(1 + 2 + ... + (n - 1)).
Sum formula: 1 + 2 + ... + (n - 1) = (n - 1)n/2.
Compute T(n): T(n) = 7 + 3·(n - 1)n/2 = (3/2)n^2 - (3/2)n + 7.
Conclusion: The dominant term is (3/2)n^2, so T(n) = Θ(n^2).
- A.
- Q75.UPPSC 2021
Who among the following established the literary centre Bait-ul-Uloom in Delhi?
- A.
Jahanara
- B.
Zeb-un-Nisa
- C.
Gauhar Ara
- D.
Nur Jahan
Correct answer: B
Solution
Concept
A historical-identification question is solved by matching a named institution with the person specifically credited with founding or establishing it. General patronage or prominence is not equivalent to founding that institution.
For Mughal cultural history, aliases, family relationships, and documented literary activity help distinguish figures who otherwise share courtly backgrounds.
Application
Bait-ul-Uloom, the literary centre in Delhi, is attributed to Zeb-un-Nisa, the Mughal princess and poet who wrote under the pen name Makhfi. She was the eldest daughter of Emperor Aurangzeb.
Contrast
Jahanara Begum was Shah Jahan's eldest surviving daughter and is noted for Sufi patronage and architectural and urban projects in Shahjahanabad.
Gauhar Ara Begum was the youngest daughter of Shah Jahan and Mumtaz Mahal and lived as a Mughal princess of the Shah Jahan era.
Nur Jahan was Emperor Jahangir's influential consort and is chiefly associated with imperial politics, court patronage, and architecture.
Result
Therefore, the person who established Bait-ul-Uloom was Zeb-un-Nisa.
A video solution is available for this question — log in and enroll to watch it.
- A.
- Q76.UPPSC 2021
Which of the following supports the concept of hierarchical classification?
- A.
Polymorphism
- B.
Encapsulation
- C.
Abstraction
- D.
Inheritance
Correct answer: D
Solution
Hierarchical classification means forming parent–child class structure → supported by Inheritance.
- A.
- Q77.UPPSC 2021
With reference to the Parliamentary Standing Committees reconstituted in October 2021, which of the following statements is/are correct?
Sushil Kumar Modi is the Chairperson of the Standing Committee on Personnel, Public Grievances, Law and Justice.
Shashi Tharoor is the Chairperson of the Standing Committee on Information Technology.
Select the correct answer from the code given below:
- A.
Only 1
- B.
Only 2
- C.
Both 1 and 2
- D.
Neither 1 nor 2
Correct answer: C
Solution
Concept
Department-related Parliamentary Standing Committees are reconstituted periodically, so a chairperson statement must be checked against the notification applicable to the date named. In a two-statement code question, verify each statement independently before selecting the combination.
Application
The October 2021 reconstitution named Sushil Kumar Modi as Chairperson of the Committee on Personnel, Public Grievances, Law and Justice. Therefore statement 1 records the full committee title and chairperson correctly.
The October 2021 reconstitution retained Shashi Tharoor as Chairperson of the Committee on Information Technology. The committee was renamed the Committee on Communications and Information Technology in November 2021, so the October-specific name must be used here. Therefore statement 2 is correct.
Cross-check and contrast
“Only 1” accepts statement 1 but excludes the independently verified statement 2.
“Only 2” accepts statement 2 but excludes the independently verified statement 1.
“Both 1 and 2” includes both independently verified statements.
“Neither 1 nor 2” excludes both independently verified statements.
Result
Therefore, the applicable October 2021 list supports both statements, so the answer is “Both 1 and 2”.
A video solution is available for this question — log in and enroll to watch it.
- Q78.UPPSC 2021
Which of the following data structure has the least height?
- A.
B-tree of order 4
- B.
B-tree of order 3
- C.
B-tree of order 5
- D.
B-tree of order 6
Correct answer: D
Solution
Concept. A B-tree of order m is a balanced multi-way search tree: every node stores at most m − 1 keys and has at most m children, and every internal node other than the root has at least ⌈m/2⌉ children. All leaves sit on the same level, so the height of such a tree is bounded by exactly two things — its order m and the number of keys n it has to store — and among the shapes a given m and n allow, the tightest packing is the shortest.
Level 0 holds 1 node, level 1 holds up to m nodes, and level 2 holds up to m2 nodes — each level multiplies the node count by at most m.
A tree of height h therefore holds at most 1 + m + m2 + … + mh nodes, which can index at most mh+1 − 1 keys.
Solving mh+1 − 1 ≥ n for h gives the shallowest legal shape, h ≥ ⌈logm(n + 1)⌉ − 1.
The sparsest legal shape gives the opposite bound: the root may keep just 2 children and every other internal node only ⌈m/2⌉, so h ≤ log⌈m/2⌉((n + 1)/2).
Application. Every choice here is a tree of the same family over the same set of keys, so the only variable is the order m. Both bounds move the same way as m grows: ⌈logm(n + 1)⌉ − 1 falls, and log⌈m/2⌉((n + 1)/2) never rises. Comparing the four structures at their tightest packing — the reading that a “least height” comparison assumes — a larger order can therefore never need more levels than a smaller one for the same keys.
Putting the four offered orders side by side for an illustrative load of n = 1,000,000 keys:
Order m
Maximum keys per node
Maximum children per node
Minimum height for 106 keys
3
2
3
12
4
3
4
9
5
4
5
8
6
5
6
7
Cross-check. Check the extremes independently: with order 3 each level multiplies the node count by at most 3, so about log3(106) ≈ 12.6 levels of branching are needed to reach a million keys, while with order 6 each level multiplies by up to 6, so about log6(106) ≈ 7.7 levels are enough.
Three honest qualifications. First, the separation is not strict at every key count: for small key counts several orders share the same minimum height, and with 6 keys all four of them need height 1. Second, the worst-case bound uses the minimum branching ⌈m/2⌉, which equals 3 for both order 5 and order 6, so those two share the same upper bound. Third, because the exact shape depends on the insertion history, a sparsely filled high-order tree can be taller than a densely filled low-order one, which is why the comparison is made at equal packing. None of these lets a smaller order win: at equal packing a larger order never needs more levels than a smaller one.
Result. Of the four offered structures the one of order 6 has the largest branching factor, so at equal packing it never needs more levels than the rest, and for large key counts it needs strictly fewer — a million keys fit into 8 levels instead of the 13 that order 3 requires. The B-tree of order 6 therefore has the least height.
- A.
- Q79.UPPSC 2021
Which of the following is an example of boundary condition vulnerability?
- A.
Weak password
- B.
SQL injection
- C.
Cross-site scripting
- D.
Buffer overflows
Correct answer: D
Solution
Boundary condition problems happen when array or memory limits are exceeded → buffer overflow .
- A.
- Q80.UPPSC 2021
Who was sent to plead before the Court of Directors the right of Nana Sahib for the pension paid to Baji Rao II?
- A.
Azimullah Khan
- B.
Tatya Tope
- C.
Omar Pasha
- D.
Rango Bapuji
Correct answer: A
Solution
Answer: Azimullah Khan — अज़ीमुल्लाह ख़ान Explanation: Azimullah Khan, who served as Nana Sahib's secretary and envoy, was sent to plead before the Court of Directors for the right to the pension previously paid to Baji Rao II. Role: acted as secretary and representative of Nana Sahib.
Purpose: to petition the Court of Directors for the pension rights associated with Baji Rao II.
A video solution is available for this question — log in and enroll to watch it.
- A.
- Q81.UPPSC 2021
In the standard ER-model direction from the owning strong entity set to the weak entity set, a weak entity set must be part of which identifying relationship?
- A.
One-to-one relationship
- B.
One-to-many relationship
- C.
Many-to-many relationship
- D.
None of the above
Correct answer: B
Solution
Key direction: The option is read from the owning strong entity set to the weak entity set.
One strong owner can be associated with many weak entities.
Each weak entity must be associated with exactly one strong owner so it can be identified using the owner key plus its partial key.
Therefore, from weak entity to strong owner, the same relationship can be described as many-to-one. The question now states the direction explicitly.
Answer: One-to-many relationship
- A.
- Q82.UPPSC 2021
Java statement: System.out.println(2 == 2.0); — what does it print?
- A.
Prints true
- B.
Prints false
- C.
Will not compile successfully
- D.
Compiles but raises exception
Correct answer: A
Solution
Java automatically promotes int to double , so comparison is: 2.0==2.0⇒true
A video solution is available for this question — log in and enroll to watch it.
- A.
- Q83.UPPSC 2021
What does f(250,2) return? f(m, n){ ans = 1; count = 0; while(ans <= m){ count = count + 1; ans = ans * n; } return(count); }
- A.
7
- B.
8
- C.
6
- D.
9
Correct answer: B
Solution
Compute powers of 2 until exceeding 250: ans = 1 (count 0)
ans = 2 (count 1)
ans = 4 (count 2)
ans = 8 (count 3)
ans = 16 (count 4)
ans = 32 (count 5)
ans = 64 (count 6)
ans = 128 (count 7)
ans = 256 (count 8) → now ans > 250, stop
Return count = 8
- A.
- Q84.UPPSC 2021
Which of these anomalies is also known as WW (Write–Write) conflict?
- A.
Dirty Read
- B.
Unrepeatable Read
- C.
Lost Update
- D.
Write Update
Correct answer: C
Solution
WW conflict = two transactions write the same item → one overwrites another → Lost Update anomaly.
A video solution is available for this question — log in and enroll to watch it.
- A.
- Q85.UPPSC 2021
A hash table contains 10 buckets and uses linear probing. Hash function: key % 10. Insert keys: 43, 165, 62, 123, 142. Where will 142 be inserted? (Assume table size = 8?)
- A.
2
- B.
3
- C.
4
- D.
6
Correct answer: D
Solution
Final answer: 142 is inserted at index 6.
Reasoning:
Hash table has 10 buckets (indexes 0–9). Hash function: key % 10. Linear probing is used to resolve collisions.
Insert 43: 43 % 10 = 3 → index 3 empty → place 43 at index 3.
Insert 165: 165 % 10 = 5 → index 5 empty → place 165 at index 5.
Insert 62: 62 % 10 = 2 → index 2 empty → place 62 at index 2.
Insert 123: 123 % 10 = 3 → index 3 occupied → probe to index 4 → index 4 empty → place 123 at index 4.
Insert 142: 142 % 10 = 2 → index 2 occupied (62) → probe to index 3 (occupied by 43) → probe to index 4 (occupied by 123) → probe to index 5 (occupied by 165) → probe to index 6 which is empty → place 142 at index 6.
Note: The question statement mentions 10 buckets; the answer 6 depends on using modulus 10. If the table size were actually 8, the insertion positions would change and you should use key % 8.
- A.
- Q86.UPPSC 2021
Convert the following number to base 9: (1101222.201121) 3
- A.
1358.647
- B.
4172.647
- C.
4178.153
- D.
1358.153
Correct answer: A
Solution


- A.
- Q87.UPPSC 2021
Cycle stealing is used in which context?
- A.
Clock cycle overriding
- B.
DMA based data transfer
- C.
Polling mode data transfer
- D.
Interrupt based data transfer
Correct answer: B
Solution
Key idea: Cycle stealing occurs during DMA-based data transfer. Definition: A DMA controller temporarily "steals" CPU bus cycles to transfer data directly between memory and peripherals.
- A.
- Q88.UPPSC 2021
Consider the following three claims —
I.(n+k)m = Θ(nm) where k and m are constants.
II. 2n+1 =O(2n )
III. 22n =O(2n)
Which of the above statements are correct?- A.
I and II
- B.
I and III
- C.
II and III
- D.
I, II and III
Correct answer: A
Solution
Big-O and Big-Theta compare how fast one function grows against another as n → ∞, ignoring constant multipliers and lower-order terms:
f(n) = Θ(g(n)) when positive constants c1, c2, and n0 exist such that c1·g(n) ≤ f(n) ≤ c2·g(n) for every n ≥ n0 — f and g grow at exactly the same rate.
f(n) = O(g(n)) when a positive constant c and n0 exist such that f(n) ≤ c·g(n) for every n ≥ n0 — f grows no faster than g, once a constant factor is allowed.
A direct consequence used below: any constant multiple of g(n) is O(g(n)); a polynomial (n+k)m with fixed constants k, m keeps nm as its dominant term, so it is Θ(nm); but if the ratio f(n)/g(n) itself grows without bound as n increases, f(n) is NOT O(g(n)).
Claim I: (n+k)m = Θ(nm), for constants k and m. Expanding by the binomial theorem, (n+k)m = nm + m·k·nm-1 + … + km — every term besides the leading one carries a strictly smaller power of n. Since k and m are fixed and don't grow with n, these lower-order terms and constant coefficients never change the asymptotic rate, so (n+k)m grows at exactly the rate of nm. This satisfies the Θ definition — TRUE.
Claim II: 2n+1 = O(2n). Since 2n+1 = 2 · 2n, it is exactly 2 times 2n — a constant multiple. Taking c = 2 and n0 = 1 in the O-definition, 2n+1 ≤ c·2n holds for every n ≥ n0. A constant multiplier never changes the O-class, so this holds — TRUE.
Claim III: 22n = O(2n). Here 22n = (2n)2 = 4n — not a constant multiple of 2n. The ratio 22n / 2n = 2n itself grows without bound as n increases, so no constant c can satisfy 22n ≤ c·2n for large n. This fails the O-definition — FALSE.
A quick numeric check confirms this: at n = 10, 2n+1 = 2048 is exactly twice 2n = 1024 — a fixed ratio of 2, matching claim II. But 22n = 220 = 1,048,576 against 2n = 1024 gives a ratio of 1024, and this ratio doubles every time n increases by 1 — it can never be capped by a fixed constant, confirming claim III fails.
So claim I and claim II both hold, while claim III does not — the correct combination is I and II.
- A.
- Q89.UPPSC 2021
Which one of the following arrays represents a binary max heap?
- A.
[25, 12, 16, 13, 10, 8, 14]
- B.
[25, 14, 13, 16, 10, 8, 12]
- C.
[25, 14, 16, 13, 10, 8, 12]
- D.
[25, 14, 12, 13, 10, 8, 16]
Correct answer: C
Solution
Rule: For an array representation of a binary max-heap using 1-based indexing, each parent at index i must be greater than or equal to its children at indices 2i and 2i+1 (if they exist).
For [25, 12, 16, 13, 10, 8, 14]: index 2 has value 12 and its left child at index 4 has value 13. Since 12 < 13, the max-heap property is violated.
For [25, 14, 13, 16, 10, 8, 12]: index 2 has value 14 and its left child at index 4 has value 16. Since 14 < 16, the max-heap property is violated.
For [25, 14, 16, 13, 10, 8, 12]:
Index 1 has value 25 and children 14 and 16; 25 ≥ 14 and 25 ≥ 16.
Index 2 has value 14 and children 13 and 10; 14 ≥ 13 and 14 ≥ 10.
Index 3 has value 16 and children 8 and 12; 16 ≥ 8 and 16 ≥ 12.
For [25, 14, 12, 13, 10, 8, 16]: index 3 has value 12 and its right child at index 7 has value 16. Since 12 < 16, the max-heap property is violated.
Conclusion: [25, 14, 16, 13, 10, 8, 12] is the only array that satisfies the binary max-heap property.
- A.
- Q90.UPPSC 2021
Which one of the following statement is false?
- A.
Any relation with two attributes is in BCNF.
- B.
A relation in which every key has only one attribute is in 2NF.
- C.
A prime attribute can be transitively dependent on a key in a 3NF relation.
- D.
A prime attribute can be transitively dependent on a key in a BCNF relation.
Correct answer: D
Solution
(a) In a 2-attribute relation any nontrivial functional dependency A→BA\to BA→B (or B→AB\to AB→A) makes the left side a key (it determines the whole relation). Hence such a relation satisfies BCNF. → (a) true .
(b) If every key is a single attribute there are no composite keys, so no possibility of partial dependency; therefore the relation is in 2NF . → (b) true .
(c) 3NF allows dependencies X→AX\to AX→A when AAA is a prime attribute even if XXX is not a superkey. So a prime attribute may be transitively dependent in a 3NF relation. → (c) true .
(d) BCNF requires every nontrivial X→AX\to AX→A to have XXX as a superkey. A transitive dependency (key → B → primeAttr) implies an intermediate non-key determines the prime attribute, which would violate BCNF (unless that intermediate determinant is also a superkey). So in general (d) is false .
- A.
- Q91.UPPSC 2021
A stereoscopic system in which users can step into a scene and interact with environment is called…
- A.
Touch screen
- B.
Mouse
- C.
Simulation
- D.
Virtual reality
Correct answer: D
Solution
A stereoscopic system that lets users step into a scene and interact with the environment is called Virtual Reality . In virtual reality, the user feels present inside a 3D world and can interact with objects or surroundings.
- A.
- Q92.UPPSC 2021
The CPU scheduling algorithm designed especially for time-sharing system is which one of the following?
- A.
First in First out
- B.
Last in First out
- C.
Round Robin
- D.
Shortest Job First
Correct answer: C
Solution
Time-sharing systems need fast switching among users. The best scheduling algorithm for this is Round Robin .
- A.
- Q93.UPPSC 2021
A test that was designed to provide satisfactory operational definition of intelligence is known as —
- A.
Litmus test
- B.
T–test
- C.
Turing test
- D.
Chi–square test
Correct answer: C
Solution
Correct answer: Turing test. Alan Turing proposed this as an operational (practical) definition of intelligence: if a machine can converse in such a human‑like way that an examiner cannot reliably tell it from a human, it is judged intelligent.
- A.
- Q94.UPPSC 2021
A direct or sequential access file has fixed size S-byte records. The first byte of record N will start at which logical location?
- A.
(N + S) + 1
- B.
N * (S - 1) + 1
- C.
((N - 1) * S) + 1
- D.
(N - 1) * (S - 1) + 1
Correct answer: C
Solution
For sequential/direct access: Logical address of record N = ((N − 1) × S) + 1
- A.
- Q95.UPPSC 2021
A 3-input neuron has weights 1, 4 and 3. The transfer function is linear with constant of proportionality equal to 3. The inputs applied are 4, 8 and 5 respectively. What will be the output?
- A.
139
- B.
153
- C.
162
- D.
160
Correct answer: B
Solution
Weighted sum = (1×4) + (4×8) + (3×5) = 4 + 32 + 15 = 51 . For a linear transfer function y = k×(weighted sum) with k = 3, output = 3×51 = 153 .
- A.
- Q96.UPPSC 2021
Which one is not a software quality model?
- A.
ISO 9000
- B.
McCall Model
- C.
Boehm Model
- D.
ISO 9126
Correct answer: A
Solution
Answer: ISO 9000 is not a software quality model.
Short explanations:
ISO 9126 / ISO/IEC 25010: Defines software product quality characteristics (functionality, reliability, usability, efficiency, maintainability, portability).
Boehm Model: A software quality model that relates high-level quality attributes to measurable criteria and helps assess product quality.
McCall Model: A software quality model defining factors and criteria (such as correctness, reliability, efficiency, integrity, usability) used to evaluate software quality.
ISO 9000: A family of standards for quality management systems (process and organizational requirements for ensuring quality). It focuses on management processes and certification, not on defining software product quality characteristics, so it is not a software quality model.
- A.
- Q97.UPPSC 2021
Which of the following is not used in standard JPEG image compression?
- A.
Huffman coding
- B.
Run-length coding
- C.
Zig–Zag scan
- D.
KL Transform
Correct answer: D
Solution
JPEG compression uses: DCT (Discrete Cosine Transform)
Zig-Zag scan
Run-length encoding
Huffman coding
KL Transform is NOT used in JPEG.
- A.
- Q98.UPPSC 2021
The page size in memory management depends on
- A.
Operating system
- B.
Architecture of machine
- C.
Internal memory
- D.
External memory
Correct answer: B
Solution
Page size is determined by the hardware architecture (MMU and address-translation support), not solely by the operating system or the amount of memory. Hardware (MMU, page-table format, and TLB) defines which page sizes are supported; the operating system can only use sizes provided by the hardware.
- A.
- Q99.UPPSC 2021
Which of the following is not a type of Artificial Intelligence (AI) agent?
- A.
Learning AI agent
- B.
Goal-based AI agent
- C.
Unity based AI agent
- D.
Simple reflex AI agent
Correct answer: C
Solution
The correct answer is: Unity based AI agent
Artificial Intelligence (AI) agents are systems that perceive their environment and take actions to achieve specific goals. Standard types of AI agents commonly studied in Artificial Intelligence include:
Simple Reflex AI Agent
These agents act only on the basis of the current percept and follow condition-action rules.Goal-Based AI Agent
These agents take actions to achieve predefined goals and evaluate possible future outcomes before acting.Learning AI Agent
These agents can learn from past experiences and improve their performance over time.
Other standard AI agent types include Model-Based Agents and Utility-Based Agents.
However, Unity based AI agent is not a recognized category of AI agents. Unity is a game development platform used for creating games, simulations, and interactive applications. Although AI techniques can be implemented using Unity, it is not itself a type of AI agent.
Therefore, the correct answer is:
Unity based AI agent
- A.
- Q100.UPPSC 2021
Which algorithm can be used to make decision of win/lose in Game Tree?
- A.
Greedy search algorithm
- B.
Heuristic search algorithm
- C.
Min/Max algorithm
- D.
DFS/BFS algorithm
Correct answer: C
Solution
Win/Lose decisions in Game Trees are made using the Minimax algorithm , commonly used in games like Chess, Tic-tac-toe etc.
- A.
- Q101.UPPSC 2021
Which of the following is a type of cluster computing?
- A.
Load sharing cluster
- B.
Load holding cluster
- C.
Load replication cluster
- D.
Load balancing cluster
Correct answer: D
Solution
Cluster computing is commonly categorized by its purpose, such as load balancing clusters, failover clusters, and high-availability clusters. A load balancing cluster is a valid type where incoming tasks are distributed across multiple machines to share workload and improve performance.
- A.
- Q102.UPPSC 2021
In which part of the HTML file metadata is contained?
- A.
title tag
- B.
head tag
- C.
HTML tag
- D.
body tag
Correct answer: B
Solution
Metadata in an HTML file is stored inside the <head> section, which includes information like title, meta tags, links to CSS, and scripts.
A video solution is available for this question — log in and enroll to watch it.
- A.
- Q103.UPPSC 2021
In which of the following scheduling policies does context switching never take place?
- A.
Round Robin
- B.
Shortest remaining time first
- C.
Pre-emptive
- D.
First-come-first-serve
Correct answer: D
Solution
Answer: First-come-first-serve (FCFS) Reason: FCFS is non-preemptive. The scheduler does not forcibly remove a running process; a process runs until it completes or blocks. No context switches due to preemption: because FCFS is non-preemptive, the OS does not interrupt a running process to switch to another.
- A.
- Q104.UPPSC 2021
Which of the following is not used to represent the region of an object in an image?
- A.
Run-length code
- B.
Quad Tree Code
- C.
Chain Code
- D.
Projection
Correct answer: D
Solution
Run-length coding and quad tree coding are standard region representation methods in image processing. They describe the pixels belonging to a region (either as runs or as hierarchical blocks). Chain code is mainly a boundary/contour representation method for an object’s shape, and is still used to represent objects/regions via their borders. Projection is used for feature extraction (e.g., horizontal/vertical profiles) rather than encoding a region itself. इसलिए region representation के लिए projection का उपयोग नहीं होता। इसलिए सही उत्तर है: Projection
- A.
- Q105.UPPSC 2021
Which of the following is not a real-time operating system?
- A.
RT Linux
- B.
QNx
- C.
Palm OS
- D.
VxWorks
Correct answer: C
Solution
RT Linux, QNX, and VxWorks are all real-time operating systems designed to respond within strict time limits. Palm OS does not provide guaranteed real-time behavior, so it is not a real-time operating system. RT Linux, QNX
- A.
- Q106.UPPSC 2021
Which of the following is not a chromosome selection method in genetic algorithms?
- A.
Rank selection
- B.
Tournament selection
- C.
Boltzmann selection
- D.
Uniform selection
Correct answer: D
Solution
In genetic algorithms, chromosome selection methods such as rank selection, tournament selection, and Boltzmann selection all choose chromosomes with probabilities based on their fitness. Uniform selection would choose every chromosome with equal probability, ignoring fitness, so it is not used as a standard chromosome selection method.
- A.
- Q107.UPPSC 2021
While using Javascript, the browser parses the HTML code into a tree-like structure defined by a standard called ________.
- A.
DOS
- B.
DOD
- C.
MOD
- D.
DOM
Correct answer: D
Solution
Browsers convert HTML into a tree structure called DOM (Document Object Model) .
A video solution is available for this question — log in and enroll to watch it.
- A.
- Q108.UPPSC 2021
Which one of the following started the ‘Lathi Club’ during the freedom struggle of India?
- A.
Bhagat Singh
- B.
Lala Lajpat Rai
- C.
Bipin Chandra Pal
- D.
Bal Gangadhar Tilak
Correct answer: D
Solution
Concept
During a mass movement, nationalist leaders often combined political mobilization with public associations, volunteer groups, and physical-training bodies.
To identify the founder of such a body, match its documented origin with the leader's regional network and period of activity.
Application
The Lathi Club was formed to organize lathi practice and physical preparedness among volunteers. Historical accounts of nationalist physical-culture initiatives attribute the start of this club to Bal Gangadhar Tilak.
Contrast
Bhagat Singh advanced youth political organization in Punjab through the Naujawan Bharat Sabha, founded in 1926.
Lala Lajpat Rai founded the Servants of the People Society in 1921 to train workers for public service.
Bipin Chandra Pal spread Swadeshi ideas in Bengal through journals such as New India and through public lectures.
Bal Gangadhar Tilak promoted mass organization in Maharashtra through public Ganapati festivals and Shivaji festivals.
Cross-check
The club's Swadeshi-era physical-training purpose fits Tilak's documented program of organized public mobilization. Therefore, Bal Gangadhar Tilak is the best-supported answer among the given names.
A video solution is available for this question — log in and enroll to watch it.
- A.
- Q109.UPPSC 2021
Who is traditionally credited with writing the Jain Kalpasutra?
- A.
Katyayan
- B.
Buddhaghosha
- C.
Nagsen
- D.
Bhadrabahu
Correct answer: D
Solution
CONCEPT
Traditional authorship of ancient religious texts is identified by matching the text’s sectarian tradition, subject matter, and transmitted attribution. Such attributions express a historical tradition rather than a modern claim of individually documented composition.
APPLICATION
The Kalpasutra is a Shvetambara Jain text containing accounts of the Tirthankaras, especially Mahavira, and rules for monastic life. Jain tradition attributes its compilation to the acharya Bhadrabahu. Therefore, the named author among the choices is Bhadrabahu.
CONTRAST AND CROSS-CHECK
Katyayan is associated with Sanskrit grammar and the varttika tradition.
Buddhaghosa is a Theravada Buddhist commentator associated with the Visuddhimagga.
Nagsen (Nagasena) is the Buddhist monk in the dialogue Milindapanha.
The other three names belong to Sanskrit grammatical or Buddhist traditions, whereas Bhadrabahu belongs to the Jain monastic tradition connected with this text.
RESULT
Thus, the traditionally credited author is Bhadrabahu.
A video solution is available for this question — log in and enroll to watch it.
- A.
- Q110.UPPSC 2021
Who is called the architect of the Panchayati Raj System in India?
- A.
Acharya Narendra Dev
- B.
G. V. K. Rao
- C.
B. R. Mehta
- D.
L. M. Singhvi
Correct answer: C
Solution
Concept
Democratic decentralisation distributes governing authority among elected bodies at village, intermediate, and district levels.
Committees on local government are distinguished by their purpose: initial institutional design, administrative strengthening, or constitutional recognition.
Application
The 1957 committee chaired by Balwant Rai Mehta evaluated the Community Development Programme and National Extension Service. It recommended democratic decentralisation through a three-tier Panchayati Raj structure, which makes Balwant Rai Mehta the person associated with the architecture of the system.
Contrast and cross-check
Acharya Narendra Dev is chiefly associated with socialist thought and education.
G. V. K. Rao chaired the 1985 committee that focused on administrative arrangements for rural development.
L. M. Singhvi chaired the 1986 committee that recommended constitutional recognition for Panchayati Raj institutions.
Official government accounts trace adoption of the three-tier Panchayat framework to the Balwant Rai Mehta Committee, while the later Rao and Singhvi committees dealt with strengthening administration and constitutional status.
Therefore, the best-supported offered value is B. R. Mehta, meaning Balwant Rai Mehta.
- A.
- Q111.UPPSC 2021
In India, which constitutional authority formally exercises the Union's power to negotiate and conclude foreign treaties?
- A.
Parliament
- B.
President
- C.
Prime Minister
- D.
Speaker of Lok Sabha
Correct answer: B
Solution
Concept
Under India’s constitutional scheme, international relations and treaty-making fall within the Union executive sphere. Article 53 vests the Union’s executive power in the President, while Article 74 requires the President to act on the aid and advice of the Council of Ministers.
This separates the formal constitutional authority from the officials and ministries that conduct negotiations in practice, and from Parliament’s role in implementing treaty obligations through domestic law.
Application
Among the listed authorities, the President represents the Union’s formal executive authority for treaty-making. The Prime Minister, Cabinet and Ministry of External Affairs direct and conduct the practical negotiations, but they do so through the Union executive acting constitutionally in the President’s name.
Contrast
Parliament may legislate under Article 253 to implement treaties, but that is a legislative implementation role.
The Prime Minister heads the Council of Ministers and directs foreign policy in practice, while the formal Union executive authority is vested in the President.
The Speaker of the Lok Sabha presides over the House and has no separate treaty-making authority.
Cross-check
Articles 53 and 74 identify the constitutional location and manner of exercising Union executive power; Article 253 separately identifies Parliament’s implementation power. This division confirms the President as the intended constitutional answer among the choices.
Therefore, the answer is President.
A video solution is available for this question — log in and enroll to watch it.
- A.
- Q112.UPPSC 2021
Which one of the following rulers adopted the title of ‘Hazrat-i-Ala’?
- A.
Babur
- B.
Akbar
- C.
Shah Jahan
- D.
Sher Shah
Correct answer: D
Solution
Concept
Medieval rulers used honorifics and regnal titles to express rank, legitimacy, or sovereignty. Such a title must be matched through historical usage, not inferred merely from a ruler’s fame or dynasty.
The Persian honorific “Hazrat-i-Ala” conveys the sense of an exalted or high personage.
Application
Historical accounts associate “Hazrat-i-Ala” with Sher Khan, who later ruled as Sher Shah Suri. Born Farid Khan, he established the Sur Empire after defeating Humayun and ruled northern India from 1540 to 1545.
Contrast
Babur, born Zahir-ud-din Muhammad, founded Mughal rule in India in 1526.
Akbar, formally Jalal-ud-din Muhammad Akbar, was a Mughal emperor who began his reign in 1556.
Shah Jahan, born Prince Khurram, was the Mughal emperor from 1628 to 1658.
Sher Shah, born Farid Khan and earlier known as Sher Khan, was the Sur ruler linked with the honorific in the question.
Result
Therefore, the ruler who adopted the title “Hazrat-i-Ala” was Sher Shah.
A video solution is available for this question — log in and enroll to watch it.
- A.
- Q113.UPPSC 2021
The system which is represented with multiple bits per pixel is referred to as —
- A.
Pixmap
- B.
Bitmap
- C.
K-map
- D.
Go-map
Correct answer: A
Solution
A system using multiple bits per pixel is called a Pixmap (pixel map).
- A.
- Q114.UPPSC 2021
Which one of the following is not the function of an operating system?
- A.
Memory Management
- B.
Virus Protection
- C.
Process Management
- D.
Processor Management
Correct answer: B
Solution
An operating system performs: Memory management
Process management
Processor management
But Virus protection is NOT an OS function (it is done by antivirus software).
A video solution is available for this question — log in and enroll to watch it.
- A.
- Q115.UPPSC 2021
How many states of DFA can be converted from an NFA with ‘n’ states?
- A.
n
- B.
n2
- C.
2n
- D.
None of the above
Correct answer: D
Solution
An NFA with n states can be converted to an equivalent DFA that has at most 2ⁿ states. Reason: In the subset construction, each DFA state represents a subset of the NFA's n states. An n-element set has 2ⁿ possible subsets, so in the worst case the DFA can have up to 2ⁿ states (though often it will have fewer).
A video solution is available for this question — log in and enroll to watch it.
- A.
- Q116.UPPSC 2021
Which of the following tool is used in image editing such as zooming, shrinking, rotating etc.?
- A.
Interpolation
- B.
Filters
- C.
Sampling
- D.
None of the above
Correct answer: A
Solution
Operations like zooming, shrinking, and rotating rely on Interpolation , which estimates pixel values during resizing or transformation.
- A.
- Q117.UPPSC 2021
Which of the following is empty or void element in HTML?
- A.
<p>
- B.
<br>
- C.
<abbr>
- D.
<sup>
Correct answer: B
Solution
HTML void elements are empty tags with no closing tag. <br> is a void (empty) element.
A video solution is available for this question — log in and enroll to watch it.
- A.
- Q118.UPPSC 2021
Which of the following is incorrect for atomic commit protocol to solve a variation of the consensus problem?
- A.
Termination
- B.
Agreement
- C.
Validity
- D.
Sincerity
Correct answer: D
Solution
Concept
An atomic commit protocol (such as two-phase commit) is a variation of the distributed consensus problem: every participant must reach one agreed-upon outcome for a transaction. Such a protocol is defined by a fixed set of correctness properties — Agreement, Validity, and Termination (with Integrity) — and any term outside this set is simply not a property of the protocol.
Application
Check each listed term against the defined correctness properties of an atomic commit / consensus protocol:
Term
A defined correctness property?
Agreement
Yes — all non-faulty participants reach the same final decision.
Validity
Yes — the decision is consistent with participants’ votes and transaction rules.
Termination
Yes — every correct participant must eventually decide.
Sincerity
No — it does not appear in the definition at all.
Result
Three of the listed terms are genuine required properties, so each correctly describes the protocol. “Sincerity” is not a property of any atomic commit or consensus protocol, so it is the statement that is incorrect for the protocol — which is exactly what the question asks for.
A video solution is available for this question — log in and enroll to watch it.
- A.
- Q119.UPPSC 2021
Which one of the following States in India has the maximum number of tribal districts as per India State of Forest Report 2023?
- A.
Nagaland
- B.
Madhya Pradesh
- C.
Mizoram
- D.
Manipur
Correct answer: B
Solution
Concept
The India State of Forest Report (ISFR), published biennially by the Forest Survey of India (FSI) under the Ministry of Environment, Forest and Climate Change, includes a dedicated chapter assessing forest cover in "tribal districts" — districts notified as having a significant Scheduled Tribe population. In this chapter, states are compared by the absolute COUNT of tribal districts they contain, which is a separate metric from a state's tribal population percentage.
Application
The ISFR 2023 (Volume II) state profiles list the following tribal-district counts for the four states offered:
State
Tribal districts (ISFR 2023)
Madhya Pradesh
24
Manipur
16
Mizoram
11
Nagaland
11
Reading the table: 24 is the largest of the four counts, so Madhya Pradesh has the maximum number of tribal districts among the states offered.
Cross-check
This is consistent with Madhya Pradesh's size and administrative structure: it has one of India's largest Scheduled Tribe populations in absolute numbers, spread across a large number of its districts. Mizoram and Nagaland, by contrast, have a HIGH PERCENTAGE of tribal population but a small total number of districts overall, which caps how many tribal districts they can have even though nearly all of their districts qualify. Count-of-districts and population-percentage are two different rankings, and this question specifically asks about the count.
A video solution is available for this question — log in and enroll to watch it.
- A.
- Q120.UPPSC 2021
In regular expression the operator ‘*’ stands for —
- A.
Addition
- B.
Concatenation
- C.
Iteration
- D.
Selection
Correct answer: C
Solution
In regular expressions, the operator * means iteration (zero or more repetitions).
A video solution is available for this question — log in and enroll to watch it.
- A.
- Q121.UPPSC 2021
With reference to the ‘Black Soil’, which of the statements is/are correct?
These are known as Regur.
They are rich in iron, lime, calcium, and potash.
- A.
Only 1
- B.
Only 2
- C.
Both 1 and 2
- D.
Neither 1 nor 2
Correct answer: C
Solution
Concept
Soil names and properties are distinct kinds of facts. A soil type may be identified by a regional name, while its mineral profile is established from its characteristic constituents; each statement must therefore be tested independently.
Application
Apply the two checks separately:
The name check: black soil is also called Regur, so the first statement records its accepted regional name.
The composition check: black soil is characteristically rich in calcium carbonate or lime, calcium, potash and iron-bearing minerals, so the second statement records recognized constituents of this soil.
Contrast
Contrast the offered combinations by value:
Only 1 accepts the name fact but excludes the mineral-composition fact.
Only 2 accepts the mineral-composition fact but excludes the name fact.
The combination “Both 1 and 2” accepts the name fact and the mineral-composition fact together.
The combination “Neither 1 nor 2” rejects both the name fact and the mineral-composition fact.
Result
Both independent checks hold; therefore, the result is Both 1 and 2.
A video solution is available for this question — log in and enroll to watch it.
- Q122.UPPSC 2021
The following Grammar is — S → aSb | bac | aB S → aSb | b S → aabb | ab bca → bdb | b
- A.
Type-0 (Unrestricted Grammar)
- B.
Regular
- C.
Context sensitive
- D.
LR(k)
Correct answer: A
Solution
Not Regular → because rules like
S → aSbare not allowed in regular grammarNot Context-Free → LHS must be a single non-terminal (violated by
bca → ...)Not Context-Sensitive → length decreases in
bca → b
✔️ Therefore, the grammar belongs to Type-0 (Unrestricted Grammar)
- A.
- Q123.UPPSC 2021
In which of the following rivers is the ‘Majuli River Island’ situated?
- A.
Krishna
- B.
Brahmaputra
- C.
Godavari
- D.
Indus
Correct answer: B
Solution
Concept
A river island is a landform enclosed by channels within a river system. To locate one, identify its region and match that region with the river system that contains it.
Application
Majuli is in Assam and lies within the channel system of the Brahmaputra. The Brahmaputra carries a heavy sediment load and has shifting braided channels that create and reshape river islands.
Contrast
Krishna: a peninsular river draining toward the Bay of Bengal.
Godavari: a peninsular river system of central and southern India.
Indus: a river system flowing mainly through Ladakh and Pakistan toward the Arabian Sea.
Cross-check and result
Authoritative references on Majuli identify it as an island in the Brahmaputra River in Assam. Therefore, Majuli Island is situated in the Brahmaputra River.
A video solution is available for this question — log in and enroll to watch it.
- A.
- Q124.UPPSC 2021
What is the minimum number of proposers and seconders required for a Presidential nomination?
- A.
10-10
- B.
50-50
- C.
25-25
- D.
15-15
Correct answer: B
Solution
Concept
In a Presidential election, the validity of a nomination paper depends on statutory support from electors in two separate roles: proposers and seconders.
The law sets a minimum for each role independently; meeting one count does not compensate for a shortfall in the other.
Application
Section 5B(1)(a) of the Presidential and Vice-Presidential Elections Act, 1952 requires a nomination paper to be subscribed by at least fifty electors as proposers and at least fifty electors as seconders.
Therefore, the required pair is 50 proposers and 50 seconders.
Contrast
10-10 assigns ten electors to each role, which is below the separate statutory minimum for each role.
25-25 assigns twenty-five electors to each role, which is below the separate statutory minimum for each role.
15-15 assigns fifteen electors to each role, which is below the separate statutory minimum for each role.
50-50 assigns fifty electors to each role and reaches the statutory minimum in both roles.
Cross-check
Checking the two roles separately gives proposer count = 50 and seconder count = 50; neither count is below the legal minimum.
Result
The minimum requirement is 50 proposers and 50 seconders.
A video solution is available for this question — log in and enroll to watch it.
- A.
- Q125.UPPSC 2021
The portal launched in August 2021 to create a national database of unorganized workers in India is known as –
- A.
E–Shramik Shakti
- B.
E–Labour
- C.
E–Shram
- D.
E–May Day
Correct answer: C
Solution
Correct answer: E–Shram
A video solution is available for this question — log in and enroll to watch it.
- A.
- Q126.UPPSC 2021
Which of the following Articles is related to the Protection of Life and Personal Liberty?
- A.
Article 20
- B.
Article 21
- C.
Article 22
- D.
Article 26
Correct answer: B
Solution
Concept
A constitutional-right question is solved by matching the right named in the stem with the operative subject of the relevant Article.
Nearby Articles may all protect liberty in a broad sense, but each has a distinct legal scope: conviction, life and personal liberty, arrest and detention, or religious administration.
Application
The stem uses the expression ‘protection of life and personal liberty’. Article 21 provides that no person shall be deprived of life or personal liberty except according to procedure established by law. Thus, the value asked for is Article 21.
Contrast
Article 20 deals with safeguards relating to conviction for offences, including ex post facto punishment, double jeopardy, and self-incrimination.
Article 22 deals with safeguards associated with arrest and detention, including information about the grounds of arrest and access to legal counsel.
Article 26 deals with the freedom of religious denominations to establish institutions and manage religious affairs.
Cross-check
The exact constitutional phrase ‘life or personal liberty’ appears in Article 21, confirming the match by wording as well as by legal scope.
A video solution is available for this question — log in and enroll to watch it.
- A.
- Q127.UPPSC 2021
Who among the following is not the winner of Nobel Prize in Physics announced in October 2021?
- A.
Syukuro Manabe
- B.
Klaus Hasselmann
- C.
Giorgio Parisi
- D.
Benjamin List
Correct answer: D
Solution
Correct answer: Benjamin List
A video solution is available for this question — log in and enroll to watch it.
- A.
- Q128.UPPSC 2021
Which Article of the Constitution of India provides for the Election Commission?
- A.
Article 322
- B.
Article 324
- C.
Article 352
- D.
Article 361
Correct answer: B
Solution
Concept: The Constitution establishes key institutions through specific articles. To identify the relevant provision, match the institution named in the question with the subject assigned to each article rather than relying on the numerical sequence.
Application: Article 324 vests the superintendence, direction and control of the preparation of electoral rolls and the conduct of elections in an Election Commission.
Contrast:
Article 322 concerns the expenses of the Union and State Public Service Commissions.
Article 324 concerns constitutional supervision, direction and control of electoral rolls and elections.
Article 352 governs a Proclamation of Emergency when India's security is threatened by war, external aggression or armed rebellion.
Article 361 provides specified immunities to the President and Governors during their terms of office.
Cross-check: These four provisions cover distinct constitutional subjects. Only Article 324 deals with the constitutional authority responsible for election administration. Therefore, the required provision is Article 324.
A video solution is available for this question — log in and enroll to watch it.
- A.
- Q129.UPPSC 2021
An XML document that adheres to syntax rules specified by XML 1.0 specification, in that it must satisfy both physical and logical structures, is called -
- A.
well-formed
- B.
reasonable
- C.
valid
- D.
sophisticated
Correct answer: A
Solution
An XML document that follows all XML 1.0 syntax rules , so that both its physical structure and logical structure are correct (proper nesting, required start and end tags, correct attribute format and structure), is called a well-formed XML document . A valid XML document is one that is well-formed and also follows the rules of a DTD or schema, but the question is only about following syntax rules, so the correct term here is well-formed .
A video solution is available for this question — log in and enroll to watch it.
- A.
- Q130.UPPSC 2021
Central Hindu School at Banaras was established by –
- A.
Vivekanand
- B.
Annie Besant
- C.
Madan Mohan Malviya
- D.
Dayanand Saraswati
Correct answer: B
Solution
Concept
For institutional-history questions, distinguish an institution's original founder from people associated with a later successor institution.
The founding date and the institution's continuity are stronger evidence than a person's broader association with the same city or university.
Application
Banaras Hindu University's Central Hindu Boys School records that Dr Annie Besant established the school on 7 July 1898 in a rented house at Karnaghanta, Varanasi. It later moved to Kamachha and was handed to the Banaras Hindu University Society in 1914.
Contrast
Vivekananda founded the Ramakrishna Mission, a separate religious and service organization.
Annie Besant founded the Central Hindu institution at Banaras in 1898.
Madan Mohan Malaviya led the movement that created Banaras Hindu University in 1916, the later university connected with the school.
Dayanand Saraswati founded the Arya Samaj, a different reform organization.
Cross-check
BHU's 2022–23 annual report independently states that Annie Besant established the Central Hindu Boys School on 7 July 1898, so the university record agrees with the school's history.
Result
Therefore, the Central Hindu School at Banaras was established by Annie Besant.
A video solution is available for this question — log in and enroll to watch it.
- A.
- Q131.UPPSC 2021
Given an intensity level (0, L−1) of an image with “r” and “s” positive values, how will the negative of an image be obtained?
- A.
s = L − 1 − r
- B.
s = L + r
- C.
s = L − r
- D.
s = L + 1 + r
Correct answer: A
Solution
To obtain the negative of a digital image, each input gray level r (between 0 and L - 1) is mapped to an output gray level using the negative transformation formula: s = (L - 1) - r When r = 0 (black), s becomes L - 1 (white), so the darkest pixels become the brightest.
- A.
- Q132.UPPSC 2021
The available ways to solve a problem of state space search is/are —
- A.
1
- B.
2
- C.
3
- D.
4
Correct answer: B
Solution
State space search problems can be solved mainly in two ways : Uninformed (Blind) Search
Informed (Heuristic) Search
- A.
- Q133.UPPSC 2021
Let P, Q & R be three languages, if P & R are regular and if PQ = R, then –
- A.
Q has to be regular
- B.
Q cannot be regular
- C.
Q need not be regular
- D.
Q has to be a CFL
Correct answer: C
Solution
Key idea: From P and R being regular and PQ = R, we cannot deduce that Q must be regular. Q may be regular or non-regular. Given: P is regular
R is regular
PQ = R (concatenation of P and Q)
Regular languages are closed under concatenation: if both P and Q are regular, then PQ is regular. However, the converse is not true: even if PQ is regular, Q itself need not be regular. Example where Q is regular: Let the alphabet be {a, b}. Take P = a* (regular) and Q = b* (regular). Then PQ = a*b*, which is regular.
Example where Q is not regular but PQ is still regular: Let the alphabet be {a, b}. Take P = Σ* (the set of all strings over {a, b}), which is regular.
Let Q = {a^n b^n
A video solution is available for this question — log in and enroll to watch it.
- A.
- Q134.UPPSC 2021
इनमें से जातिवाचक संज्ञा का शब्द है –
- A.
रामायण
- B.
लोहा
- C.
शिक्षक
- D.
सेना
Correct answer: C
Solution
शिक्षक जातिवाचक संज्ञा है।
जातिवाचक संज्ञा वे शब्द होते हैं जो किसी व्यक्ति, वस्तु या प्राणी की पूरी जाति या वर्ग का बोध कराते हैं। उदाहरण के लिए: लड़का, पुस्तक, नदी, शिक्षक।
रामायण: व्यक्तिवाचक संज्ञा — किसी विशेष ग्रंथ/नाम का बोध कराता है।
लोहा: द्रव्यवाचक संज्ञा — किसी पदार्थ या पदार्थ के प्रकार का बोध कराता है।
सेना: समूहवाचक संज्ञा — व्यक्तियों के समूह का बोध कराती है।
पहचानने का तरीका: यदि शब्द किसी पूरे वर्ग या पेशे को दर्शाता है तो वह जातिवाचक संज्ञा होती है।
- A.
- Q135.UPPSC 2021
Which of the following error can a compiler check?
- A.
Syntax Error
- B.
Logical Error
- C.
Both Logical Error and Syntax Error
- D.
None of the above
Correct answer: A
Solution
The compiler can detect syntax errors because they break the grammar rules of the programming language before the program is run. It cannot detect logical errors automatically, because logical errors depend on the meaning of the program and usually appear only when you run it and see wrong output.
- A.
- Q136.UPPSC 2021
How many types of random variables are there in Fuzzy logic?
- A.
2
- B.
4
- C.
1
- D.
3
Correct answer: A
Solution
In fuzzy logic, random variables can be of two types : Discrete fuzzy random variable
Continuous fuzzy random variable
- A.
- Q137.UPPSC 2021
Which of the following is not the part of activation record?
- A.
Actual parameters
- B.
Returned values
- C.
Formal parameters
- D.
Saved machine status
Correct answer: C
Solution
Concept: An activation record (stack frame) is the block of storage a compiler allocates for a single procedure call. The classical runtime-environment model fixes its standard fields as actual parameters, returned value, control link, access link, saved machine status, local data, and temporaries — nothing beyond that list is a distinct field.
Application: checking each option against that standard field list —
Actual parameters — named directly in the standard list, so this is a field of the activation record.
Returned value — named directly in the standard list, so this is a field of the activation record.
Saved machine status — named directly in the standard list; it holds the caller's register values, program counter, and return address needed to resume execution, so this is a field of the activation record.
Formal parameters — not named in that list. A formal parameter is only the name a function's own code uses for an incoming value; the compiler binds that name to the storage already reserved for the actual parameter (or treats it as ordinary local data), so no separate field is ever reserved for it.
Cross-check: three of the four options map onto fields explicitly named in the standard activation-record layout; the fourth, formal parameters, maps onto no field of its own — it is only an alias for storage that already exists elsewhere in the record, never a fresh allocation.
Therefore, the item that is not part of the activation record is formal parameters.
- A.
- Q138.UPPSC 2021
If the histogram of an object in an image is centered towards origin on X-axis, it signifies that —
- A.
object is bright
- B.
object is dark
- C.
object is good contrast
- D.
None of these
Correct answer: B
Solution
A histogram centered near the origin on the X-axis means pixel values are near 0 , indicating dark pixels .
- A.
- Q139.UPPSC 2021
इनमें से कौन-सा संयुक्त स्वर है?
- A.
ए, ओ
- B.
उ, ऐ
- C.
उ, ऐ
- D.
ई, ऊ
Correct answer: A
Solution
सही उत्तर: ए, ओ
व्याख्या: संयुक्त स्वर वे होते हैं जिनमें उच्चारण के समय दो अलग स्वर की तरह की ध्वनि मिलकर सुनाई देती है।
ए — यह संयुक्त स्वर माना जाता है क्योंकि इसका उच्चारण अ + इ के मिलन जैसा लगता है।
ओ — यह भी संयुक्त स्वर है क्योंकि इसका उच्चारण अ + उ के सम्मिश्रण जैसा होता है।
उ — यह एक सरल (एकल) स्वर है, इसलिए अकेला 'उ' संयुक्त स्वर नहीं है।
ऐ — यह संयुक्त स्वर है, पर 'उ' में संयुक्त स्वर नहीं है इसलिए वह जोड़ी सही नहीं है।
ई और ऊ — ये दोनों दीर्घ एकल स्वरों में आते हैं और संयुक्त स्वर नहीं माने जाते।
इसलिए केवल ए और ओ दोनों एक साथ ऐसे स्वर हैं जिन्हें संयुक्त स्वर कहा जा सकता है, अतः उत्तर "ए, ओ" सही है।
- A.
- Q140.UPPSC 2021
The number of tokens in the following statement is — For i = 1 to 10 Print (“xyz”) Next
- A.
26
- B.
11
- C.
3
- D.
6
Correct answer: B
Solution
We count tokens (keywords, identifiers, operators, constants, parentheses, strings). Statement: For i = 1 to 10 Print (“xyz”) Next Let's count: For
i
=
1
to
10
Print
(
"xyz"
)
Next
Total = 11 tokens
- A.
- Q141.UPPSC 2021
Which of the following is not an operating-system service?
- A.
Protection
- B.
Accounting
- C.
Compilation
- D.
I/O Operation
Correct answer: C
Solution
Concept: An operating system manages hardware resources and provides a controlled environment in which programs execute.
Its standard services include input/output handling, protection, resource allocation, and usage accounting. Language translation is performed by system programs such as compilers.
Application: Protection controls access to shared resources; accounting records their use; and I/O handling coordinates program requests with devices. Compilation instead translates source code through a compiler.
Protection concerns access control for memory, files, and devices.
Accounting concerns measurement and recording of resource use.
Compilation concerns translating source code into target or executable code.
I/O operation handling concerns communication between programs and devices.
Cross-check: Classifying each value by its responsible component separates operating-system resource services from language-processing work.
Result: Compilation is not an operating-system service among the offered choices.
- A.
- Q142.UPPSC 2021
To which depth does the alpha-beta pruning can be applied?
- A.
4
- B.
1
- C.
2
- D.
Any depth
Correct answer: D
Solution
Alpha–beta pruning can be applied to any depth in a game tree. It only eliminates branches that need not be explored, regardless of depth.
- A.
- Q143.UPPSC 2021
Predictive parser follows a ________.
- A.
Top down parsing approach
- B.
Bottom up parsing approach
- C.
Shift–reduce parsing
- D.
Both (a) and (b)
Correct answer: A
Solution
A predictive parser is a kind of LL(1) parser , which follows a top-down parsing approach that builds the parse tree from the start symbol using lookahead. It does not use bottom-up or shift–reduce parsing techniques, so only the top-down approach is correct for predictive parsers.
- A.
- Q144.UPPSC 2021
What is output of lexical analyzer?
- A.
Tokens
- B.
Data types
- C.
Code
- D.
None of the above
Correct answer: A
Solution
A lexical analyzer (scanner) reads source code and breaks it into tokens such as keywords, identifiers, operators, literals, etc. Hence, its output is tokens .
- A.
- Q145.UPPSC 2021
The algorithm which is prone to deadlock is —
- A.
Maekawa's algorithm
- B.
Ricart–Agrawala's algorithm
- C.
Lamport’s algorithm
- D.
None of these
Correct answer: A
Solution
Concept: A distributed mutual-exclusion algorithm is deadlock-free only if it forces one global order on all pending requests, so no set of processes can end up circularly waiting on each other's permissions. Timestamp-based total-ordering schemes guarantee this; permission/voting-based schemes in which each process waits on only an overlapping subset of the others do not guarantee it unless extra ordering or priority rules are added.
Algorithm
How permission is granted
Deadlock-free?
Lamport's algorithm
Every request is placed on one shared logical-timestamp-ordered queue; a process enters its critical section only when its own request is at the head everywhere.
Yes — a single total order rules out any circular wait.
Ricart–Agrawala's algorithm
A process replies immediately to any request whose timestamp is later than its own pending request, and defers only requests it must logically precede.
Yes — the same timestamp ordering rules out any cycle.
Maekawa's algorithm
A process needs permission from only a subset of processes (its voting set); voting sets overlap pairwise but are not globally ordered.
No — in its basic form, two processes can each hold part of the other's needed votes and wait on each other, forming a cycle.
Cross-check: Lamport's and Ricart–Agrawala's algorithms are both provably deadlock-free because of their total ordering, and among the given choices only one other named algorithm remains besides “none of these” — so the deadlock-prone one must be that remaining algorithm, which also rules out “none of these.”
Therefore, the algorithm prone to deadlock is Maekawa's algorithm.
- A.
- Q146.UPPSC 2021
An interdisciplinary field that tries to construct precise and testable theories of the working of human mind is known as —
- A.
Brain Science
- B.
Cognitive Science
- C.
Artificial Neural Network
- D.
Behavioural Science
Correct answer: B
Solution
The interdisciplinary field that builds precise, testable theories about how the human mind works, combining psychology, neuroscience, linguistics, computer science and philosophy, is called Cognitive Science .
- A.
- Q147.UPPSC 2021
An FSM can be used to add two given numbers (integers). This remark is —
- A.
True
- B.
False
- C.
Maybe True
- D.
None of the above
Correct answer: A
Solution
An FSM's limit is on how many internal states it holds, not on how long an input it can process. Whenever the decision at each step depends on the input only through a fixed, bounded summary of what came before it (never through the growing input itself), a finite-state machine can compute it, no matter how long the stream is.
Feed the two binary numbers bit by bit, starting from the least significant bit (LSB) of each.
Keep exactly one bit of state, the carry into the current position, so only two states are ever needed: carry = 0 and carry = 1.
At each step, on input bits (a, b) with incoming carry c, output (a XOR b XOR c) and move to carry' = 1 when at least two of {a, b, c} are 1, else carry' = 0, the standard full-adder rule.
After the last bit pair, output the final carry as the most significant bit of the sum.
Cross-check with 111 (7) + 001 (1), read LSB first: (1,1) with carry 0 gives output 0, carry 1; (1,0) with carry 1 gives output 0, carry 1; (1,0) with carry 1 gives output 0, carry 1. After the last pair the outgoing carry is 1, so it is emitted as the next (most significant) bit. Reading the bits from most significant to least significant gives 1000 in binary, which is 8, matching 7 + 1 = 8. This confirms the two-state construction and the final-carry flush work together for operands of any length.
So the remark is True. A common trap is confusing "an FSM cannot hold an arbitrarily large integer written out in its state" (true) with "an FSM cannot compute the sum of two such integers" (false). The machine never stores the whole number; it only ever tracks the single carry bit at each step, and that never grows with the operands' length.
A video solution is available for this question — log in and enroll to watch it.
- A.
- Q148.UPPSC 2021
Which of the following is a source coding technique?
- A.
Huffman coding
- B.
Arithmetic coding
- C.
Run-length coding
- D.
DPCM
Correct answer: A
Solution
Concept: A source coding technique removes redundancy from the source data so that the same information can be represented using fewer bits before transmission or storage. Huffman coding is a classic entropy-based source coding method that assigns shorter codewords to more probable symbols and longer codewords to less probable symbols, which reduces the average number of bits per symbol. Other techniques such as arithmetic coding, run-length coding, and DPCM are also used for data compression, but in this question the correct choice is the Huffman coding technique because it is taken as the standard example of source coding here.
- A.
- Q149.UPPSC 2021
Which of the following grammars are operator grammar? Where E, F, T are non-terminals and +, -, i, d, ε are terminal symbols. G₁: E → E+T | T T → T*F | F F → i | d G₂: E → E+T | T T → T*F | F F → i | d | ε G₃: E → E+T | T T → T*F | F | ε F → i | d G₄: E → E+T | T T → F F → i | d | F * i | ε
- A.
G₁, G₂
- B.
G₁, G₃, G₅
- C.
G₁, G₃, G₄
- D.
None of these
Correct answer: D
Solution
Definition: An operator-precedence (operator) grammar must not have ε-productions and must not contain two adjacent nonterminals on the right-hand side of any production. These restrictions ensure well-defined operator-precedence relations.
No ε-productions (no production whose right-hand side is ε).
No two adjacent nonterminals on any right-hand side.
Check each grammar against these rules:
G₁: E → E+T | T; T → T*F | F; F → i | d.
No ε-productions and every pair of nonterminals is separated by an operator, so G₁ satisfies the operator-grammar conditions.
G₂: same as G₁ but F → i | d | ε.
Contains an ε-production (F → ε), which disqualifies it as an operator grammar.
G₃: E → E+T | T; T → T*F | F | ε; F → i | d.
Contains an ε-production (T → ε), so G₃ is not an operator grammar.
G₄: E → E+T | T; T → F; F → i | d | F * i | ε.
Includes an ε-production (F → ε), so G₄ is not an operator grammar.
Conclusion: Only G₁ meets the operator-grammar requirements. Because none of the provided answer choices lists only G₁, the correct choice among the given options is 'None of these'.
- A.
- Q150.UPPSC 2021
An agent perceives its environment through which of the following?
- A.
sensors
- B.
eyes
- C.
arms
- D.
memory
Correct answer: A
Solution
An agent perceives (senses) the environment using sensors . For humans: eyes, ears, nose are sensors; For robots: cameras, microphones, IR sensors, etc.
- A.
- Q151.UPPSC 2021
Fuzzy logic is usually represented as —
- A.
IF – THEN rules
- B.
IF – THEN – ELSE rules
- C.
Both IF – THEN and IF – THEN – ELSE rules
- D.
None of the above
Correct answer: A
Solution
Fuzzy logic systems are modeled mainly using IF–THEN rules (fuzzy rule base). Examples: IF temperature is HIGH THEN fan speed is FAST IF–THEN–ELSE is not typical in fuzzy rule representation.
- A.
- Q152.UPPSC 2021
An agent acts upon its environment through which of the following?
- A.
sensors
- B.
eyes
- C.
actuators
- D.
memory
Correct answer: C
Solution
An agent perceives the environment using sensors , but an agent acts on the environment using actuators . Examples of actuators: Robot arms
Motors
Speakers
Wheels
- A.
- Q153.UPPSC 2021
A system has 3 processes sharing 4 resources, if each process needs a maximum of 2 units, then deadlock —
- A.
Can never occur
- B.
May occur
- C.
Has to occur
- D.
None of the above
Correct answer: A
Solution
Given: Number of processes P = 3
Total resources R = 4
Maximum need per process 2 units
To guarantee deadlock prevention , the rule is: R≥P×(max need−1)+1 Let's check: R≥3×(2−1)+1=3+1=4 And here: R=4⇒condition satisfied Since the system satisfies the condition for deadlock-free operation , 👉 deadlock can never occur .
- A.
- Q154.UPPSC 2021
The ______ specification defines an application programming interface for communication between the server and the application program.
- A.
Java Servlet
- B.
JDBC
- C.
Java Applet
- D.
Java Swing
Correct answer: A
Solution
Key idea: The Java Servlet specification defines the standard API that allows a web server to communicate with and invoke server-side Java applications (servlets). Defines how the web server passes requests to servlets and receives responses.
A video solution is available for this question — log in and enroll to watch it.
- A.
- Q155.UPPSC 2021
The sum of minimum and maximum number of final states in a DFA having n states is —
- A.
n
- B.
n+1
- C.
2n
- D.
n-1
Correct answer: A
Solution
In a DFA with n states : Minimum final states = 0
Maximum final states = n (All states can be final)
So the sum = 0+n = n
A video solution is available for this question — log in and enroll to watch it.
- A.
- Q156.UPPSC 2021
Any soft computing methodology is characterized with —
- A.
Control action is formally defined
- B.
Algorithm which can easily adapt with the change of dynamic environment
- C.
Precise solution
- D.
Control actions are unambiguous and accurate
Correct answer: B
Solution
Soft computing includes: Fuzzy Logic
Neural Networks
Genetic Algorithms
These methods are not strict and not precise , but instead: Handle uncertainty
Provide approximate solutions
Adapt to dynamically changing environments
Therefore, soft computing is characterized by adaptability , not formal or precise control. Important Points (English) Soft computing is a computational approach that deals with imprecision and uncertainty .
It includes techniques like Fuzzy Logic , Neural Networks , and Genetic Algorithms .
Soft computing does not require exact models or precise inputs .
It focuses on providing approximate but acceptable solutions .
These methods can learn and adapt to changing environments.
Soft computing systems are flexible and robust .
It is widely used in AI, machine learning, control systems, pattern recognition , and decision-making.
The key characteristic of soft computing is adaptability , not strict formal control.
- A.
- Q157.UPPSC 2021
The similarity between two entities (point, curves or shapes) of the same type is determined by using —
- A.
Entity matching
- B.
Temple matching
- C.
Structural matching
- D.
Statistical classification
Correct answer: C
Solution
When comparing entities like: points
curves
shapes
The method used is Structural Matching , because it compares the internal structure, geometry, or form of two shapes. Important Points (English) A cluster is a group of computers (nodes) that work together as a single system.
Clustering middleware manages and coordinates these computers.
It handles communication between nodes in the cluster.
It provides resource sharing , such as CPU, memory, and storage.
Clustering middleware ensures load balancing across nodes.
It supports fault tolerance by detecting node failures and reallocating tasks.
It makes the cluster appear as one unified system to users and applications.
Examples include Hadoop YARN, Kubernetes, MPI, and OpenMPI .
- A.
- Q158.UPPSC 2021
In distributed systems, link and site failure is detected by —
- A.
token passing
- B.
polling
- C.
hand shaking
- D.
None of the above
Correct answer: C
Solution
In distributed systems, to detect link failure or site failure , the common technique is handshaking (exchange of signals to check if the other node is alive). Token passing is for access control, not failure detection. Polling is used but not primarily for failure detection across all nodes. Important Points (English) In a distributed system , detecting link failure or site (node) failure is critical.
Handshaking is the most common technique used for this purpose.
In handshaking, nodes periodically exchange signals/messages (heartbeats).
If a node does not receive a response within a fixed time, the other node is assumed to have failed .
Handshaking helps in detecting both communication link failures and node crashes .
Token passing is mainly used for mutual exclusion and access control , not for failure detection.
Polling can be used in some cases, but it is not the standard or primary technique for failure detection in distributed systems.
Handshaking is widely used due to its simplicity and reliability .
Correct Technique: ✅ Handshaking
- A.
- Q159.UPPSC 2021
Which of these properties are balanced by using adaptive grids?
- A.
Accuracy and Efficiency
- B.
Accuracy and Convergence
- C.
Accuracy and Stability
- D.
Efficiency and Stability
Correct answer: A
Solution
Adaptive grids (used in numerical methods, PDE solving, image processing, CFD, etc.) adjust the grid resolution dynamically depending on the solution behavior. They aim to balance: Accuracy → higher resolution where needed
Efficiency → avoid unnecessary computation in uniform regions
Hence, adaptive grids provide high accuracy while maintaining computational efficiency . Adaptive grids dynamically adjust grid resolution based on solution behavior.
Regions with rapid changes or high gradients use finer grids for better accuracy.
Regions with smooth or uniform solutions use coarser grids to save computation.
This approach reduces unnecessary calculations compared to uniform grids.
Adaptive grids are widely used in numerical methods, PDE solving, CFD, image processing , and simulations.
They provide a balance between high accuracy and computational efficiency .
Adaptive grids also help in reducing memory usage and execution time .
- A.
- Q160.UPPSC 2021
In distributed file system, file name does not reveal the —
- A.
local name
- B.
physical storage location
- C.
both local name and physical storage location
- D.
None of the above
Correct answer: B
Solution
In a Distributed File System (DFS) : A file name should be independent of its physical storage location .
Users should not know or care where the file is physically stored.
File name only represents the file logically , not its real location.
Therefore, the file name does NOT reveal physical storage location . Important Points (English) In a Distributed File System (DFS) , the file name is independent of its physical storage location .
Users do not need to know where the file is actually stored in the network.
The file name provides only a logical identity , not the real (physical) location.
This property is known as location transparency .
Location transparency allows files to be moved or replicated without changing their names.
DFS improves scalability, reliability, and ease of use for distributed environments
- A.
- Q161.UPPSC 2021
CPU scheduling is the basis of —
- A.
Multiprocessor system
- B.
Multiprogramming operating system
- C.
Larger memory sized system
- D.
None of the above
Correct answer: B
Solution
CPU scheduling allows multiple processes to share the CPU efficiently. This is the core of a multiprogramming operating system , where: CPU utilization is maximized
Multiple programs execute concurrently
Processes are interleaved
Hence, CPU scheduling forms the basis of multiprogramming OS . Important Points (English) CPU Scheduling decides which ready process gets the CPU next.
It is essential when multiple processes are present in memory at the same time.
This situation exists in a multiprogramming operating system .
CPU scheduling helps in maximizing CPU utilization .
It allows concurrent execution of multiple programs by interleaving processes.
Without CPU scheduling, multiprogramming cannot function efficiently .
Hence, CPU scheduling forms the foundation of a multiprogramming OS .
Correct Answer: ✅ Multiprogramming operating system
- A.
- Q162.UPPSC 2021
Which of the following is not an HTML tag?
- A.
<select>
- B.
<list>
- C.
<input>
- D.
<textarea>
Correct answer: B
Solution
Answer: <list>
<select> is a valid HTML tag for drop-down lists.
<input> is a valid HTML tag for form input controls.
<textarea> is a valid HTML tag for multi-line text input. It must be written as one word.
<list> is not a valid HTML tag; HTML lists use <ul>, <ol>, and <li>.
Therefore, <list> is the only option that is not an HTML tag.
A video solution is available for this question — log in and enroll to watch it.
- A.
- Q163.UPPSC 2021
Assume that every
fork()call succeeds and every process continues the loop. How many child processes are created by the following code?for (i = 0; i < n; i++) fork();- A.
n
- B.
2n − 1
- C.
2n
- D.
2n+1 − 1
Correct answer: B
Solution
Concept
A successful
fork()call creates one new child for every process that executes it. If all existing processes reach the nextfork()call, the total process count doubles after each call.Application
Let P0 be the initial number of processes. Before the loop starts, P0 = 1.
At iteration k, every one of the Pk processes creates one child, so Pk+1 = 2Pk.
Applying this recurrence n times gives Pn = 2n.
The original process is not a child. Therefore, created children = Pn − P0 = 2n − 1.
Cross-check
For n = 3, the total process count follows 1 → 2 → 4 → 8. Thus 8 − 1 = 7 new child processes.
Result: 2n − 1 child processes.
- A.
- Q164.UPPSC 2021
Signal transmission at a typical synapse in a neural network is a –
- A.
Chemical Process
- B.
Physical Process and Chemical Process both
- C.
Physical Process
- D.
None of the above
Correct answer: A
Solution
A synapse is the junction where one neuron communicates with the next, and this junction is classified into two general types: an electrical synapse, where ionic current passes directly between the two cells through gap-junction channels, and a chemical synapse, where a chemical messenger (a neurotransmitter) is released by one neuron, diffuses across a narrow gap, and binds receptors on the neighbouring neuron to regenerate the signal. The vast majority of synapses in the vertebrate nervous system are of the chemical type; electrical synapses are the much rarer exception.
The introductory biological-neuron model taught alongside Artificial Neural Networks — and the "typical synapse" this question refers to — is the standard, chemical-type synapse: the presynaptic terminal releases neurotransmitter molecules that diffuse across the synaptic cleft and bind postsynaptic receptors, regenerating an electrical impulse in the receiving neuron. This is why the syllabus for ANN (and this UPPSC Computer Science paper) tests the biological neuron before introducing the artificial one — the artificial neuron's weighted inputs are a simplified stand-in for how a real neuron receives many such synaptic inputs of varying strength.
Physical Process and Chemical Process both — a given synapse is classified as electrical or chemical, not both operating together at the same junction; the typical synapse this question refers to uses only the chemical route.
Physical Process — this names the electrical (gap-junction) mechanism found at the rarer, non-typical synapse type; the typical synapse this question refers to crosses the gap chemically, not electrically.
None of the above — the typical synapse's crossing mechanism is well-described as chemical, one of the given categories, so ruling out every listed description misses that match.
- A.
- Q165.UPPSC 2021
Which page direction should be used in JSP to generate a PDF page?
- A.
Generate Pdf
- B.
Content type
- C.
Type Pdf
- D.
Content Pdf
Correct answer: B
Solution
To generate a PDF response in JSP, set the contentType attribute in the page directive to a PDF MIME type (typically application/pdf). JSP
A video solution is available for this question — log in and enroll to watch it.
- A.
- Q166.UPPSC 2021
Suppose that a process is in blocked state waiting for some I/O service, when the service is completed, it goes to the –
- A.
Running state
- B.
Ready state
- C.
Suspended state
- D.
Terminated state
Correct answer: B
Solution
A process in the blocked state is waiting for an I/O event. When the I/O completes, the process becomes ready to run, so it moves to the Ready state (ready queue). It will enter the Running state only when the CPU scheduler selects it.
- A.
- Q167.UPPSC 2021
OM (Oral Message) Algorithm is used for –
- A.
Deadlock detection
- B.
Mutual exclusion
- C.
Consensus
- D.
Leader election
Correct answer: C
Solution
The OM (Oral Messages) algorithm is used in the Byzantine Generals (Byzantine agreement) problem to achieve consensus even when some processes may be faulty or malicious. Therefore, it is used for consensus .
- A.
- Q168.UPPSC 2021
Which one of the following models is not suitable for accommodating any changes?
- A.
RAD Model
- B.
Build & Fix Model
- C.
Waterfall Model
- D.
Prototype Model
Correct answer: C
Solution
Waterfall model is the least suitable for accommodating changes because it is a rigid, sequential process. Once a phase (like requirements or design) is completed, making changes typically requires going back and redoing earlier work, which is difficult and costly.
- A.
- Q169.UPPSC 2021
First derivative approximation says that values of constant intensities must be –
----------------------------------------
- A.
1
- B.
0
- C.
Positive
- D.
Negative
Correct answer: B
Solution
Key idea: The first derivative measures the rate of change of intensity. If the intensity is constant, it does not change, so the rate of change (first derivative) is 0.
- A.
- Q170.UPPSC 2021
In order to participate in cloud-computing you must be using the following OS –
- A.
Windows
- B.
MacOS
- C.
Linux
- D.
All of the above
Correct answer: D
Solution
Cloud computing is generally operating-system independent . You can access cloud services from Windows, macOS, or Linux (typically via a web browser or supported client tools). Therefore, the correct choice is: All of these operating systems.
- A.
- Q171.UPPSC 2021
Which of the following system calls transforms an executable binary file into a process?
- A.
fork
- B.
exec
- C.
ioctl
- D.
longjmp
Correct answer: B
Solution
Key idea: The exec*() family is what loads an executable file into a process. exec*() replaces the current process image with a new program from an executable binary (e.g., execve()).
fork() only creates a new process by duplicating the current one; it does not load a new executable.
- A.
- Q172.UPPSC 2021
How many maximum number of objects can be represented by Z-buffer algorithm?
- A.
Only one object
- B.
Only two objects
- C.
Arbitrary number of objects which is processed one at a time
- D.
It cannot represent any object
Correct answer: C
Solution
Z-buffer keeps a depth (z) value for each pixel . When rendering multiple objects, the depth at a pixel is compared and the closest surface is kept. So it can represent an arbitrary number of objects ; objects are processed during rendering, but there is no fixed limit on how many objects can be handled.
- A.
- Q173.UPPSC 2021
The cyclomatic complexity of the following graph is –

- A.
4
- B.
5
- C.
7
- D.
6
Correct answer: B
Solution
Concept. McCabe's cyclomatic complexity V(G) counts the linearly independent paths through a program graph. For a graph with E edges, N nodes and P connected components, V(G) = E − N + 2P, which becomes V(G) = E − N + 2 when the graph is a single connected component. Equivalently, a planar drawing of such a graph is divided into exactly V(G) regions, counting the unbounded outer region.
Applying this to the graph shown.
Count the nodes. The vertices drawn are a, b, c, d, e and f, so N = 6.
Count the edges, one per arrow: a → b, a → c, c → b, c → e, b → d, d → b, e → d, e → f and f → d. The vertices b and d are joined by two arrows pointing opposite ways, and each arrow is its own edge, so E = 9.
The whole drawing is one connected component, so P = 1 and the formula reduces to V(G) = E − N + 2.
Substitute the counts: V(G) = 9 − 6 + 2 = 5.
Cross-check by regions. The drawing has no crossing lines, so its regions can be counted directly: the a-b-c cycle, the two-arrow loop between b and d, the area bounded by b, c, e and d, and the d-e-f cycle give 4 bounded regions, and the outer region makes 5. The cycle-space form (E − N + 1) + 1 = (9 − 6 + 1) + 1 = 5 agrees.
A common slip. Reading the two arrows between b and d as a single edge gives E = 8 and V(G) = 8 − 6 + 2 = 4, so each arrow must be counted separately.
Hence the cyclomatic complexity of the graph is 5.
- A.
- Q174.UPPSC 2021
The redundancy in images stems from –
- A.
Pixel decorrelation
- B.
Pixel correlation
- C.
Pixel quantization
- D.
Image size
Correct answer: B
Solution
Image redundancy exists because neighboring pixels are often highly correlated . This correlation creates unnecessary repeated information in the image.
- A.
- Q175.UPPSC 2021
Number of messages required in Suzuki–Kasami algorithm is –
- A.
2(N−1)
- B.
3(N−1)
- C.
0 or (N−1)
- D.
0 या N
Correct answer: C
Solution
Suzuki–Kasami is a token-based mutual exclusion algorithm . Message complexity: When requesting the token → (N−1) messages
When holding the token → 0 messages
So message requirement = 0 or (N−1) .
- A.
- Q176.UPPSC 2021
The fragmentation which cannot be fully eliminated is –
- A.
Internal fragmentation
- B.
External fragmentation
- C.
Both (a) and (b)
- D.
None of the above
Correct answer: A
Solution
Concept: Fragmentation is wasted memory produced by a scheme's own allocation mechanics. Internal fragmentation is unused space left inside an already-allocated fixed-size unit (e.g., a page or a fixed partition), because that unit rarely matches a process's exact requirement. External fragmentation is unused space that appears between allocated blocks, as variable-size allocations and deallocations scatter free memory into small, non-contiguous holes over time.
Application: Trace what happens under each scheme:
Fixed-size allocation (paging/frames, fixed partitions) grants a process whole units; when its actual requirement is not an exact multiple of the unit size, the leftover space inside the last unit is internal fragmentation.
That leftover space stays locked inside the allocated unit and cannot be reassigned to another process, nor reduced to zero, without shrinking the unit size itself (which only trades it for higher management overhead) - so internal fragmentation persists as long as fixed-size allocation is used.
Variable-size allocation (dynamic partitioning, segmentation) instead lets processes take exactly the size they need; but as processes arrive and leave, the freed spaces get scattered into small, non-contiguous holes between allocated blocks - this is external fragmentation.
External fragmentation has a direct operational cure: compaction relocates every currently-allocated block together so the scattered holes merge into one contiguous block, removing external fragmentation completely, in principle.
Because external fragmentation has a technique that removes it entirely while internal fragmentation has no such fix short of abandoning fixed-size allocation altogether, the type that cannot be fully eliminated is internal fragmentation.
Cross-check:
External fragmentation is not the answer, because compaction is a standard, well-documented technique that consolidates its scattered free memory into a single contiguous block.
Both types together is not accurate either, since external fragmentation does have a full removal technique - treating the two as equally unremovable overstates that case.
None of the listed options is also not right, since internal fragmentation does correctly name a fragmentation type that is structurally impossible to reduce to zero without changing the allocation scheme itself.
Note: everyday explanations sometimes stress how costly compaction is to run in practice and describe external fragmentation as the one that 'cannot be removed' - but strictly, compaction is a genuine complete-removal technique for external fragmentation, while internal fragmentation has no equivalent fix, which is why internal fragmentation is the standard keyed answer here.
- A.
- Q177.UPPSC 2021
Which formal system provides the semantic foundation for PROLOG?
- A.
Predicate Calculus
- B.
Lambda Calculus
- C.
Hoare Logic
- D.
Propositional Logic
Correct answer: A
Solution
PROLOG is based on First-Order Predicate Logic .
- A.
- Q178.UPPSC 2021
Simple Network Management Protocol (SNMP) operates at which port number?
- A.
160
- B.
161
- C.
164
- D.
163
Correct answer: B
Solution
SNMP uses UDP port 161 for general communication. (Port 162 is used for traps/notifications.)
A video solution is available for this question — log in and enroll to watch it.
- A.
- Q179.UPPSC 2021
Which of the following is not a basic primitive of Graphics Kernel System (GKS)?
- A.
Polyline
- B.
Polydraw
- C.
Fill area
- D.
Polymarker
Correct answer: B
Solution
GKS basic primitives are:
Polyline
Polymarker
Fill area
Text
Cell array
Polydraw is not a GKS primitive. Therefore, Polydraw is the correct choice for the item that is not a basic GKS primitive.
- A.
- Q180.UPPSC 2021
Edge detection in an image via zero crossings can be done by:
- A.
Robert’s operator
- B.
Prewitt operator
- C.
Sobel operator
- D.
Laplacian of Gaussian
Correct answer: D
Solution
Zero-crossing based edge detection is performed by the Laplacian of Gaussian (LoG) operator.
- A.
- Q181.UPPSC 2021
Which of the following represents the degree of set membership?
- A.
Degree of Truth
- B.
Probabilities
- C.
Discrete set
- D.
Both (a) and (b)
Correct answer: A
Solution
In fuzzy logic, set membership is represented by degree of truth , not by probability. A membership function μ_A(x) assigns each element x a value in the interval [0, 1]. μ_A(x) = 0 means x is not a member of the fuzzy set.
- A.
- Q182.UPPSC 2021
In shadow mask CRT, each pixel emits ______ lights.
- A.
Black and White
- B.
Blue, Green, Red
- C.
Blue, Green, White
- D.
Green, Red, Black
Correct answer: B
Solution
A shadow mask CRT uses three electron beams corresponding to RGB colors. Each pixel emits Red, Green, and Blue lights.
- A.
- Q183.UPPSC 2021
The software which governs the group of computers is ______.
- A.
distributor
- B.
clustering middleware
- C.
Interface (UI)
- D.
Driver R445
Correct answer: B
Solution
A group of computers working together is managed by clustering middleware . It handles coordination, communication, and resource sharing.
- A.
- Q184.UPPSC 2021
Which of the following is known as clipping in computer graphics?
- A.
Removing objects and lines
- B.
Copying
- C.
Adding graphics
- D.
Zooming
Correct answer: A
Solution
Clipping means removing portions of objects that lie outside the viewing area . Important Points (English) Clipping is the process of removing parts of objects that lie outside the viewing area .
The viewing area is also called the clipping window or viewport .
Clipping improves display efficiency by showing only visible portions.
It is commonly applied to lines, polygons, text, and curves .
Popular algorithms include Cohen–Sutherland (line clipping) and Sutherland–Hodgman (polygon clipping) .
Clipping is widely used in computer graphics, CAD systems, and GUI rendering .
- A.
- Q185.UPPSC 2021
The First Order Logic (FOL) statement (R∨Q)∧(P∨¬Q) is equivalent to which of the following?
- A.
(R∨Q)∧(P∨¬Q)∧(¬R∨P)
- B.
((R∨Q)∧(P∨¬Q)∧(R∨P))
- C.
(R∨Q)∧(P∨¬Q)∧(¬R∨¬P)
- D.
(R∨Q)∧(P∨¬Q)∧(¬R∨P)
Correct answer: B
Solution
Given:
(R ∨ Q) ∧ (P ∨ ¬Q)
Using Boolean algebra:
(R + Q)(P + Q̅)
Expanding,
= RP + RQ̅ + PQ + QQ̅
Since,
QQ̅ = 0
therefore,
= RP + RQ̅ + PQ
Now check Option B:
(R + Q)(P + Q̅)(R + P)
First compute:
(R + Q)(P + Q̅)
= RP + RQ̅ + PQ
Now multiply by (R + P):
(RP + RQ̅ + PQ)(R + P)
Using absorption laws:
RP(R + P) = RP
RQ̅(R + P) = RQ̅
PQ(R + P) = PQ
Hence,
= RP + RQ̅ + PQ
which is exactly the original expression.
Therefore,
(R ∨ Q) ∧ (P ∨ ¬Q)
≡ (R ∨ Q) ∧ (P ∨ ¬Q) ∧ (R ∨ P)
Correct Option: B
- A.
- Q186.UPPSC 2021
Which of the following is a computer graphics type?
- A.
Raster and Vector
- B.
Raster and Scalar
- C.
Scalar only
- D.
None of the above
Correct answer: A
Solution
The two major computer graphics types are Raster graphics and Vector graphics . Important Points (English) Computer graphics are mainly classified into Raster graphics and Vector graphics .
Raster graphics are made of pixels arranged in rows and columns.
Image quality in raster graphics depends on resolution ; enlarging causes pixelation .
Examples of raster formats include JPEG, PNG, BMP, GIF .
Vector graphics are created using mathematical equations (lines, curves, shapes).
Vector images are resolution independent and can be scaled without loss of quality.
Common vector formats are SVG, EPS, PDF, AI .
Raster graphics are widely used in photographs , while vector graphics are preferred for logos and diagrams .
- A.
- Q187.UPPSC 2021
Which of the following is not a variable length encoding?
- A.
LZW encoding
- B.
Huffman encoding
- C.
Shannon Fano encoding
- D.
Adaptive Huffman encoding
Correct answer: A
Solution
LZW encoding uses fixed-length codes , not variable-length. The others (Huffman, Shannon-Fano, Adaptive Huffman) are variable-length encodings . Important Points (English) LZW (Lempel–Ziv–Welch) encoding uses fixed-length codes during encoding.
LZW works by building a dictionary dynamically and replacing repeated strings with fixed-size codewords.
Since code length remains constant, LZW decoding is simpler and faster .
Huffman encoding uses variable-length codes , where frequent symbols get shorter codes.
Shannon–Fano encoding is also variable-length , based on symbol probabilities.
Adaptive Huffman encoding updates code lengths dynamically, so it is variable-length as well.
Variable-length encodings generally achieve better compression than fixed-length methods.
- A.
- Q188.UPPSC 2021
If a plane is parallel to the plane of projection, it appears –
- A.
true size
- B.
as a line or edge
- C.
fore shortened
- D.
as an oblique surface
Correct answer: A
Solution
When a plane is parallel to the projection plane , it appears in its true size . Important Points (English) When a plane is parallel to the plane of projection , its true size and shape are seen.
There is no foreshortening because all points of the plane are at the same distance from the projection plane.
True size is visible on the projection plane to which the object is parallel .
If the plane is parallel to HP (Horizontal Plane) , true shape appears in the top view .
If the plane is parallel to VP (Vertical Plane) , true shape appears in the front view .
This concept is widely used in engineering drawing to understand object geometry clearly.
- A.
- Q189.UPPSC 2021
For getting the mirror image of a triangle, which of the following transformation is needed?
- A.
Rotation
- B.
Scaling
- C.
Rotation and Scaling both
- D.
Reflection
Correct answer: D
Solution
Mirror image is always obtained using reflection transformation. Important Points (English) A mirror image is produced using a reflection transformation .
Reflection creates a flipped image across a mirror line (axis).
The size and shape of the object remain unchanged after reflection.
Orientation changes: left becomes right and right becomes left .
The mirror line is the perpendicular bisector of the line joining a point and its image.
Reflection is an isometric transformation , so distances are preserved.
- A.
- Q190.UPPSC 2021
Complement of a fuzzy set A ' ={(X 1 ,0.8) , (X 2 , 0.2)} is –
- A.
{(X₁, 0.2), (X₂, 0.8)}
- B.
{(X₁, 1), (X₂, 1)}
- C.
{(X₁, 0.6), (X₂, 0.6)}
- D.
) {(X₁, 0.4), (X₂, 0.1)}
Correct answer: A
Solution
Complement of a fuzzy membership value is: μ′=1−μ So: For X 1 : 1−0.8=0.2
For X 2 : 1−0.2 = 0.8
Thus complement = {(X₁, 0.2), (X₂, 0.8)}
- A.
- Q191.UPPSC 2021
In distributed system each processor has its own ______.
- A.
local memory
- B.
clock
- C.
both local memory and clock
- D.
None of the above
Correct answer: C
Solution
In a distributed system, each processor works independently and therefore must have: Its own local memory
Its own clock
Important Concept (English) In a distributed system , multiple processors (nodes) work independently and communicate through a network. Each processor must have its own local memory because there is no shared global memory. Each processor also has its own clock , as there is no single global clock controlling all processors. Because of different clocks, clock synchronization becomes an important issue in distributed systems.
- A.
- Q192.UPPSC 2021
Which command is used to perform backup in UNIX?
- A.
backup
- B.
cpio
- C.
zip
- D.
gzip
Correct answer: B
Solution
In UNIX, cpio (copy in–copy out) is a standard command used for backup and restore operations. Important UNIX Backup-Related Commands (English) tar – Used to create and extract backup archives
cpio – Used for creating and restoring backups
rsync – Used for incremental backup and data synchronization
dump / restore – Used for full filesystem backup and recovery
dd – Used to take disk or partition-level backup
- A.
- Q193.UPPSC 2021
In Artificial Intelligence (AI), which agent deals with happy and unhappy state?
- A.
Simple reflex agent
- B.
Model based agent
- C.
Learning agent
- D.
Utility based agent
Correct answer: D
Solution
“Happy” or “Unhappy” states refer to how good or bad a situation is , which is evaluated using a utility function . Only Utility-based agents use utility to select the best action.
- A.
- Q194.UPPSC 2021
इनमें से जातिवाचक संज्ञा का शब्द है —
- A.
रामायण
- B.
लोहा
- C.
शिक्षक
- D.
सेना
Correct answer: C
Solution
सही उत्तर: शिक्षक — जातिवाचक संज्ञा
परिभाषा: जातिवाचक संज्ञा किसी वर्ग, प्रकार या पेशे के लोगों/वस्तुओं का सामान्य नाम होती है।
रामायण → यह एक ग्रंथ/पुस्तक का विशेष नाम है, इसलिए व्यक्तिवाचक (विशेष नाम) संज्ञा।
लोहा → यह किसी पदार्थ/धातु का नाम है, इसलिए द्रव्यवाचक संज्ञा।
शिक्षक → यह किसी वर्ग/पेशे के लोगों का सामान्य नाम है (उदा. एक शिक्षक, कई शिक्षक), इसलिए जातिवाचक संज्ञा।
सेना → यह लोगों का समूह बताने वाला शब्द है, इसलिए समूहवाचक संज्ञा।
याद रखने का उपाय: किसी शब्द को देखें और सोचें कि वह किसी विशेष नाम बताता है, किसी पदार्थ को बताता है, किसी वर्ग/प्रकार को बताता है या किसी समूह को — इससे संज्ञा का प्रकार तुरंत पहचान में आ जाएगा।
- A.
- Q195.UPPSC 2021
इनमें से किस वर्ग में ऊष्म ध्वनियाँ है?
- A.
श, ष, स, ह
- B.
व
- C.
ए, ऐ
- D.
ऋ, ए, ठ
Correct answer: A
Solution
ऊष्म ध्वनियाँ (Fricatives) — वे ध्वनियाँ जो उच्चारण में वायु के संकुचित मार्ग से गुजरते समय घर्षण (friction) उत्पन्न करती हैं। हिन्दी में ऊष्म ध्वनियाँ हैं: श, ष, स, ह — उदाहरण: श (शेर), ष (विष), स (सूर्य), ह (हाथ)।
- A.
- Q196.UPPSC 2021
इनमें से 'समास' का विलोम शब्द है –
- A.
मधुमास
- B.
कपास
- C.
प्रयास
- D.
व्यास
Correct answer: D
Solution
समास का अर्थ है — दो या अधिक शब्दों का संयोग।
विलोम: व्यास — जिसका अर्थ है विस्तार, फैलाव, या अलग‑अलग होना।
सही उत्तर: व्यास।
संक्षिप्त स्पष्टीकरण:
क्यों सही: 'समास' शब्दों के मिलन का भाव देता है; 'व्यास' मिलन के विपरीत फैलाव/अलग‑अलग होने का भाव देता है, इसलिए यह विलोम है।
क्यों अन्य विकल्प गलत हैं: 'मधुमास', 'कपास', और 'प्रयास' इन शब्दों के अर्थ 'संयोग/विभाजन' से संबंधित नहीं हैं और इसलिए वे समास के विलोम नहीं हैं।
- A.
- Q197.UPPSC 2021
अनेकार्थक शब्द ‘कोटि’ का सही अर्थ व्यक्त करने वाला इनमें से सही शब्द है
- A.
अद्भुत
- B.
कमर
- C.
श्रेणी
- D.
ऊरू
Correct answer: C
Solution
“कोटि” के अर्थ होते हैं:
प्रकार / वर्ग / श्रेणी
- A.