Home/Companies/HCL Technologies
HCL

HCL Technologies Interview Questions

One of India's largest IT companies with major centres in Noida, Bangalore, Chennai, and Pune. Interviews cover core Java, Spring Boot, microservices, and REST APIs. SQL and Docker knowledge is expected for most backend roles.

274questions
61 Easy213 Medium

#1What is the difference between == and .equals() in Java?

Easy
Core JavaJava

#2What is the difference between abstract class and interface?

Easy
OOPJava

#3Explain the SOLID principles.

Medium
OOPJava

#4How does HashMap work internally?

Medium
CollectionsJava

#5What is the difference between HashMap and ConcurrentHashMap?

Medium
CollectionsJava

#6Explain Java Memory Model: Heap, Stack, and Metaspace.

Medium
JVMJava

#7What is the volatile keyword in Java?

Medium
ConcurrencyJava

#8What are functional interfaces and lambda expressions in Java 8?

Easy
Java 8+Java

#9What is Optional and when should you use it?

Easy
Java 8+Java

#10Explain the Stream API and intermediate vs terminal operations.

Medium
Java 8+Java

#11What is the difference between checked and unchecked exceptions?

Easy
Core JavaJava

#12What is the difference between String, StringBuilder, and StringBuffer?

Easy
Core JavaJava

#13What is method overloading vs method overriding?

Easy
OOPJava

#14What is the difference between final, finally, and finalize?

Easy
Core JavaJava

#15What are Java records (Java 16+)?

Medium
Java 8+Java

#16What is the Executor framework and when would you use it over raw Threads?

Medium
ConcurrencyJava

#17What is encapsulation and how is it achieved in Java?

Easy
OOPJava

#18What is polymorphism? Explain runtime vs compile-time polymorphism.

Easy
OOPJava

#19What is the difference between composition and inheritance?

Medium
OOPJava

#20What is a marker interface? Give examples.

Medium
OOPJava

#21What are the design patterns most commonly asked in Java interviews?

Medium
OOPJava

#22What is the difference between ArrayList and LinkedList?

Easy
CollectionsJava

#23What is the difference between HashSet, LinkedHashSet, and TreeSet?

Easy
CollectionsJava

#24What is the difference between HashMap and TreeMap?

Easy
CollectionsJava

#25What is the contract between equals() and hashCode()?

Medium
CollectionsJava

#26What is the difference between fail-fast and fail-safe iterators?

Medium
CollectionsJava

#27What is CopyOnWriteArrayList and when should you use it?

Medium
CollectionsJava

#28How does PriorityQueue work and when would you use it?

Medium
CollectionsJava

#29What is the difference between sleep(), wait(), and yield()?

Medium
ConcurrencyJava

#30What are atomic classes (AtomicInteger, AtomicReference)? How do they work?

Medium
ConcurrencyJava

#31What is a CountDownLatch vs CyclicBarrier?

Medium
ConcurrencyJava

#32What is the difference between JDK, JRE, and JVM?

Easy
JVMJava

#33What is the String pool and how does string interning work?

Medium
JVMJava

#34What are sealed classes (Java 17)?

Medium
Java 8+Java

#35What is pattern matching for instanceof (Java 16)?

Medium
Java 8+Java

#36What are text blocks (Java 15)?

Easy
Java 8+Java

#37What is the difference between map() and flatMap() in streams?

Medium
Java 8+Java

#38What are method references in Java 8?

Easy
Java 8+Java

#39What is the difference between Comparable and Comparator?

Medium
CollectionsJava

#40What is Stream.collect() and what are common Collectors?

Medium
Java 8+Java

#41What is try-with-resources and how does it work?

Medium
Exception HandlingJava

#42What is the difference between throw and throws?

Easy
Exception HandlingJava

#43What is exception chaining and why is it important?

Medium
Exception HandlingJava

#44What is the difference between Java IO and NIO?

Medium
Core JavaJava

#45What is reflection in Java and when is it used?

Medium
Core JavaJava

#46What is the difference between deep copy and shallow copy?

Medium
Core JavaJava

