What will be the output of the following code snippet?
int x = 5;
int y = ++x + x++ + x;
System.out.println(y);
Answer: B
++x makes x=6, then 6 is added. x++ uses 6 then increments to 7. Finally +x adds 7. So: 6 + 6 + 7 = 19.
Q.582Medium
A can complete a task in 12 days. B can complete the same task in 18 days. If both work together, in how many days will they complete the task?
Answer: A
A's work rate = 121, B's work rate = 181. Combined rate = 121 + 181 = 363 + 362 = 365. Time = 536 = 7.2 days.
Q.583Medium
A train travels from City A to City B at 60 km/h. On the return journey, it travels at 40 km/h. If the total time taken for both journeys is 10 hours, what is the distance between the two cities?
Answer: A
Let distance = d. Time = Distance/Speed. d/60 + d/40 = 10. LCM(60,40) = 120. (2d + 3d)/120 = 10. 5d = 1200. d = 240 km.
Q.584Medium
Find the missing number in the series: 4, 9, 25, 49, 121, ?
Answer: A
The series consists of squares of prime numbers: 2²=4, 3²=9, 5²=25, 7²=49, 11²=121, 13²=169. Next prime is 13, so 13²=169.
Q.585Medium
A software developer needs to optimize a SQL query. Currently, the query performs a full table scan on a table with 1 million rows. Which of the following would be the BEST approach to improve performance?
Answer: A
Adding an INDEX on columns used in WHERE clause is the most direct and effective way to optimize query performance by avoiding full table scans. This is a standard database optimization technique. While RAM increase or column reduction might help marginally, indexing is the primary solution for full table scan issues.
Advertisement
Q.586Medium
A warehouse manager needs to pack boxes into containers. If 15 workers can pack 450 boxes in 6 hours, how many boxes can 20 workers pack in 8 hours, assuming the same productivity rate?
Answer: A
Rate per worker per hour = 450/(15×6) = 5 boxes/hour. For 20 workers in 8 hours = 20×8×5 = 800 boxes.
Q.587Medium
In a sequence: 2, 6, 12, 20, 30, __. What is the next number?
Answer: B
The pattern is n(n+1): 1×2=2, 2×3=6, 3×4=12, 4×5=20, 5×6=30, 6×7=42. Each term is the product of consecutive integers.
Q.588Easy
If a train travels 240 km in 4 hours and then 180 km in 3 hours, what is its average speed for the entire journey?
Answer: C
Total distance = 240 + 180 = 420 km. Total time = 4 + 3 = 7 hours. Average speed = 7420 = 60 km/h.
Q.589Easy
Which of the following words is closest in meaning to 'CANDID'?
Answer: B
CANDID means honest, frank, and straightforward. Frank (option B) is a direct synonym meaning honest and open.
Q.590Medium
A company's revenue grows by 25% in Year 1 and 20% in Year 2. If the initial revenue was ₹100 crore, what is the revenue after 2 years?
Answer: B
After Year 1: 100 × 1.25 = ₹125 crore. After Year 2: 125 × 1.20 = ₹150 crore.
Q.591Medium
In a circular arrangement of 8 people, if person A sits at a fixed position, how many distinct arrangements are possible for the remaining 7 people?
Answer: A
With one person fixed in circular arrangement, the remaining 7 people can be arranged in 7! ways (avoiding counting rotations as different).
Q.592Easy
Read the passage and answer: 'Amazon's supply chain relies on predictive analytics to forecast demand. This AI-driven approach reduces inventory costs and improves delivery times.' Which statement best captures the main idea?
Answer: B
The passage states that AI-driven predictive analytics serves three purposes: forecasting demand, reducing inventory costs, and improving delivery times. Option B accurately captures all these points.
Q.593Hard
A system processes 1000 requests per second. If 8% of requests fail and need retry, and each retry takes 2 seconds, approximately how many total seconds are needed to process 10,000 requests including retries (assuming sequential processing)?