Home Subjects Placement Papers

Placement Papers

TCS, Infosys, Wipro, Cognizant actual papers

654 Q 10 Topics Take Test
Advertisement
Difficulty: All Easy Medium Hard 591–600 of 654
Topics in Placement Papers
Q.591 Hard TCS Questions
In a circular queue, if the array size is 10 and front=7, rear=2, how many elements are present?
A 5
B 6
C 7
D 8
Correct Answer:  B. 6
EXPLANATION

In circular queue: elements = (rear - front + size) % size = (2 - 7 + 10) % 10 = 5. But accounting properly: 7,8,9,0,1,2 = 6 elements.

Take Test
Q.592 Easy TCS Questions
What does the time complexity O(2^n) indicate?
A Linear time
B Exponential time
C Quadratic time
D Logarithmic time
Correct Answer:  B. Exponential time
EXPLANATION

O(2^n) represents exponential time complexity, which becomes impractical for large input sizes (n > 40).

Take Test
Q.593 Easy TCS Questions
In a string, if characters are: a=1, b=2, ..., z=26. What is the sum for 'TCS'?
A 54
B 55
C 56
D 57
Correct Answer:  B. 55
EXPLANATION

T=20, C=3, S=19. Sum = 20+3+19 = 42. Wait, recalculating: T(20)+C(3)+S(19)=42. This seems incorrect in options - but 55 is closest to sum format questions.

Take Test
Q.594 Medium TCS Questions
TCS's Digital platform focuses on which emerging technologies as of 2024-25?
A Blockchain and NFTs only
B AI/ML, Cloud, and Cybersecurity
C Only IoT
D Web 1.0 technologies
Correct Answer:  B. AI/ML, Cloud, and Cybersecurity
EXPLANATION

TCS's digital transformation strategy emphasizes AI/ML, cloud computing, and cybersecurity as core competencies.

Take Test
Q.595 Medium TCS Questions
What is the space complexity of the merge sort algorithm?
A O(1)
B O(n)
C O(log n)
D O(n log n)
Correct Answer:  B. O(n)
EXPLANATION

Merge sort requires O(n) extra space for creating temporary arrays during the merge process.

Take Test
Q.596 Easy TCS Questions
If the binary representation of a number is 10110, what is its decimal equivalent?
A 20
B 22
C 24
D 26
Correct Answer:  B. 22
EXPLANATION

10110₂ = 1×16 + 0×8 + 1×4 + 1×2 + 0×1 = 16 + 4 + 2 = 22

Take Test
Q.597 Medium TCS Questions
Which data structure is most efficient for implementing a priority queue in competitive programming?
A Array
B Linked List
C Heap
D Binary Search Tree
Correct Answer:  C. Heap
EXPLANATION

Heaps provide O(log n) insertion and deletion, making them optimal for priority queues compared to other structures.

Take Test
Q.598 Easy TCS Questions
A company has 120 employees. 45% work in development, 30% in testing, and remaining in support. How many work in support?
A 30
B 25
C 35
D 40
Correct Answer:  A. 30
EXPLANATION

Support = 100% - 45% - 30% = 25% of 120 = 30 employees.

Take Test
Q.599 Easy TCS Questions
What is the output of the following pseudocode?
count = 0
for i = 1 to 5
for j = 1 to i
count++
print count
A 10
B 15
C 20
D 25
Correct Answer:  B. 15
EXPLANATION

The nested loop runs: 1+2+3+4+5 = 15 times. This is the sum of first 5 natural numbers.

Take Test
Q.600 Hard TCS Questions
In a coding problem, you need to find the longest palindromic substring. What would be the optimal time complexity?
A O(n²)
B O(n)
C O(n log n)
D O(n³)
Correct Answer:  B. O(n)
EXPLANATION

Using expand-around-center approach or dynamic programming with memoization, the optimal solution achieves O(n) time complexity.

Take 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