#47What is autoboxing and unboxing? What are the performance implications?

Medium
Core JavaJava

#48What are enums in Java and what advanced features do they support?

Medium
Core JavaJava

#49What is the difference between static and instance initializer blocks?

Medium
Core JavaJava

#50What is the difference between String.format() and String.formatted()?

Easy
Core JavaJava

#51What is the var keyword (Java 10) and when should you use it?

Easy
Java 8+Java

#52What is the difference between an inner class, static nested class, and anonymous class?

Medium
OOPJava

#53What are the new switch expressions (Java 14)?

Medium
Java 8+Java

#54What is the difference between Runnable, Callable, and Future?

Medium
ConcurrencyJava

#55What is the difference between String.equals() and String.equalsIgnoreCase()?

Easy
Core JavaJava

#56What is the difference between Iterator and ListIterator?

Easy
CollectionsJava

#57What is the difference between abstract class and concrete class?

Easy
OOPJava

#58How do you handle NullPointerException in Java?

Medium
Exception HandlingJava

#59What is the Collections utility class? What are its most important methods?

Easy
CollectionsJava

#60What is the difference between Deque and Queue?

Medium
CollectionsJava

#61What is the difference between checked and unchecked exceptions — best practices for APIs?

Medium
Exception HandlingJava

#62What is the ternary operator and the null-coalescing equivalent in Java?

Easy
Core JavaJava

#63What is the difference between == null check and Objects.isNull()?

Easy
Core JavaJava

#64What is the difference between interface default methods and abstract class methods?

Medium
OOPJava

#65What is the difference between Iterable and Iterator?

Easy
CollectionsJava

#66What are the best practices for writing clean Java code?

Medium
Core JavaJava

#67What is the difference between a process and a thread in Java?

Easy
ConcurrencyJava

#68What is a race condition and how do you prevent it?

Medium
ConcurrencyJava

#69What is the difference between HashMap.computeIfAbsent() and getOrDefault()?

Medium
CollectionsJava

#70What is the purpose of the transient keyword?

Medium
Core JavaJava

#71What is the difference between i++ and ++i in Java?

Easy
Core JavaJava

#72What are the Java 8 Date/Time APIs and why were they introduced?

Medium
Java 8+Java

#73What is the difference between HashMap.put() and HashMap.putIfAbsent()?

Medium
CollectionsJava

#74What is the difference between String.valueOf() and toString()?

Easy
Core JavaJava

#75What is an immutable class and how do you create one?

Medium
OOPJava

#76What is the covariant return type in Java?

Medium
OOPJava

#77What is the difference between static and instance methods?

Easy
OOPJava

#78What is the difference between Predicate.and(), Predicate.or(), and Predicate.negate()?

Medium
Java 8+Java

#79What is the Observer pattern and how is it implemented in Java?

Medium
OOPJava

#80What is the Strategy pattern in Java?

Medium
OOPJava

#81What are the key differences between Java 8, 11, 17, and 21?

Medium
Java 8+Java

#82What is auto-configuration in Spring Boot?

Medium
Core ConceptsSpring Boot

#83What is @SpringBootApplication and what does it do?

Easy
Core ConceptsSpring Boot

#84What is IoC (Inversion of Control) and Dependency Injection?

Easy
Core ConceptsSpring Boot

#85What is the difference between @Component, @Service, and @Repository?

Easy
Core ConceptsSpring Boot

#86What is the difference between @Controller and @RestController?

Easy
REST APISpring Boot

#87How does Spring Boot handle exceptions globally?

Medium
REST APISpring Boot

#88What is Spring Boot Actuator?

Easy
ProductionSpring Boot

#89What is the difference between @Bean and @Component?

Medium
Core ConceptsSpring Boot

#90Explain Spring Bean scopes.

Medium
Core ConceptsSpring Boot

#91How do you configure Spring profiles?

Easy
ConfigurationSpring Boot

#92What is @Async in Spring Boot and how does it work?

Medium
AdvancedSpring Boot

#93What is Spring Data JPA and how does it simplify data access?

Medium
Data AccessSpring Boot

