-------------------------------------------------------------------------------------------------- 

Interview Coding 2026

-------------------------------------------------------------------------------------------------- 

  • Flattening a Complex/Nested Structure: Take an array containing mixed integers and nested arrays (e.g., {{1}, 2, {3, 4}}) and flatten it into a single-level stream.
    • Key feature to use: Arrays.stream() combined with .flatMap(). [1, 2]
  • Grouping and Aggregations (Mock DB Tasks): Group a list of Employee or Product objects by a specific field (like category or department) and find the maximum or minimum value in each group.
    • Key feature to use: Collectors.groupingBy() paired with Collectors.maxBy() or Collectors.summarizingInt(). [1, 2]
  • String / Character Frequency Counting: Given a string, count the frequency of each character or find the first non-repeating character using functional syntax.
    • Key feature to use: Arrays.stream(s.split("")) with Collectors.groupingBy(Function.identity(), Collectors.counting()). [1, 2]
  • Filtering and Transforming Data: Given a list of financial transactions or loans, filter out specific statuses and map them to a targeted output list.
    • Key feature to use: .filter(), .map(), and .collect(Collectors.toList()). [1, 2]
  •  
  • Transaction Grouping Stream: Given a list of 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.
  • Nested Payload Flattening: Given a nested payload structure where an 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.
  • Top Merchant Filtering: Write a Java 8 Stream pipeline to find the Top 3 merchants based on the highest total transaction values from an incoming list of payment records.
  • Custom Immutable Key Mapping: Write a bulletproof immutable class named AccountKey containing a string accountNo and a mutable Date creation date. Ensure it can be safely used as a key in a HashMap.
  • Stream Performance Profiling: What is the performance difference between running .stream().filter().findFirst() versus .parallelStream().filter().findFirst() on an ordered transaction ledger array?
  • Avoiding NullPointerExceptions: Show your defensive coding standards. How do you use Optional inside a stream pipeline to process custom customer data mapping where some middle names or addresses might be null?
  • Custom Stream Collector: How would you write a custom implementation of a Collector to accumulate transaction strings into a specialized encrypted memory buffer?
  • Two-Sum Transaction Matching: Given an array of processing fee integers and a target total fee, write an optimized O(N) time-complexity algorithm using a HashSet to find the pair of indices that sum up to the target.
  • Sliding Window Ledger: Given a stream of continuous transaction amounts, write an optimized algorithm to find the maximum continuous sum of K consecutive transactions (Sliding Window pattern).
  • Merging Overlapping Intervals: Given an array of trading or settlement time blocks [[1,3],[2,6],[8,10]], write a Java method to merge all overlapping intervals into [[1,6],[8,10]].
  • String Frequency Count: Given a raw text string of payment metadata logs, count the frequency of every word and display the results sorted in descending order using pure Java 8 Streams.
  • Array Deduplication: Write an in-place, memory-optimized algorithm to remove duplicate merchant IDs from a pre-sorted primitive array without allocating any extra array memory (O(1) space complexity).
  • List to Map Collision Resolution: Convert a list of 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.
    1. Group and Aggregate Data: Given a list of Employee objects (with fields: id, name, department, salary), write a stream pipeline to find the highest-paid employee in each department.
    2. 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.
    3. Flattening Nested Collections: Given a list of Order objects, where each order contains a list of Item objects, extract a distinct, sorted list of all item names across all orders using flatMap.
    4. 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.
    5. 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.
    1. Producer-Consumer Implementation: Implement a classic Producer-Consumer runtime solution using a BlockingQueue where multiple producer threads generate data and a single consumer processes it.
    2. 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.
    3. 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.
    1. 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).
    2. Subarray with Given Sum: Find a continuous subarray that adds up to a specified sum S. (Optimize using the Sliding Window technique).
    3. 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).
    4. 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.
    1. 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 Employee table without using hardcoded limits.
    2. 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.
    3. Complex Joins & Aggregations: Given an Orders table and a Customers table, find the names of customers who have placed more than 5 orders in the last 30 days along with their total spend.
  •