Infosys Interview Questions
Practice with real Infosys interview questions
01
A Frontend Developer was asked
Asked in 2024
Q. How can you effectively manage state in a React application? Discuss the pros and cons of using Context API versus Redux for state management.
Ans. In a React application, state management is crucial for maintaining the app's data flow. Two popular methods are Context API and Redux.
Context API
The Context API allows us to share state across the component tree without passing props down manually at every level. Here’s a basic example:
Pros:
- Simplicity and ease of use.
- No additional libraries required.
Cons:
- Not suitable for complex state management and can lead to performance issues with frequent re-renders.
Redux
Redux is a more powerful state management library that uses a centralized store. Here’s a basic example:
Pros:
- Predictable state management and easier debugging with tools like Redux DevTools.
- More maintainable for larger applications.
Cons:
- More boilerplate code required.
- Learning curve can be steep for beginners.
In summary, for small applications, Context API may suffice, but for larger applications where performance and maintainability are a concern, Redux is often the better choice.
Frontend DeveloperCore Concept
02
A Backend Developer was asked
Asked in 2025
Q. What strategies would you use to ensure container orchestration with Kubernetes is reliable and fault-tolerant?
Ans. To ensure reliability and fault tolerance in a Kubernetes environment, several strategies must be implemented:
1. Pod Disruption Budgets (PDB): Define PDBs to limit the number of concurrent disruptions to your pods. This ensures that a certain number always remain available during upgrades or maintenance:
2. Horizontal Pod Autoscaler (HPA): Use HPA to automatically scale your pods based on CPU/memory usage or custom metrics. This maintains performance during traffic spikes:
3. Health Checks: Implement readiness and liveness probes to ensure that pods are running healthy and can handle traffic.
4. Use of StatefulSets: For applications that need stable storage and unique network identities, use StatefulSets for better management of stateful applications.
5. Backup and Disaster Recovery: Regularly back up your etcd data and have a disaster recovery plan in place to restore your cluster quickly.
By following these strategies, you can ensure your Kubernetes deployment is robust, scalable, and fault-tolerant, which is essential in today's microservices-driven architectures.
Backend DeveloperCore Concept