#94How does Spring Boot externalized configuration work?

Medium
ConfigurationSpring Boot

#95What is Spring Cache Abstraction and how do you use it?

Medium
AdvancedSpring Boot

#96What are Spring Boot starters and why are they useful?

Easy
Core ConceptsSpring Boot

#97How do you write integration tests in Spring Boot?

Medium
TestingSpring Boot

#98What is the Spring ApplicationContext and how does it differ from BeanFactory?

Medium
Core ConceptsSpring Boot

#99What is the @PostConstruct and @PreDestroy lifecycle?

Medium
Core ConceptsSpring Boot

#100What is @Qualifier and when do you need it?

Medium
Core ConceptsSpring Boot

#101What is @ConfigurationProperties and how does it differ from @Value?

Medium
ConfigurationSpring Boot

#102What is Spring Boot's embedded server and how do you switch from Tomcat to Undertow?

Medium
Core ConceptsSpring Boot

#103What is Spring's @EventListener and ApplicationEvent?

Medium
AdvancedSpring Boot

#104What is Spring Boot DevTools?

Easy
Core ConceptsSpring Boot

#105What is the difference between @RequestParam, @PathVariable, and @RequestBody?

Easy
REST APISpring Boot

#106How do you implement request validation in Spring Boot?

Medium
REST APISpring Boot

#107What is ResponseEntity and when should you use it?

Medium
REST APISpring Boot

#108What is content negotiation in Spring MVC?

Medium
REST APISpring Boot

#109How do you implement pagination and sorting in Spring Boot?

Medium
REST APISpring Boot

#110How do you version a REST API in Spring Boot?

Medium
REST APISpring Boot

#111What is the difference between findById() and getById() in Spring Data JPA?

Medium
Data AccessSpring Boot

#112What is the difference between @OneToMany with fetch LAZY vs EAGER?

Medium
Data AccessSpring Boot

#113What is CSRF and how does Spring Security handle it?

Medium
SecuritySpring Boot

#114What is the difference between @Secured, @PreAuthorize, and @RolesAllowed?

Medium
SecuritySpring Boot

#115What is CORS and how do you configure it in Spring Boot?

Medium
SecuritySpring Boot

#116What is MockMvc and how do you use it?

Medium
TestingSpring Boot

#117What is @MockBean vs @Mock in Spring Boot tests?

Medium
TestingSpring Boot

#118What is @DataJpaTest and how does it differ from @SpringBootTest?

Medium
TestingSpring Boot

#119What is Testcontainers and how does it improve Spring Boot tests?

Medium
TestingSpring Boot

#120What is Micrometer and how does it integrate with Spring Boot Actuator?

Medium
ProductionSpring Boot

#121How do you implement custom health indicators in Spring Boot?

Medium
ProductionSpring Boot

#122What is graceful shutdown in Spring Boot and how do you configure it?

Medium
ProductionSpring Boot

#123What is @ControllerAdvice and how does it work?

Medium
REST APISpring Boot

#124What is Spring's @Scheduled and how do you configure it?

Medium
AdvancedSpring Boot

#125What is CommandLineRunner and ApplicationRunner?

Easy
Core ConceptsSpring Boot

#126What is Spring Boot's banner and how can you customize it?

Easy
Core ConceptsSpring Boot

#127What is Spring Retry and how do you use it?

Medium
AdvancedSpring Boot

#128What is @Transactional readOnly = true and what does it optimize?

Medium
Data AccessSpring Boot

#129How do you handle file uploads in Spring Boot?

Medium
REST APISpring Boot

#130What is the difference between @RequestMapping and specific mapping annotations?

Easy
REST APISpring Boot

#131What is the difference between @Transactional on a class vs a method?

Medium
Data AccessSpring Boot

#132What is Spring Boot's connection pool? How do you tune HikariCP?

Medium
Data AccessSpring Boot

#133What is Spring Boot's auto-configuration for messaging (RabbitMQ / Kafka)?

Medium
AdvancedSpring Boot

#134How does Spring Boot handle environment-specific properties?

