Java is the most commonly tested language in Indian tech interviews, used at service companies (TCS, Infosys, Wipro) for backend development and at product companies (Zepto, Swiggy, Razorpay) for high-performance systems. This guide covers the most important Core Java concepts, Spring Boot questions asked at Indian product companies, Java coding problems you will encounter, and the key differences between service company and product company Java interviews.
Core Java Concepts You Must Know
Core Java interview must-know concepts: (1) OOP fundamentals: abstraction, encapsulation, inheritance, polymorphism with real examples. Interviewers test with: 'Can you overload the main method in Java?' (yes, but JVM calls the String[] version as entry point), 'What is the difference between method overloading and overriding?' (compile-time vs runtime polymorphism). (2) Java memory model: stack vs heap, garbage collection (G1GC vs ZGC), memory leaks, strong/weak/soft/phantom references. (3) Collections framework: HashMap internals (how put() works, hash collisions, load factor, why HashMap capacity is a power of 2), ArrayList vs LinkedList vs ArrayDeque performance trade-offs, ConcurrentHashMap vs HashMap. (4) Multithreading: synchronized vs volatile vs Lock, deadlock conditions and prevention, thread pool (Executors.newFixedThreadPool vs newCachedThreadPool), CompletableFuture for async tasks. (5) Java 8+ features: streams (intermediate vs terminal operations), lambda expressions, Optional, functional interfaces (Function, Predicate, Consumer, Supplier), default methods in interfaces.
Spring Boot Questions at Indian Product Companies
Spring Boot questions at product companies: (1) 'What is inversion of control and how does Spring implement it?' (IoC container manages object lifecycle; Spring uses dependency injection via @Autowired, constructor injection, or setter injection). (2) 'What is the difference between @Component, @Service, @Repository, and @Controller?' (all are stereotype annotations; @Repository adds database exception translation). (3) 'How does Spring Boot auto-configuration work?' (spring.factories scans the classpath and configures beans based on presence of specific classes). (4) 'What is the difference between @RestController and @Controller?' (@RestController = @Controller + @ResponseBody; returns JSON/XML directly). (5) 'How do you handle database transactions in Spring Boot?' (@Transactional annotation, propagation levels: REQUIRED vs REQUIRES_NEW vs NESTED, rollback rules). (6) 'What is the N+1 problem in JPA and how do you fix it?' (fetching a list of entities then issuing a separate query per entity for a relationship; fix with JOIN FETCH or @BatchSize).
Java Coding Questions in Indian Tech Interviews
Common Java coding questions in Indian interviews: (1) Easy-medium: 'Reverse a linked list iteratively and recursively.' 'Find all duplicates in an array using O(n) time and O(1) extra space' (mark elements by negating value at the index). 'Implement a LRU cache' (LinkedHashMap with removeEldestEntry or a HashMap plus doubly linked list). (2) String manipulation: 'Check if two strings are anagrams', 'Find the longest substring without repeating characters', 'Group anagrams from a list of strings'. (3) Collections and generics: 'Sort a list of employees by salary descending, then by name ascending' (Comparator chaining). 'Count word frequency in a list of strings using streams' (Collectors.groupingBy + Collectors.counting). (4) Concurrency: 'Implement a thread-safe bounded blocking queue' (PriorityBlockingQueue or a custom implementation with wait/notify). (5) Design: 'Design a parking lot in Java with OOP principles' (evaluates abstraction and class hierarchy design).
Practise Java developer interview questions with HireStepX's AI voice interviewer and get instant scored feedback on your technical and behavioural answers. First 2 sessions free.
Practice freeService Company vs Product Company Java Interviews
Java interview differences in India: Service companies (TCS, Infosys, Wipro, Cognizant): Core Java is tested to a moderate level (OOP, collections basics, exception handling). Spring Boot is rarely tested in depth for freshers. SQL and DBMS (joins, normalization, indexing basics) are a significant part of the interview. The bar for algorithmic coding is low (easy LeetCode difficulty). Product companies (Razorpay, Swiggy, Google India, Amazon India, Atlassian): Core Java depth (multithreading, Java memory model, generics, JVM internals for senior roles). Spring Boot depth (internals, how auto-configuration works, security, database transactions). LeetCode-style coding (medium to hard difficulty for senior roles; easy to medium for fresher campus roles). System design for mid-senior roles. Behavioural round (STAR-format stories about your past work). Preparation recommendation: for service companies, prioritise OOP, DBMS, and easy LeetCode (30-50 problems). For product companies, prioritise multithreading, Spring Boot internals, and 150-200 LeetCode problems (easy and medium).
Frequently asked questions
Explore more