What is the main purpose of a constructor in a class?
A constructor is used to initialize objects of a class with default or specified values
In Java, which keyword is used to prevent inheritance?
The 'final' keyword prevents a class from being subclassed or inherited
What is the main difference between ArrayList and LinkedList in Java?
ArrayList provides O(1) random access, while LinkedList provides O(n) access
What does 'HTTP' stand for?
HTTP stands for HyperText Transfer Protocol, the foundation of data communication on the web
Which of these is a NoSQL database?
MongoDB is a NoSQL database. MySQL, PostgreSQL, and Oracle are relational SQL databases
Advertisement
In CSS, what does the 'z-index' property control?
z-index controls the stacking order of overlapping elements on a webpage
What will be the output of: console.log(typeof 5) in JavaScript?
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?
30 meters / 5 = 6 meters per piece
If 30% of a number is 45, what is the number?
Let number = x. 30% of x = 45. 0.30x = 45. x = 045.30 = 150
A box contains 3 red balls and 2 blue balls. What is the probability of drawing a red ball?
Total balls = 5. Red balls = 3. Probability = 53
If a square has a side of 5 cm, what is its area?
Area of square = side² = 5² = 25 cm²
What is 15% of 200?
15% of 200 = (10015) × 200 = 0.15 × 200 = 30
Two numbers are in the ratio 3:4. If their sum is 70, what are the numbers?
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?
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, ?
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?
Original speed = 5300 = 60 km/h. New speed = 60 × 1.2 = 72 km/h. Time = 72360 = 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?
Rate of A = 121, Rate of B = 151. Combined rate = 121 + 151 = 605 + 604 = 609 = 203. Time = 320 = 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?
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?
Amount = P(1 + R/100)^n = 10000(1 + 10010)^2 = 10000(1.1)^2 = 10000 × 1.21 = Rs. 12,100
What is the average of first 20 natural numbers?
Sum of first n natural numbers = n(n+1)/2. Sum = 20×221 = 210. Average = 20210 = 10.5