Medium
ConfigurationSpring Boot

#135What is the purpose of @EnableJpaAuditing?

Medium
Data AccessSpring Boot

#136What is the difference between eager and lazy initialization in Spring Boot?

Medium
Core ConceptsSpring Boot

#137What is Spring Boot's support for caching with Redis?

Medium
AdvancedSpring Boot

#138What is Spring Boot's support for MongoDB?

Medium
Data AccessSpring Boot

#139What is the difference between @Valid and @Validated in Spring?

Medium
REST APISpring Boot

#140What is Spring Data REST and how does it differ from Spring MVC?

Medium
Data AccessSpring Boot

#141What is the difference between @Inject and @Autowired?

Easy
Core ConceptsSpring Boot

#142What is Flyway and how does it integrate with Spring Boot?

Medium
Data AccessSpring Boot

#143What are Spring Boot's management endpoints and how do you secure them?

Medium
ProductionSpring Boot

#144What is Spring Boot's Docker image building support?

Medium
ProductionSpring Boot

#145What is the difference between @SpringBootTest(webEnvironment) options?

Medium
TestingSpring Boot

#146What is Spring Boot's support for SSE (Server-Sent Events)?

Medium
AdvancedSpring Boot

#147What are the different types of SQL JOINs?

Easy
QueryingMySQL

#148How does indexing work in MySQL (InnoDB)?

Medium
IndexingMySQL

#149What is a covering index?

Medium
IndexingMySQL

#150How do you use EXPLAIN to analyze a query?

Medium
PerformanceMySQL

#151What are CTEs (Common Table Expressions) and when should you use them?

Medium
Advanced SQLMySQL

#152What is the N+1 query problem and how do you fix it?

Medium
PerformanceMySQL

#153What is a deadlock in MySQL and how does it occur?

Medium
TransactionsMySQL

#154What is the difference between DELETE, TRUNCATE, and DROP?

Easy
QueryingMySQL

#155What is database normalization?

Medium
Schema DesignMySQL

#156What is GROUP BY vs HAVING in SQL?

Easy
QueryingMySQL

#157What is a stored procedure and when should you use it?

Medium
Advanced SQLMySQL

#158What is the difference between UNION and UNION ALL?

Easy
QueryingMySQL

#159What is the difference between a clustered and a non-clustered index?

Medium
IndexingMySQL

#160How does MySQL handle AUTO_INCREMENT?

Easy
Schema DesignMySQL

#161What are covering indexes and how do they improve performance?

Medium
IndexingMySQL

#162What is the EXPLAIN output and how do you read it?

Medium
PerformanceMySQL

#163What are database triggers and when should you avoid them?

Medium
Schema DesignMySQL

#164What is a foreign key constraint and what are its performance implications?

Medium
Schema DesignMySQL

#165What is the difference between CHAR and VARCHAR?

Easy
Schema DesignMySQL

#166How do you implement full-text search in MySQL?

Medium
QueryingMySQL

#167What is the difference between MyISAM and InnoDB?

Easy
FundamentalsMySQL

#168What are MySQL stored procedures and when should you use them?

Medium
FundamentalsMySQL

#169How do you perform a slow query analysis in MySQL?

Medium
PerformanceMySQL

#170What is the difference between HAVING and WHERE?

Easy
QueryingMySQL

#171What is MySQL's query cache and why was it removed?

Medium
PerformanceMySQL

#172How do you back up a MySQL database without downtime?

Medium
OperationsMySQL

#173What is the difference between optimistic and pessimistic locking in MySQL?

Medium
TransactionsMySQL

#174What is the difference between IN, EXISTS, and JOIN for subqueries?

Medium
QueryingMySQL

#175How do you implement pagination in MySQL efficiently?

Medium
PerformanceMySQL

#176What are the different types of JOINs in MySQL?

Easy
QueryingMySQL

#177What is the difference between a view and a materialized view?

Medium
Schema DesignMySQL

#178What are common MySQL performance anti-patterns?

Medium
PerformanceMySQL

#179What is a generated column in MySQL?

Medium
Schema DesignMySQL

