Basic-Technical-Question-Answer-Java-SpringBoot-Microservices-MongoDB-GraphQL
Basic-Technical-Question-Answer-Java-SpringBoot-Microservices-MongoDB-GraphQL
interview:
Java:
2. What is the latest version of Java? → (Mention the latest stable version).
5. What is the difference between JDK, JRE, and JVM? → JDK includes JRE and
development tools; JRE runs Java applications; JVM executes Java bytecode.
Spring Boot:
7. Why is Spring Boot popular? → It simplifies Java application development with auto-
configuration and embedded servers.
9. What is an embedded server in Spring Boot? → A built-in server like Tomcat, Jetty, or
Undertow to run applications without external deployment.
Microservices:
11. What are microservices? → A software architecture where applications are built as a
collection of small, independent services.
12. Why are microservices used? → For scalability, flexibility, and faster deployment.
13. What is an API Gateway? → A single entry point for managing requests in a
microservices architecture.
14. How do microservices communicate? → Using REST, gRPC, or messaging queues like
Kafka.
15. What is service discovery? → A mechanism to locate services dynamically, often using
tools like Eureka.
GraphQL:
16. What is GraphQL? → A query language for APIs that allows clients to request only the
data they need.
17. How is GraphQL different from REST? → GraphQL allows flexible queries, whereas
REST relies on fixed endpoints.
18. What are the key components of GraphQL? → Query, Mutation, and Subscription.
Cisco Confidential
19. What is a resolver in GraphQL? → A function that fetches data for a GraphQL query.
20. What is a GraphQL schema? → A blueprint that defines the structure of GraphQL
queries and responses.
MongoDB:
21. What is MongoDB? → A NoSQL database that stores data in JSON-like documents.
24. What is an index in MongoDB? → A data structure that improves query performance.
25. What is the primary advantage of MongoDB? → High scalability and flexibility in
handling unstructured data.
Java:
2. What is the main method in Java? → public static void main(String[] args) is the entry
point of a Java program.
4. What is JVM? → Java Virtual Machine, which runs Java bytecode on any OS.
5. What is the difference between equals() and == in Java? → equals() compares values,
== compares object references.
10. What is the difference between ArrayList and LinkedList? → ArrayList is faster for
retrieval; LinkedList is better for insertions/deletions.
Spring Boot:
11. What is the main advantage of Spring Boot? → Reduces boilerplate code with auto-
configuration.
Cisco Confidential
12. What is a Spring Boot starter? → A dependency that simplifies project setup, like
spring-boot-starter-web.
13. What is Spring Boot’s default logging framework? → SLF4J with Logback.
14. What is an actuator in Spring Boot? → A tool to monitor and manage applications.
15. What is a Spring Boot profile? → A way to manage different configurations for
environments like dev, test, prod.
17. What is the purpose of @Service in Spring Boot? → Marks a class as a business
service layer.
Microservices:
23. What is REST API? → A way to communicate between services using HTTP methods like
GET, POST.
25. What is circuit breaker in microservices? → A design pattern to handle failures and
prevent cascading failures (e.g., using Resilience4j).
26. What is Eureka in microservices? → A service discovery tool in the Spring Cloud
ecosystem.
27. What is Hystrix? → A library for fault tolerance in microservices (now replaced by
Resilience4j).
28. What is an API Gateway? → A single entry point for requests, handling authentication,
rate limiting, etc.
30. What is Kubernetes? → A container orchestration tool for deploying and managing
microservices.
Cisco Confidential
GraphQL:
31. Why use GraphQL instead of REST? → GraphQL allows fetching only required data,
reducing over-fetching and under-fetching.
32. What is a GraphQL Query? → A request to fetch specific data from a server.
33. What is a GraphQL Mutation? → A request to modify (create, update, delete) data.
35. What is a GraphQL Resolver? → A function that processes GraphQL queries and
retrieves the requested data.
36. What is introspection in GraphQL? → A feature that allows querying the schema itself.
37. Does GraphQL use HTTP? → Yes, it usually works over HTTP but can also use
WebSockets for subscriptions.
38. Can GraphQL replace REST APIs? → Not always; it depends on the use case.
39. What is Apollo GraphQL? → A popular client and server framework for GraphQL.
40. What is Relay in GraphQL? → A JavaScript framework that works with GraphQL to
manage data fetching.
MongoDB:
42. What is BSON in MongoDB? → A binary format for storing JSON-like documents.
43. What is a primary key in MongoDB? → _id is the default primary key in MongoDB.
44. What is sharding in MongoDB? → Distributing data across multiple servers for
scalability.
45. What is replication in MongoDB? → Copying data across multiple servers to ensure
high availability.
46. How do you query data in MongoDB? → Using methods like find(), findOne(), and
aggregation pipelines.
47. What is an aggregation pipeline? → A framework for data transformation and analysis in
MongoDB.
Cisco Confidential
Cisco Confidential