In a coding problem, you need to find the longest palindromic substring. What would be the optimal time complexity?
Answer: B
Using expand-around-center approach or dynamic programming with memoization, the optimal solution achieves O(n) time complexity.
Q.5Hard
In a circular queue, if the array size is 10 and front=7, rear=2, how many elements are present?
Answer: B
In circular queue: elements = (rear - front + size) % size = (2 - 7 + 10) % 10 = 5. But accounting properly: 7,8,9,0,1,2 = 6 elements.
Advertisement
Q.6Hard
In a graph with 5 vertices and 7 edges, what type of graph is it most likely to be?
Answer: B
With 5 vertices, maximum edges = 10. With 7 edges, it's sparse (closer to tree structure than dense).
Q.7Hard
A coding problem requires finding the longest common substring of two strings. What is the optimal approach?
Answer: B
Dynamic Programming is the standard approach for longest common substring problems, building a table of subproblem results with O(n²) time and space complexity.
Q.8Hard
In a complex algorithm with multiple nested loops, the time complexity is O(n²m) where n and m are independent variables. If n=100 and m=50, approximately how many operations?
Answer: B
Operations = 100² × 50 = 10,000 × 50 = 500,000 operations. This represents the actual computational load for the given input sizes.
Q.9Hard
In a TCS project analyzing Big Data with MapReduce, what is the purpose of the 'Reducer' phase?
Answer: B
The Reducer phase collects intermediate key-value pairs from Mappers, groups them by key, and aggregates them to produce final results.
Q.10Hard
A TCS developer is optimizing a Java application and notices that the garbage collector is causing frequent pause times. Which JVM parameter would BEST address this issue for low-latency requirements?
Answer: B
G1 (Garbage First) GC is designed for low-latency applications with predictable pause times. It divides the heap into regions and prioritizes regions with most garbage, minimizing full GC pauses.
Q.11Hard
A TCS project uses Docker containers across 50+ servers. Which orchestration platform would be most suitable for managing container deployment, scaling, and updates at this scale?
Answer: B
Kubernetes is the industry-standard container orchestration platform designed for managing containerized applications at scale. It provides self-healing, auto-scaling, load balancing, and rolling updates—essential for 50+ node clusters.