Aptitude Test Solution
Aptitude Test Solution
Please Note: The correct answer is denoted by a green highlight and the solution is provided, if any.
APTITUDE TEST
Section-I: Technical
1. Consider the following process table. Calculate the average waiting time using FCFS.
Prepared by Kashish Zaveri, Samarth Joshi, Tarun Ray, Unnati Suryawanshi (T&P Coordinators) 20-03-25
2. The size of virtual memory is based on which of the following?
(a) CPU
(b) Address Bus Correct answer
(c) RAM
(d) Data Bus
Solution:
Virtual memory is an extension of physical memory (RAM) and is managed using the addressing
capability of the system.
• Address Bus determines the total addressable memory space.
• Virtual memory size depends on the addressing capacity of the CPU, which is defined by the
address bus width (e.g., a 32-bit address bus can address up to 4GB, while a 64-bit address bus
can address much more).
.
3. For which of the following purposes in Banker’s algorithm is used?
Solution:
Banker's Algorithm is used in deadlock prevention and avoidance by ensuring that a system never
enters an unsafe state. It checks resource allocation before granting requests to avoid deadlocks.
Prepared by Kashish Zaveri, Samarth Joshi, Tarun Ray, Unnati Suryawanshi (T&P Coordinators) 20-03-25
Solution:
The program uses fork(), which creates a new child process. Each call to fork() doubles the number
of processes.
Step-by-step Execution:
1. First fork() → Creates 2 processes (Parent & Child).
2. Second fork() → Each of the 2 processes calls fork(), creating 4 processes in total.
3. Each process executes printf("code ") once.
Thus, "code " is printed 4 times.
Solution:
The Network Layer (Layer 3) is responsible for routing and forwarding data between different
networks.
• Router operates at the network layer by determining the best path for data packets to travel.
• Other devices like switches (Layer 2) and repeaters (Layer 1) operate at lower layers.
6. Choose the correct formula for the total vulnerable time value of pure ALOHA.
(a) ½ Tfr
(b) Tfr
(c) 2*Tfr Correct answer
(d) 4*Tfr
Solution:
Total Vulnerable Time in Pure ALOHA:
• In Pure ALOHA, a collision can occur if another station starts transmitting within Tfr (Frame
Transmission Time) before or after a given frame starts.
• So, the total vulnerable time is:
2×Tfr
7. Identify among the following the network device used to connect two dis-similar types of networks.
(a) Switch
(b) hub
(c) Bridge
(d) Gateway Correct answer
Prepared by Kashish Zaveri, Samarth Joshi, Tarun Ray, Unnati Suryawanshi (T&P Coordinators) 20-03-25
Solution:
Network Device for Connecting Dissimilar Networks:
• Gateway is used to connect two different types of networks with different protocols,
architectures, or communication methods (e.g., connecting a TCP/IP network to an ATM
network).
• Other devices like switches, hubs, and bridges operate within similar network types.
Solution:
Identifying Class A IP Address:
• Class A IP addresses range from 1.0.0.0 to 126.255.255.255 (First octet: 1-126).
• Class B starts from 128.0.0.0 to 191.255.255.255.
Now, checking options:
• 121.12.12.248 → Class A
• 130.12.12.248 → Class B
• 128.12.12.248 → Class B
• 129.12.12.248 → Class B
9. If a class C is derived from class B, which is derived from class A, all through public inheritance, then
a class C member function can access:
Solution:
In public inheritance, the access specifiers behave as follows:
• Public members of the base class remain public in the derived class.
• Protected members of the base class remain protected in the derived class.
• Private members of the base class are not accessible in the derived class.
Given:
• Class C inherits Class B → Class B inherits Class A, all through public inheritance.
Access in Class C:
• Class C can access:
o Public and Protected members of A and B.
o All members of itself (C).
Prepared by Kashish Zaveri, Samarth Joshi, Tarun Ray, Unnati Suryawanshi (T&P Coordinators) 20-03-25
10. What will be the output of the following Java program?
(a) Class B: 20
x = 20
(b) Class A: 10
x = 10
(c) Class B: 20 Correct answer
x = 10
(d) Compilation Error
Solution:
Method Overriding in Java:
• The show() method is overridden in class B.
• Since obj is created as A obj = new B();, runtime polymorphism ensures B's show() is called.
• System.out.println("Class B: " + x); prints Class B: 20.
Variable Shadowing:
• Class B has its own x = 20, but obj.x refers to A's x = 10.
• System.out.println("x = " + obj.x); prints x = 10.
Prepared by Kashish Zaveri, Samarth Joshi, Tarun Ray, Unnati Suryawanshi (T&P Coordinators) 20-03-25
11. When is the object created with a new keyword?
Solution:
The new keyword dynamically allocates memory for an object at runtime.Object creation happens
when the program executes, not at compile time.
12. Choose the option below for which instance of the class cannot be created.
Solution:
• An instance of an abstract class cannot be created because an abstract class is incomplete and
may have abstract methods that lack implementation.
• Abstract classes are meant to be inherited and their methods overridden in derived classes.
(a) Schema
(b) Attribute
(c) Super key Correct answer
(d) Domain
Solution:
• A super key is a set of one or more attributes that can uniquely identify a tuple (row) in a table.
• It may contain extra attributes beyond what is necessary for uniqueness.
• A candidate key is a minimal super key.
Prepared by Kashish Zaveri, Samarth Joshi, Tarun Ray, Unnati Suryawanshi (T&P Coordinators) 20-03-25
Solution:
• In SQL, when using GROUP BY, all selected columns must either be included in the GROUP BY
clause or be used in an aggregate function.
• Here, dept_name is grouped, and AVG(salary) is an aggregate function, so they are valid.
• However, ID is not part of GROUP BY and is also not used in an aggregate function, which causes
an error.
15. Which of the following statements is FALSE about weak entity set?
(a) Weak entities can be deleted automatically when their strong entity is deleted.
(b) Weak entity set avoids the data duplication and consequent possible inconsistencies caused by
duplicating the key of the strong entity.
(c) A weak entity set has no primary keys unless attributes of the strong entity set on which it
depends are included
(d) Tuples in a weak entity set are not partitioned according to their relationship with tuples in a
strong entity set. Correct answer
Solution:
A weak entity set is an entity set that does not have a sufficient attribute to form a primary key on
its own. It depends on a strong entity set and is identified using a foreign key and a discriminator
(partial key).
Explanation of Options:
(a) True → Weak entities are often deleted automatically when their corresponding strong entity is
deleted (due to cascade delete in databases).
(b) True → Weak entity sets avoid data duplication by not repeating the primary key of the strong
entity. Instead, they use a foreign key relationship.
(c) True → A weak entity does not have a primary key unless it includes attributes from the strong
entity.
(d) False → Tuples in a weak entity are partitioned based on their relationship with tuples in the
strong entity. Each weak entity must be associated with a strong entity.
(a) 1NF
(b) 2NF
(c) 3NF Correct answer
(d) BCNF
Solution:
3NF (Third Normal Form) removes transitive dependency, where a non-key attribute depends on
another non-key attribute instead of the primary key.
Prepared by Kashish Zaveri, Samarth Joshi, Tarun Ray, Unnati Suryawanshi (T&P Coordinators) 20-03-25
17. Which of the following sorting algorithms provide the best time complexity in the worst-case
scenario?
Solution:
Merge Sort has the best worst-case time complexity of O(n log n), whereas Quick Sort can degrade
to O(n²) in the worst case.
18. Kruskal’s Algorithm for finding the Minimum Spanning Tree of a graph is a kind of a?
(a) DP Problem
(b) Greedy Algorithm Correct answer
(c) Adhoc Problem
(d) None of the above
Solution:
Kruskal’s Algorithm follows the Greedy approach as it always picks the smallest edge that doesn’t
form a cycle to build the Minimum Spanning Tree (MST).
19. What is the worst case time complexity of inserting n elements into an empty linked list, if the linked
list needs to be maintained in sorted order?
(a) Θ(n)
(b) Θ(n log n)
(c) Θ(n2) Correct answer
(d) Θ(1)
Solution:
To maintain a sorted linked list while inserting n elements, each insertion may require scanning the
entire list in the worst case (O(n) per insertion).
Thus, for n insertions, the total worst-case time complexity is Θ(n²).
Prepared by Kashish Zaveri, Samarth Joshi, Tarun Ray, Unnati Suryawanshi (T&P Coordinators) 20-03-25
20. What is the time complexity for the following C module? Assume that n > 0;
Solution:
The given recursive function calculates the sum of the first n natural numbers:
module(n)=n + module(n−1)
Since each recursive call reduces n by 1 and runs n times before reaching the base case (n == 1), the
time complexity is O(n).
21. Which of these algorithmic approach tries to achieve localized optimum solution
Solution:
The Greedy approach makes the best possible choice at each step, aiming for a localized optimum
solution in the hope that it leads to a global optimum solution.
Solution:
In simple chaining (used in hashing), a doubly linked list is preferred because it allows efficient
insertion and deletion from both ends, making it more flexible for handling collisions.
Prepared by Kashish Zaveri, Samarth Joshi, Tarun Ray, Unnati Suryawanshi (T&P Coordinators) 20-03-25
23. Which of the following infix expressions is obtained on converting the postfix expression:
AB–C+DEF-+$
(a) A-B+C+D$E-F
(b) A-B+C$D+E–F Correct answer
(c) A–B$C+D+E-F
(d) None of the above
Solution:
Step-by-step evaluation:
1. A B - → (A - B)
2. C + → ((A - B) + C)
3. D E F - + → (D + (E - F))
4. $ → ((A - B) + C) $ (D + (E - F))
Thus, the correct infix expression is:
(A - B) + C $ (D + E - F)
Solution:
• In JavaScript, when a number is added to a string using the + operator, implicit type coercion
occurs.
• The number 5 is converted to a string, and string concatenation happens instead of arithmetic
addition.
• "5" + "9" results in "59" (as a string).
Prepared by Kashish Zaveri, Samarth Joshi, Tarun Ray, Unnati Suryawanshi (T&P Coordinators) 20-03-25
25. What will be the result of the following code snippet?
Solution:
Code Analysis:
• The character array ch = "abcdefghij" is initialized.
• The variable ans starts at 0.
• The for loop iterates from i = 0 to 9, computing (ch[i] - 'a') and adding it to ans.
Computation:
Each character’s position in the alphabet (0-based index) is summed:
0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 =45
(a) 8
(b) 648 Correct answer
(c) 72
(d) None of the above
Prepared by Kashish Zaveri, Samarth Joshi, Tarun Ray, Unnati Suryawanshi (T&P Coordinators) 20-03-25
Solution:
Operator Precedence in C:
• Both division ( / ) and multiplication ( * ) have the same precedence.
• Operators with the same precedence are evaluated from left to right.
So, the calculation proceeds as:
1. 216 / 3 → 72
2. 72 * 3 → 216
3. 216 * 3 → 648
27. Considering the size of char (character) variables as one byte, what will be the size of the array
declared below?
Char array[] = “programming language”;
(a) 11 Bytes
(b) 8 Bytes
(c) 20 Bytes
(d) 21 Bytes Correct answer
Solution:
Prepared by Kashish Zaveri, Samarth Joshi, Tarun Ray, Unnati Suryawanshi (T&P Coordinators) 20-03-25
28. Which is valid C expression?
Solution:
A, C, and D options are incorrect since the variable name cannot start with an underscore, or dollar
sign and it cannot contain space in between.
(a) ‘\n’
(b) ‘\\’
(c) Both of the above Correct answer
(d) None of the above
Solution:
A character constant in C is enclosed in single quotes (' ') and represents a single character.
Valid character constants include:
• '\n' → Represents the newline character.
• '\\' → Represents a single backslash (\), as \ is an escape character.
Prepared by Kashish Zaveri, Samarth Joshi, Tarun Ray, Unnati Suryawanshi (T&P Coordinators) 20-03-25
30. Consider the following C program:
Solution:
Understanding the Program Execution:
1. Function Call: swap(a, b);
o The function swap(int x, int y) is called with a = 10 and b = 20.
o However, in C, arguments are passed by value, meaning the function receives copies of
a and b as x and y.
2. Inside the Function swap(x, y):
o The values of x and y are swapped inside the function.
o But since C uses call by value, changes to x and y do not affect the original variables a
and b.
3. After Function Call:
o The values of a and b remain 10 and 20, as they were never actually swapped in main().
Prepared by Kashish Zaveri, Samarth Joshi, Tarun Ray, Unnati Suryawanshi (T&P Coordinators) 20-03-25
Section-II: Verbal Ability
31. Choose the most appropriate replacement:
"Hardly had I reached the station, ___ the train left."
(a) Then
(b) Than
(c) When Correct answer
(d) Since
Solution:
The correct structure is "Hardly had...when."
Solution:
It should be "was present" because "Neither" is singular.
(a) Intriguing
(b) Captivating
(c) Mundane Correct answer
(d) Enthralling
Solution:
"Mundane" means boring or uninteresting.
Prepared by Kashish Zaveri, Samarth Joshi, Tarun Ray, Unnati Suryawanshi (T&P Coordinators) 20-03-25
34. What does the idiom "To hit the nail on the head" mean?
Solution:
This idiom means to be precise and accurate, especially in describing or solving a problem. It
originates from carpentry, where hitting a nail exactly on the head ensures it goes in straight and
effectively.
(a) Theist
(b) Atheist
(c) Agnostic Correct answer
(d) Skeptic
Solution:
An agnostic neither believes nor disbelieves in God.
Prepared by Kashish Zaveri, Samarth Joshi, Tarun Ray, Unnati Suryawanshi (T&P Coordinators) 20-03-25
Section-III: Logical Reasoning & Data Interpretation
37. Which word does NOT belong with the others?
(a) Index
(b) Glossary
(c) Chapter
(d) Book Correct answer
Solution:
Book. Rest are all parts of a book.
Solution:
This is an analogy question, where we identify the relationship between the given words.
Parts: Strap → "Parts" is an anagram of "Strap" (letters rearranged).
Wolf:? → The correct answer should follow the same pattern.
Rearranging the letters of Wolf, we get Flow.
(a) 7
(b) 12
(c) 10 Correct answer
(d) 13
Solution:
It’s an alternating addition and subtraction series. 3 is added in the first pattern, and then 2 is
subtracted.
40. Ravi is a son of Aman’s father’s sister. Sahil is the son of Divya who is the mother of Gaurav and
grandmother of Aman. Ashok is the father of Tanya and grandfather of Ravi. Divya is the wife of
Ashok.
How is Ravi related to Divya?
(a) Nephew
(b) Son
(c) Grandson Correct answer
(d) Data inadequate
Prepared by Kashish Zaveri, Samarth Joshi, Tarun Ray, Unnati Suryawanshi (T&P Coordinators) 20-03-25
Solution:
There is no requirement for drawing a family tree to solve this question. Since Divya is the
grandmother of Aman and Aman and Ravi are cousins (from the first statement). Ravi should be a
grandson to Divya.
41. Statement: Food poisoning due to the consumption of liquor is very common in rural areas
Assumption I: There are more illegal and unauthorised shops selling liquor in villages and rural areas
Assumption II: The ratio of people drinking liquor in villages is much more than that in towns
Solution:
The statement is talking about food poisoning due to liquor so the number of people consuming
liquor in towns or villages is not the main concern here. Which is why the only assumption I follow.
42. In a row of persons, the position of Sakshi from the left side of the row is 26th and position of Sakshi
from the right side of the row is 35th. Find the total number of students in the row?
(a) 67
(b) 32
(c) 46
(d) 60 Correct answer
Solution:
The time 26+35-1 = 61-1 = 60.
43. In a certain code language, ‘ANIMALS’ is written as ‘SLAMINA’. How is ‘ONLINE’ written in that code?
Solution:
The first alphabet is replaced with the last alphabet, the second with second last and so on.
Prepared by Kashish Zaveri, Samarth Joshi, Tarun Ray, Unnati Suryawanshi (T&P Coordinators) 20-03-25
Section-IV: Quantitative Aptitude
44. A boy buys 18 sharpeners, (Brown/white) for Rs.100. For every white sharpener, he pays one rupee
more than the brown sharpener. What is the cost of white sharpener and how much did he buy?
(a) 5, 13
(b) 5, 10
(c) 6, 10 Correct answer
(d) None of these
Solution:
Assume that he bought b, brown sharpeners and w, white sharpeners and the cost of brown
sharpener is x and white sharpener is x + 1
Given:
1. Total sharpeners → b + w =18
2. Total cost → bx + w(x+1) = 100
Substituting b = 18 − w in the cost equation:
(18−w)x + w(x+1) = 100
18x + w =100
Solving for x=5, we get w=10.
So, white sharpener costs Rs. 6, and he bought 10 white sharpeners
45. In how many ways a team of 11 must be selected a team 5 men and 11 women such that the team
must comprise of not more than 3 men.
(a) 1243
(b) 2456
(c) 2256 Correct answer
(d) 1565
Solution:
We need to form a team of 11 members from 5 men and 11 women, with at most 3 men (i.e., 0, 1,
2, or 3 men).
Using combinations:
0 men, 11 women → 5C0 x 11C11 = 1 x 1 = 1
1 men, 10 women → 5C1 x 11C10 = 5 x 11 = 55
2 men, 9 women → 5C2 x 11C9 = 10 x 55 = 550
3 men, 8 women → 5C3 x 11C8 = 10 x 165 = 1650
Summing up:
1 + 55 + 550 + 1650 = 2256
Prepared by Kashish Zaveri, Samarth Joshi, Tarun Ray, Unnati Suryawanshi (T&P Coordinators) 20-03-25
46. A is 20 percent more efficient than B. If the two persons can complete a piece of work in 60 days.in
how many days. A working alone can complete the work
(a) 80
(b) 90
(c) 100
(d) 110 Correct answer
Solution:
As A is 20% more efficient than B, If B's per day work is 100 units then A's 120.
Both persons together complete (100 + 120) units = 220 units a day.
They took 60 days to complete the work.
So total work = 60 x 220 = 13200 units.
A alone works at 120 units per day, so the time required: 13200/120 = 110 days
47. In how many different ways can the letters of the word "LEADING" be arranged in such a way that
the vowels always come together.
(a) 360
(b) 720 Correct answer
(c) 480
(d) 5040
Solution:
Given letters are A, E, I, D, L, N, G Of which AEI are vowels. Let us combine them into a single letter
x. Now total letters are x, D, L, N, G.
These letters are arranged in 5! ways. But 3 vowels can arrange themselves in 3! ways.
So total ways 5! x 3! = 720.
48. There are 100 wine glasses. I offered my servant to 3 paise for every broken glass to be delivered
safely and forfeit 9 paisa for every glass broken at the end of day. He received Rs.2.40. How many
glasses did he break?
(a) 20
(b) 73
(c) 5 Correct answer
(d) 8
Solution:
Let the number of broken glasses be 𝑥.
Number of safe glasses = 100−𝑥.
Earnings from safe glasses = 3𝑥 (100−𝑥) paise.
Loss from broken glasses = 9×𝑥 paise.
Total earnings equation:3𝑥(100−𝑥) −9×𝑥=240
Simplify the equation:300−3𝑥 −9𝑥 =240
60=12𝑥= 5
The servant broke 5 glasses
Prepared by Kashish Zaveri, Samarth Joshi, Tarun Ray, Unnati Suryawanshi (T&P Coordinators) 20-03-25
49. A owes B Rs.50. He agrees to pay B over a number of consecutive days on a Monday, paying single
note or Rs.10 or Rs.20 on each day. In how many different ways can A repay B.
Solution:
The person can pay in the following ways:
All ₹10 notes → 1 way
3 Ten-rupee + 1 Twenty-rupee → 4!/3!1!= 4 ways
1 Ten-rupee + 2 Twenty-rupee → 3!/2!1!= 3 ways
Total ways = 1 + 4 + 3 = 8
50. In a race, A can run 30 meters in the time B takes to run 25 meters. If A and B start a race at the same
time, and A runs at a constant speed, by how much distance will A win the race if the total race
length is 200 meters?
Solution:
Speed Ratio: A’s speed to B’s speed = 6:5.
Race Distance: The race is 200 meters long.
A’s Time: Time for A to run 200 meters = 200/6 (relative speed).
B’s Distance: In the same time, B will run 6/5×200=180 meters.
Distance A Wins By: A wins by 200−180=20 meters.
Thus, A wins by 20 meters.
Prepared by Kashish Zaveri, Samarth Joshi, Tarun Ray, Unnati Suryawanshi (T&P Coordinators) 20-03-25