Skip to main content

Infosys Java Interview | 2–7 Years Experience | Java | Spring Boot | Microservices | Mock Interview

Infosys Java Interview | 2–7 Years Experience | Java | Spring Boot | Microservices | Mock Interview



📺 This post is based on a real mock interview video from YouTube.
🔗 Watch it here: Infosys Interview – CloudTech
📡 Channel: CloudTech


Q1: Can you tell me about yourself, your technical skill set, and the project on which you worked?

Answer:
I have 4 years of experience in the IT industry. I’ve worked on Java, Spring Boot, Microservices, MySQL, and a NoSQL database. I'm currently using Java 11 and have exposure to Java 8 features. I’ve worked in the banking and finance domain, mainly on reconciliation projects.


Q2: What are your day-to-day activities?

Answer:
We manage tasks using Jira and follow Agile Scrum methodology. We handle user stories, work on enhancements or bug fixes, estimate efforts, perform development, get QA validation, and then deploy to production.


Q3: Java Coding - Flatten a list of lists of strings into a single list

Answer:

List<String> allSkills = skills.stream()
    .flatMap(skillList -> skillList.stream())
    .collect(Collectors.toList());

Q4: Java Coding - Filter skills starting with the character 'S'

Answer:

List<String> sSkills = allSkills.stream()
    .filter(skill -> skill.startsWith("S"))
    .collect(Collectors.toList());

Q5: What are the different ways to create a thread in Java?

Answer:

  1. Extend Thread class and override run() method.

  2. Implement Runnable interface and pass it to a Thread object.


Q6: When should we use Runnable vs Thread?

Answer:
Use Runnable when you only want to execute code in a separate thread and don’t need to extend Thread. Use Thread only when you want to modify or extend thread behavior.


Q7: Which design patterns have you worked with?

Answer:
Adapter, Factory, and Abstract Factory design patterns.


Q8: What is the difference between Factory and Abstract Factory?

Answer:

  • Factory Pattern: Creates object based on input (e.g., UPI, Credit Card, Bitcoin payments).

  • Abstract Factory Pattern: Returns related group of objects based on context (e.g., Light theme → light components).


Q9: How do you perform CRUD operations in Spring Boot?

Answer:

  • Use @RestController for controller class.

  • Use annotations like @GetMapping, @PostMapping, @PutMapping, and @DeleteMapping.

  • Service layer annotated with @Service, repository layer with @Repository.

  • Status Codes:

    • 200: OK

    • 201: Created

    • 204: No Content (Delete)

    • 404: Not Found

    • 500: Internal Server Error

    • 429: Too Many Requests


Q10: Can we interchange @Service and @Repository?

Answer:
Technically yes, because both are stereotype annotations. But semantically, it’s not recommended as each has its own purpose.


Q11: Explain the microservices architecture of your project.

Answer:

  • 7–8 microservices developed and managed by separate teams.

  • Entry point is API Gateway which routes requests based on URI.

  • Each service registers itself with Service Discovery (Eureka).

  • Services communicate synchronously (via REST) or asynchronously (via Kafka).


Q12: How do microservices communicate with each other?

Answer:

  • Synchronous Communication: Both services must be up (e.g., REST).

  • Asynchronous Communication: Fire-and-forget using Kafka, no need to wait for response.


Q13: How do you implement client-side load balancing?

Answer:

  • Use multiple instances of microservices.

  • Use @LoadBalanced RestTemplate or Ribbon.

  • Client gets all service addresses and balances requests across them.


Q14: How do you handle microservice failures?

Answer:
Using Circuit Breaker Pattern:

  • After 3 failed calls, stop calling the failing service for a cooldown period (e.g., 10 mins).

  • Retry after cooldown.

  • Helps prevent overload on already failing services.


💡 Conclusion
This mock interview walk-through covers key backend concepts for developers with 2–7 years of experience. It focuses on Java, Spring Boot, Microservices, design patterns, threading, circuit breaker, and coding practices.

📺 Watch the full interview here: https://www.youtube.com/watch?v=HPvwYK4-IdY

Comments

Popular posts from this blog

Top 15 React Interview Questions for 1–2 Years Experience

🟦 Top 15 React Interview Questions for 1–2 Years Experience Preparing for a React interview with 1–2 years of experience? Here's a carefully curated list of 15 important React questions with clear, real-world answers. These are frequently asked in interviews at companies like TCS, Infosys, Cognizant, Capgemini, and product-based firms. Q1. What is the Virtual DOM in React, and how does it improve performance? Answer: The Virtual DOM is a lightweight, in-memory copy of the real DOM. When state/props change, React creates a new Virtual DOM tree, compares it with the old one (diffing), and only updates the parts of the real DOM that changed. This makes rendering much faster and improves performance in large applications. Q2. What is JSX in React? Answer: JSX stands for JavaScript XML. It allows us to write HTML elements in JavaScript and place them in the DOM without using createElement() . JSX improves code readability and is transpiled to React.createElement() calls. ...

Top 15 Spring Boot Interview Questions and Answers – Real Examples (2025)

Top 15 Spring Boot Interview Questions – 2025 Spring Boot is one of the most demanded frameworks for Java backend development. Whether you're interviewing for TCS, Infosys, or a product-based company, these Spring Boot questions will help you prepare like a pro. Here are 15 questions with detailed explanations for developers with 1–2 years of experience. Q1. What is Spring Boot? Answer: Spring Boot is a Java-based open-source framework built on top of the Spring Framework. It helps developers create stand-alone, production-ready Spring applications with minimal configuration. Its key features include: Auto-configuration Embedded servers (Tomcat, Jetty) Starter dependencies Production-ready tools (Actuator, Metrics, etc.) Example: You can create a REST API within minutes by using @RestController and spring-boot-starter-web — no need for external web server deployment. Q2. What is the role of @SpringBootApplication annotation? Answer: This annotation i...

Wipro Java Developer Interview Questions with Answers (Mid-Level Role)

  Wipro Java Developer Interview Questions with Answers (Mid-Level Role) (Glassdoor Based – May 2024) Interview Location: Bengaluru Interview Mode: Online Candidate Role: Mid-Level Java Developer Source: Based on real experience shared on Glassdoor Review Summary: Easy and conversational. Interviewer was friendly. Focus was mainly on Java basics, internals, and real-world understanding. Q1: What is static in public static void main(String[] args) ? A: The static keyword lets the JVM call the method without creating an object. It indicates that the method belongs to the class, not instances. Q2: Why does a Java program start from the main method? A: main() is the predefined entry point of a Java application. The JVM starts execution from there. Q3: What are Checked and Unchecked Exceptions? With examples. A: Checked Exceptions : Detected at compile time. E.g., IOException , SQLException . Unchecked Exceptions : Detected at runtime. E.g., NullPointerExce...