Showing 1–10 of 28 questions
in Amazon Questions
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?
EXPLANATION
With one person fixed in circular arrangement, the remaining 7 people can be arranged in 7! ways (avoiding counting rotations as different).
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?
A
₹145 crore
B
₹150 crore
C
₹155 crore
D
₹160 crore
Correct Answer:
B. ₹150 crore
EXPLANATION
After Year 1: 100 × 1.25 = ₹125 crore. After Year 2: 125 × 1.20 = ₹150 crore.
In a sequence: 2, 6, 12, 20, 30, __. What is the next number?
EXPLANATION
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.
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?
A
800 boxes
B
900 boxes
C
1000 boxes
D
1200 boxes
Correct Answer:
A. 800 boxes
EXPLANATION
Rate per worker per hour = 450/(15×6) = 5 boxes/hour. For 20 workers in 8 hours = 20×8×5 = 800 boxes.
What is the time complexity of accessing an element in a balanced Binary Search Tree?
A
O(1)
B
O(log n)
C
O(n)
D
O(n²)
Correct Answer:
B. O(log n)
EXPLANATION
In a balanced BST, the height is log n, so searching takes O(log n) time.
What is the difference between ArrayList and LinkedList in Java?
A
ArrayList is faster for random access
B
LinkedList is faster for insertions/deletions in middle
C
Both are correct
D
No difference
Correct Answer:
C. Both are correct
EXPLANATION
ArrayList has O(1) random access but O(n) insertion/deletion. LinkedList has O(n) access but O(1) insertion/deletion.
What will be the output?
List list = new ArrayList();
list.add(1);
list.add(2);
list.add(3);
list.remove(1);
System.out.println(list);
A
[1, 3]
B
[1, 2, 3]
C
[2, 3]
D
[1, 2]
Correct Answer:
A. [1, 3]
EXPLANATION
list.remove(1) removes the element at index 1 (which is 2), leaving [1, 3].
What is the main advantage of using microservices architecture?
A
Easier to develop and test
B
Better scalability and flexibility
C
Reduced operational complexity
D
All of the above
Correct Answer:
B. Better scalability and flexibility
EXPLANATION
Microservices allow independent scaling, deployment, and technology choices. However, they can increase operational complexity.
What is the primary purpose of a hash function?
A
To encrypt data
B
To map input to a fixed-size output
C
To compress data
D
To sort data
Correct Answer:
B. To map input to a fixed-size output
EXPLANATION
A hash function takes input data and produces a fixed-size output (hash value), useful for hash tables and data indexing.
What will be printed?
String s1 = new String('Amazon');
String s2 = new String('Amazon');
System.out.println(s1 == s2);
A
true
B
false
C
null
D
Error
EXPLANATION
== compares memory references. Both s1 and s2 are different objects, so it prints false. Use .equals() for value comparison.