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?
ADocker Compose
BKubernetes (K8s)
CDocker Swarm
DVirtual Machines with manual management
Correct Answer:
B. Kubernetes (K8s)
EXPLANATION
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.
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?
A-Xmx to increase heap size
B-XX:+UseG1GC to enable G1 garbage collector
C-XX:+UseSerialGC for maximum throughput
D-Xms to set initial heap size
Correct Answer:
B. -XX:+UseG1GC to enable G1 garbage collector
EXPLANATION
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.
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?
A150 operations
B500,000 operations
C1,000,000 operations
D2,500,000 operations
Correct Answer:
B. 500,000 operations
EXPLANATION
Operations = 100² × 50 = 10,000 × 50 = 500,000 operations. This represents the actual computational load for the given input sizes.
A coding problem requires finding the longest common substring of two strings. What is the optimal approach?
ABrute force checking all substrings - O(n³) time
BDynamic Programming approach - O(n²) time and space
CUsing two pointers - O(n) time
DRecursive approach without memoization
Correct Answer:
B. Dynamic Programming approach - O(n²) time and space
EXPLANATION
Dynamic Programming is the standard approach for longest common substring problems, building a table of subproblem results with O(n²) time and space complexity.