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

TCS Java Interview | Java | Spring Boot | Microservices | Database

TCS Java Interview | Java | Spring Boot | Microservices | Database This post is based on a Java backend developer interview simulation and provides direct transcript-based answers to help you prepare for similar interviews. 📺 This interview scenario was inspired by a video from the  YouTube channel:  CloudTech . 🔗 Watch the full video here:  https://www.youtube.com/watch?v=yVj2EgwZxk4 1. Can you introduce yourself and talk about your tech stack and domains? I have around 4.5 years of experience working as a Java developer. My core expertise is in Java and developing REST APIs using Spring Boot. I also have basic knowledge of microservices architecture. On the database side, I work with SQL and Oracle. Additionally, I have exposure to UI technologies like Angular, HTML, and CSS, but they are secondary skills. My primary focus is backend Java development. 2. Which version of Java are you currently working on? We are currently using Java 8 but are in the process of upgr...

Top 20 Spring Boot Microservices Architecture Interview Questions (With Speakable Answers)

Top 20 Spring Boot Microservices Architecture Interview Questions (With Speakable Answers) * * * 1. What is Microservices Architecture?   → Microservices architecture breaks an application into small, independent services. Each one handles a specific business function and can be developed, deployed, and scaled independently. They usually communicate over REST APIs or messaging queues. * * * 2. How does Spring Boot help in building microservices?   → Spring Boot offers embedded servers, auto-configuration, starter templates, and production-ready tools. It works well with Spring Cloud to provide service discovery, config management, load balancing, and more. * * * 3. What are the core components in a microservices setup?   → Key components include:   ✓ API Gateway   ✓ Eureka (Service Discovery)   ✓ Config Server   ✓ Kafka or RabbitMQ   ✓ Circuit Breaker (like Resilience4j)   ✓ Centralized logging and monitoring (ELK, Prometheus) * * * 4. What i...

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...