What is the primary advantage of using microservices architecture in TCS projects?
Answer: B
Microservices allow independent scaling, deployment, and development of different services.
Q.28Medium
Which of the following is NOT a characteristic of NoSQL databases?
Answer: C
NoSQL databases typically follow eventual consistency rather than strict ACID properties.
Q.29Medium
If you have an array [3,1,4,1,5,9,2,6], what is the median?
Answer: A
Sorted: [1,1,2,3,4,5,6,9]. Median of 8 elements = (3+4)/2 = 3.5
Q.30Medium
A software engineer at TCS needs to optimize a search operation in a large database containing 1 million records. Which data structure would be most efficient?
Answer: B
For searching in large datasets, Binary Search Trees provide O(log n) complexity and Hash Tables provide O(1) average case, both significantly better than linear search in unsorted structures.
Q.31Medium
TCS developers working on cloud-based projects often use microservices architecture. What is a PRIMARY advantage of this approach?
Answer: B
Microservices architecture allows individual components to scale independently, improves fault isolation, enables easier updates, and promotes team autonomy in development.
Q.32Medium
An array [7, 3, 9, 1, 4, 2, 8] needs to be sorted. If memory is extremely limited, which sorting algorithm should be preferred?
Answer: C
Heap Sort is an in-place sorting algorithm requiring only O(1) extra space, making it optimal for memory-constrained environments despite having O(n log n) time complexity.
Q.33Medium
In a TCS project using Git version control, a developer needs to undo committed changes. Which command should be used?
Answer: A
git reset --hard HEAD~1 is the standard command to undo the last commit and discard changes. HEAD~1 refers to the previous commit.
Q.34Medium
A circular queue has size 10. If front=3 and rear=8, how many elements are currently in the queue?
Answer: B
In a circular queue, number of elements = (rear - front + 1) = (8 - 3 + 1) = 6 elements.
Q.35Medium
TCS follows Agile methodology for most projects. Which practice is NOT a part of core Agile principles?
Answer: B
Agile embraces changing requirements even late in development. Fixed scope with no flexibility contradicts Agile's core principle of adaptability.
Q.36Medium
In a binary tree with 7 nodes, what is the maximum possible height?
Answer: C
Maximum height occurs in a skewed (linear) tree where height = n - 1 = 7 - 1 = 6. Minimum height would be 2 for a balanced tree.
Q.37Medium
In a graph traversal problem with 10 nodes and 15 edges, DFS (Depth-First Search) time complexity is O(V+E). What is the complexity here?
Answer: B
DFS complexity = O(V + E) = O(10 + 15) = O(25). This includes visiting each vertex once and exploring each edge once.
Q.38Medium
In TCS technical assessments, a question asks about polymorphism. Which is NOT a type of polymorphism in OOP?
Answer: D
The two main types of polymorphism are compile-time (static overloading) and runtime (dynamic overriding). Sequential polymorphism is not a recognized OOP concept.
Q.39Medium
TCS cybersecurity team emphasizes password security. Which is the STRONGEST password practice?
Answer: B
Strong passwords require length (12+ characters), character variety, and complexity. Reusing passwords and storing them insecurely significantly increases security risks.
Q.40Medium
A TCS team is developing a microservices architecture where each service maintains its own database. Which of the following is the PRIMARY challenge they will face?
Answer: A
In microservices architecture, maintaining data consistency across independently managed databases (polyglot persistence) is a significant challenge. ACID transactions cannot span multiple databases, requiring eventual consistency patterns.