What is the main purpose of a constructor in a class?
A To delete objects B To initialize objects C To perform calculations D To print data
A constructor is used to initialize objects of a class with default or specified values
In Java, which keyword is used to prevent inheritance?
A private B protected C final D static
The 'final' keyword prevents a class from being subclassed or inherited
What is the main difference between ArrayList and LinkedList in Java?
A ArrayList is faster for random access B LinkedList is faster for random access C Both have same performance D ArrayList uses more memory
ArrayList provides O(1) random access, while LinkedList provides O(n) access
What does 'HTTP' stand for?
A HyperText Transfer Protocol B High Transfer Text Protocol C Hyper Transfer Type Protocol D Hyper Text Type Protocol
HTTP stands for HyperText Transfer Protocol, the foundation of data communication on the web
Which of these is a NoSQL database?
A MySQL B PostgreSQL C MongoDB D Oracle
MongoDB is a NoSQL database. MySQL, PostgreSQL, and Oracle are relational SQL databases
In CSS, what does the 'z-index' property control?
A Font size B Text alignment C Stacking order of elements D Background color
z-index controls the stacking order of overlapping elements on a webpage
What will be the output of: console.log(typeof 5) in JavaScript?
A int B number C integer D numeric
The typeof operator returns 'number' for numeric values in JavaScript
A rope of length 30 meters is cut into 5 equal parts. How long is each piece?
A 5 meters B 6 meters C 7 meters D 8 meters
30 meters / 5 = 6 meters per piece
If 30% of a number is 45, what is the number?
A 100 B 120 C 150 D 180
Let number = x. 30% of x = 45. 0.30x = 45. x = 0 45 .30 = 150
A box contains 3 red balls and 2 blue balls. What is the probability of drawing a red ball?
A 5 1 B 5 2 C 5 3 D 5 4
Total balls = 5. Red balls = 3. Probability = 5 3
If a square has a side of 5 cm, what is its area?
A 10 cm² B 20 cm² C 25 cm² D 30 cm²
Area of square = side² = 5² = 25 cm²
What is 15% of 200?
A 20 B 25 C 30 D 35
15% of 200 = (100 15 ) × 200 = 0.15 × 200 = 30
Two numbers are in the ratio 3:4. If their sum is 70, what are the numbers?
A 30, 40 B 35, 35 C 20, 50 D 25, 45
Let numbers be 3x and 4x. 3x + 4x = 70. 7x = 70. x = 10. Numbers are 30 and 40
What is the GCD of 24 and 36?
A 6 B 8 C 12 D 24
Factors of 24: 1,2,3,4,6,8,12,24. Factors of 36: 1,2,3,4,6,9,12,18,36. GCD = 12
What is the missing number in this sequence: 5, 10, 20, 40, ?
A 50 B 60 C 70 D 80
Each number is multiplied by 2. 5×2=10, 10×2=20, 20×2=40, 40×2=80
A train travels 300 km in 5 hours. If it increases its speed by 20%, how long will it take to cover 360 km?
A 4 hours B 5 hours C 4.5 hours D 3.5 hours
Original speed = 5 300 = 60 km/h. New speed = 60 × 1.2 = 72 km/h. Time = 72 360 = 5 hours
Two pipes A and B can fill a tank in 12 hours and 15 hours respectively. If both pipes are opened together, how long will it take to fill the tank?
A 6.67 hours B 6 hours C 7.5 hours D 8 hours
Rate of A = 12 1 , Rate of B = 15 1 . Combined rate = 12 1 + 15 1 = 60 5 + 60 4 = 60 9 = 20 3 . Time = 3 20 = 6.67 hours
A man bought a car for Rs. 5,00,000 and sold it at a loss of 15%. What is the selling price?
A Rs. 4,25,000 B Rs. 4,15,000 C Rs. 5,75,000 D Rs. 4,45,000
Selling Price = Cost Price × (1 - Loss%). SP = 500000 × (1 - 0.15) = 500000 × 0.85 = Rs. 4,25,000
If the compound interest on Rs. 10,000 at 10% per annum for 2 years is compound annually, what is the amount?
A Rs. 12,100 B Rs. 12,000 C Rs. 11,000 D Rs. 12,200
Amount = P(1 + R/100)^n = 10000(1 + 100 10 )^2 = 10000(1.1)^2 = 10000 × 1.21 = Rs. 12,100
What is the average of first 20 natural numbers?
A 10 B 10.5 C 11 D 9.5
Sum of first n natural numbers = n(n+1)/2. Sum = 20×2 21 = 210. Average = 20 210 = 10.5