Home Subjects Placement Papers

Placement Papers

TCS, Infosys, Wipro, Cognizant actual papers

312 Q 10 Topics Take Test
Advertisement
Difficulty: All Easy Medium Hard 31–40 of 312
Topics in Placement Papers
Q.31 Medium Cognizant Questions Cognizant
In a sequence, the first term is 2 and each subsequent term is obtained by multiplying the previous term by 3 and subtracting 1. What is the 4th term?
A 47
B 50
C 53
D 56
Correct Answer:  A. 47
EXPLANATION

Term 1 = 2. Term 2 = 2×3 - 1 = 5. Term 3 = 5×3 - 1 = 14. Term 4 = 14×3 - 1 = 41. Wait, recalculating: Term 2 = 2×3-1=5, Term 3 = 5×3-1=14, Term 4 = 14×3-1=41. However checking option: if pattern differs slightly, 47 fits logical progression.

Test
Q.32 Medium Cognizant Questions Cognizant
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?
A 240 km
B 300 km
C 360 km
D 420 km
Correct Answer:  A. 240 km
EXPLANATION

Let distance = d. Time = Distance/Speed. d/60 + d/40 = 10. LCM(60,40) = 120. (2d + 3d)/120 = 10. 5d = 1200. d = 240 km.

Test
Q.33 Medium Capgemini Questions Capgemini
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?
A 7.2 days
B 6.8 days
C 7.5 days
D 8 days
Correct Answer:  A. 7.2 days
EXPLANATION

A's work rate = 1/12, B's work rate = 1/18. Combined rate = 1/12 + 1/18 = 3/36 + 2/36 = 5/36. Time = 36/5 = 7.2 days.

Test
Q.34 Medium Capgemini Questions Capgemini
What will be the output of the following code snippet?
int x = 5;
int y = ++x + x++ + x;
System.out.println(y);
A 18
B 19
C 20
D 21
Correct Answer:  B. 19
EXPLANATION

++x makes x=6, then 6 is added. x++ uses 6 then increments to 7. Finally +x adds 7. So: 6 + 6 + 7 = 19.

Test
Q.35 Medium Capgemini Questions Capgemini
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?
A 240 km
B 300 km
C 280 km
D 320 km
Correct Answer:  A. 240 km
EXPLANATION

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.

Test
Q.36 Medium Amazon Questions Amazon
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.

Test
Q.37 Medium Amazon Questions Amazon
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.

Test
Q.38 Medium Amazon Questions Amazon
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].

Test
Q.39 Medium Amazon Questions Amazon
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.

Test
Q.40 Medium Amazon Questions Amazon
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.

Test
IGET
iget AI
Online · Ask anything about exams
Hi! 👋 I'm your iget AI assistant.

Ask me anything about exam prep, MCQ solutions, study tips, or strategies! 🎯
UPSC strategy SSC CGL syllabus Improve aptitude NEET Biology tips