#180What are the best practices for MySQL schema design?

Medium
Schema DesignMySQL

#181How do you use MySQL's JSON column type?

Medium
Schema DesignMySQL

#182What is ProxySQL and how is it used?

Medium
OperationsMySQL

#183How do you detect and fix index fragmentation in MySQL?

Medium
PerformanceMySQL

#184What are the MySQL 8.0 improvements over MySQL 5.7?

Medium
FundamentalsMySQL

#185How do you design a schema for audit logging?

Medium
Schema DesignMySQL

#186What is the difference between COUNT(*), COUNT(1), and COUNT(col)?

Easy
QueryingMySQL

#187How do you implement soft delete in MySQL?

Medium
Schema DesignMySQL

#188What is the difference between CHAR, VARCHAR, TEXT, and BLOB?

Easy
Schema DesignMySQL

#189What is the difference between schema-on-write and schema-on-read?

Medium
FundamentalsMySQL

#190How do you handle time zones in MySQL?

Medium
OperationsMySQL

#191What is the difference between a unique constraint and a unique index?

Easy
IndexingMySQL

#192How do you monitor MySQL in production?

Medium
OperationsMySQL

#193What are window functions and how do you use them?

Medium
QueryingMySQL

#194What is the difference between a primary key and a unique key?

Easy
IndexingMySQL

#195How do you use MySQL's event scheduler?

Medium
OperationsMySQL

#196What is the EXPLAIN ANALYZE command?

Medium
PerformanceMySQL

#197How do you handle database connection failures in application code?

Medium
OperationsMySQL

#198What is the MySQL query execution order?

Medium
QueryingMySQL

#199How do you scale MySQL reads?

Medium
ReplicationMySQL

#200What is the difference between row-based and statement-based replication?

Medium
ReplicationMySQL

#201How do you use CTEs (Common Table Expressions) effectively?

Medium
QueryingMySQL

#202What is the difference between TRUNCATE, DELETE, and DROP?

Easy
OperationsMySQL

#203How do you implement optimistic locking with versioning in MySQL?

Medium
TransactionsMySQL

#204What are the different ways to copy a table in MySQL?

Easy
OperationsMySQL

#205What is the purpose of the information_schema?

Medium
OperationsMySQL

#206How do you implement full-table search across millions of rows efficiently?

Medium
PerformanceMySQL

#207What is the max_connections parameter and how do you tune it?

Medium
OperationsMySQL

#208What is the difference between ROLLUP and CUBE in SQL?

Medium
QueryingMySQL

#209How do you handle NULL values in MySQL queries?

Medium
QueryingMySQL

#210What is the difference between a read and a write transaction?

Medium
TransactionsMySQL

#211What is the mysql.user table and how does MySQL authentication work?

Medium
SecurityMySQL

#212What are MySQL's data types for storing money?

Medium
Schema DesignMySQL

#213What is the difference between DATETIME and TIMESTAMP in MySQL?

Easy
Schema DesignMySQL

#214What are microservices and what problems do they solve?

Easy
ArchitectureMicroservices

#215What is an API Gateway and what does it do?

Medium
ArchitectureMicroservices

#216How do microservices communicate?

Medium
CommunicationMicroservices

#217What is service discovery in microservices?

Medium
InfrastructureMicroservices

#218What is the Circuit Breaker pattern and how does it prevent cascading failures?

Medium
ResilienceMicroservices

#219What is distributed tracing and why is it important?

Medium
ObservabilityMicroservices

#220What is the Strangler Fig pattern for microservices migration?

Medium
ArchitectureMicroservices

#221How do you manage configuration in microservices?

Medium
InfrastructureMicroservices

#222What are the 12-Factor App principles?

Medium
ArchitectureMicroservices

#223What is event-driven architecture and when should you use it?

Medium
ArchitectureMicroservices

#224How do you test microservices effectively?

Medium
TestingMicroservices

#225What is the circuit breaker pattern?

Medium
ResilienceMicroservices

#226What is service discovery and how does it work?

Medium
InfrastructureMicroservices

#227What is the Bulkhead pattern?

