--------------------------------------------------------------------------------------------------
Interview Coding 2026
--------------------------------------------------------------------------------------------------
{{1}, 2, {3, 4}}) and flatten it into a single-level stream.Employee or Product objects by a specific field (like category or department) and find the maximum or minimum value in each group.Transaction objects, write a single clean Stream expression to group them by currencyType and sum up the total amount for each currency using Collectors.groupingBy.Account object contains a List<Card>, and each Card contains a List<Transaction>, use flatMap to extract a single flat list of all transactions across all cards.AccountKey containing a string accountNo and a mutable Date creation date. Ensure it can be safely used as a key in a HashMap..stream().filter().findFirst() versus .parallelStream().filter().findFirst() on an ordered transaction ledger array?Optional inside a stream pipeline to process custom customer data mapping where some middle names or addresses might be null?Collector to accumulate transaction strings into a specialized encrypted memory buffer?HashSet to find the pair of indices that sum up to the target.[[1,3],[2,6],[8,10]], write a Java method to merge all overlapping intervals into [[1,6],[8,10]].Employee objects into a Map<String, Double> (ID to Salary). If the list contains duplicate IDs, how do you provide a merge function inside Collectors.toMap to keep the higher salary?1. Java 8 Stream API & Data Transformations (Crucial for Level 8)
Accenture heavily tests your ability to manipulate data structures cleanly without using legacy
for loops.- Group and Aggregate Data: Given a list of
Employeeobjects (with fields:id,name,department,salary), write a stream pipeline to find the highest-paid employee in each department. - Frequency Count: Given a string or a list of words, find the frequency of each character/word, and filter out the top 3 most frequent elements using Streams.
- Flattening Nested Collections: Given a list of
Orderobjects, where each order contains a list ofItemobjects, extract a distinct, sorted list of all item names across all orders usingflatMap. - Partitioning Data: Given a list of transactions, partition them into two groups (e.g., transactions above ₹50,000 and below) and calculate the average transaction amount for each group simultaneously.
- Custom String Joining: Given a list of strings, filter out empty strings, convert them to uppercase, and join them with a comma separator enclosed in square brackets
[A, B, C].
2. Concurrency & Multi-threading Coding Tasks
As a Senior Developer, you must know how to execute tasks safely across multiple threads.
- Producer-Consumer Implementation: Implement a classic Producer-Consumer runtime solution using a
BlockingQueuewhere multiple producer threads generate data and a single consumer processes it. - CompletableFuture Orchestration: Write a method that calls three independent asynchronous external APIs simultaneously. Combine their results into a single consolidated response, and ensure that if one API fails, a fallback default response is used.
- Thread-Safe Singleton/Cache: Write a bulletproof, thread-safe, lazy-initialized Singleton pattern (using Double-Checked Locking) or a simple in-memory cache utilizing
ConcurrentHashMap.
3. Core Array, String & Collection Logic
Standard logical questions to check your foundational data structure proficiency.
- Two-Sum Variant: Given an array of integers and a target sum, find all unique pairs of numbers that add up to that target. (Optimize for O(N) time complexity using a
HashSet). - Subarray with Given Sum: Find a continuous subarray that adds up to a specified sum S. (Optimize using the Sliding Window technique).
- Merge Overlapping Intervals: Given a collection of intervals (e.g.,
[1,3], [2,6], [8,10]), merge all overlapping intervals to output[1,6], [8,10]. (Tests sorting and custom collection logic). - Longest Substring Without Repeating Characters: Find the length of the longest substring in a given string without any duplicate characters.
4. Database-Aligned / SQL Coding Scenarios
Sometimes the interviewer will paste a table schema into the chat and ask you to write a clean SQL query.
- Nth Highest Salary: Write a robust SQL query (and its equivalent Spring Data JPA method name/query) to find the 3rd highest salary from an
Employeetable without using hardcoded limits. - Duplicate Detection: Write an SQL query to identify duplicate rows in a table based on specific columns (e.g.,
email) and delete the older duplicate entries keeping only the latest one. - Complex Joins & Aggregations: Given an
Orderstable and aCustomerstable, find the names of customers who have placed more than 5 orders in the last 30 days along with their total spend.