Identify the error: 'Each of the students are required to submit their projects by Friday.'
Answer: A
'Each' is singular, so it should be 'is' not 'are'. Correct sentence: 'Each of the students is required to submit their project by Friday.'
Q.262Medium
Which of the following is NOT a programming paradigm?
Answer: C
Linear Programming is an optimization technique, not a programming paradigm. The others are paradigms used in software development.
Q.263Medium
Which data structure is best for implementing a queue?
Answer: B
Linked List is ideal for queue implementation as it provides O(1) insertion and deletion at both ends.
Q.264Medium
Which of the following sorting algorithms is most efficient for nearly sorted data?
Answer: C
Insertion Sort has O(n) time complexity for nearly sorted data, making it the most efficient choice.
Q.265Medium
What will be printed?
String s1 = new String('Amazon');
String s2 = new String('Amazon');
System.out.println(s1 == s2);
Answer: B
== compares memory references. Both s1 and s2 are different objects, so it prints false. Use .equals() for value comparison.
Advertisement
Q.266Medium
What is the primary purpose of a hash function?
Answer: B
A hash function takes input data and produces a fixed-size output (hash value), useful for hash tables and data indexing.
Q.267Medium
What is the main advantage of using microservices architecture?
Answer: B
Microservices allow independent scaling, deployment, and technology choices. However, they can increase operational complexity.
Q.268Medium
What will be the output?
List<Integer> list = new ArrayList<>();
list.add(1);
list.add(2);
list.add(3);
list.remove(1);
System.out.println(list);
Answer: A
list.remove(1) removes the element at index 1 (which is 2), leaving [1, 3].
Q.269Medium
What is the difference between ArrayList and LinkedList in Java?
Answer: C
ArrayList has O(1) random access but O(n) insertion/deletion. LinkedList has O(n) access but O(1) insertion/deletion.
Q.270Medium
What is the time complexity of accessing an element in a balanced Binary Search Tree?
Answer: B
In a balanced BST, the height is log n, so searching takes O(log n) time.
Q.271Medium
A train travels from City A to City B at 60 km/h and returns from B to A at 40 km/h. If the total journey time is 10 hours, what is the distance between City A and City B?
Answer: A
Let distance = d km. Time A to B = d/60 hours, Time B to A = d/40 hours. Total time: d/60 + d/40 = 10. LCM(60,40)=120, so (2d + 3d)/120 = 10, giving 5d/120 = 10, thus d = 240 km.
Q.272Medium
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.273Medium
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.274Medium
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.275Medium
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.276Medium
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.
Q.277Medium
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.278Medium
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.279Medium
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.280Medium
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).