Medium
ResilienceMicroservices

#228What is the Retry pattern and how do you implement it safely?

Medium
ResilienceMicroservices

#229What is the Backend for Frontend (BFF) pattern?

Medium
ArchitectureMicroservices

#230How do you implement distributed tracing?

Medium
ObservabilityMicroservices

#231What is the Strangler Fig pattern for migrating a monolith?

Medium
ArchitectureMicroservices

#232How do you version microservice APIs?

Medium
API DesignMicroservices

#233What is the Sidecar pattern?

Medium
InfrastructureMicroservices

#234What is a dead letter queue and why is it important?

Medium
MessagingMicroservices

#235How do you implement health checks in microservices?

Medium
InfrastructureMicroservices

#236What are the 12-Factor App principles?

Medium
ArchitectureMicroservices

#237What is the Ambassador pattern in microservices?

Medium
InfrastructureMicroservices

#238What is the Throttling pattern and how does it differ from rate limiting?

Medium
ResilienceMicroservices

#239How do you test microservices?

Medium
TestingMicroservices

#240What is service isolation and why is it important?

Medium
ArchitectureMicroservices

#241What is an Event-Driven Architecture?

Medium
ArchitectureMicroservices

#242What is the Role of API composition in microservices?

Medium
ArchitectureMicroservices

#243What is graceful degradation in microservices?

Medium
ResilienceMicroservices

#244How do you implement logging in a microservices environment?

Medium
ObservabilityMicroservices

#245How do you handle timeouts in microservices?

Medium
ResilienceMicroservices

#246What is the Scatter-Gather pattern?

Medium
ArchitectureMicroservices

#247What is the difference between a microservice and a nanoservice?

Medium
ArchitectureMicroservices

#248How do you implement canary deployments in microservices?

Medium
InfrastructureMicroservices

#249What is a Service Registry?

Medium
InfrastructureMicroservices

#250What is blue-green deployment and how does it work?

Medium
InfrastructureMicroservices

#251What is the Aggregator pattern?

Medium
ArchitectureMicroservices

#252How do microservices handle configuration management?

Medium
InfrastructureMicroservices

#253What is the Proxy pattern in microservices?

Medium
InfrastructureMicroservices

#254What is Kafka and why is it popular in microservices?

Medium
MessagingMicroservices

#255What is the difference between a monolith, microservices, and modular monolith?

Medium
ArchitectureMicroservices

#256What is a composite microservice?

Medium
ArchitectureMicroservices

#257How do you deal with "chatty" microservices?

Medium
ArchitectureMicroservices

#258What is the Anti-Corruption Layer pattern?

Medium
ArchitectureMicroservices

#259What are the common pitfalls of microservices adoption?

Medium
ArchitectureMicroservices

#260What is the difference between orchestration and choreography?

Medium
Distributed TransactionsMicroservices

#261What is load shedding?

Medium
ResilienceMicroservices

#262What is the difference between gRPC and REST for inter-service communication?

Medium
API DesignMicroservices

#263What is the Gateway Aggregation pattern vs Gateway Routing?

Medium
ArchitectureMicroservices

#264What is the Open Host Service pattern?

Medium
ArchitectureMicroservices

#265How do you implement service-level SLOs in microservices?

Medium
ObservabilityMicroservices

#266What is the Claim Check pattern?

Medium
MessagingMicroservices

#267What is the difference between horizontal and vertical scaling for microservices?

Medium
InfrastructureMicroservices

#268What is the role of a message schema registry?

Medium
MessagingMicroservices

#269How do you handle service discovery with Kubernetes?

Medium
InfrastructureMicroservices

#270What is the Publisher-Subscriber (Pub-Sub) pattern?

Easy
MessagingMicroservices

#271How do you use feature toggles in microservices?

Medium
ArchitectureMicroservices

#272What is polyglot persistence in microservices?

Medium
Data ManagementMicroservices

#273What is the Retry pattern and when should you NOT retry?

Medium
ResilienceMicroservices

#274When should you NOT use microservices?

Medium
ArchitectureMicroservices