Confluent Coding Interview Questions
25 Confluent coding interview problems with full optimal solutions — 8 easy, 12 medium, 5 hard. Every problem ships with multiple approaches (brute-force first, then the optimal), complexity tables for each, company-specific tips on what an Confluent interviewer values, and a FAQ section.
Showing 25 problems of 25
- #1easyfoundational
1. Two Sum
Find two indices in an array whose values sum to a target — Confluent uses this to check hash-map intuition before moving to streaming-log questions.
- #2easyfoundational
2. Best Time to Buy and Sell Stock
Find the maximum profit from a single buy-sell over an array of daily prices — Confluent maps it to a single-pass min-tracker that mirrors how a Kafka consumer holds running aggregates per partition.
- #3easyfoundational
3. Single Number
Find the one element appearing once when every other appears twice — Confluent uses it to probe whether you know XOR tricks before scaling to deduplicating Kafka records.
- #4easyfoundational
4. Majority Element
Return the element appearing more than n/2 times — Confluent uses it to test Boyer-Moore voting, which maps cleanly to streaming heavy-hitters over a Kafka topic.
- #5easyfoundational
5. Contains Duplicate
Return true if any value appears at least twice — Confluent uses it to check if you reach for a Set immediately, the same instinct used to dedupe Kafka messages.
- #6easyfoundational
6. Valid Anagram
Decide if two strings are anagrams — Confluent uses it as a warm-up to test count-based hashing before moving to streaming-character-frequency questions.
- #7easyfoundational
7. Missing Number
Find the missing number in [0..n] — Confluent uses it to probe whether you reach for sum-formula or XOR before they extend to detecting missing offsets in a Kafka log.
- #8easyfoundational
8. Design HashMap
Implement a HashMap without using built-in map APIs — Confluent uses it to see if you understand bucket chaining, since Kafka's partition assignment is hash-based at heart.
- #9mediumfoundational
9. LRU Cache
Design an O(1) get/put cache with least-recently-used eviction — Confluent uses it because the same doubly-linked-list + map idea powers consumer-side caches sitting in front of partition reads.
- #10mediumfoundational
10. Number of Islands
Count connected components of '1' cells in a grid — Confluent uses it because the BFS/DFS flood is the same shape as discovering live partitions across a Kafka cluster.
- #11mediumfoundational
11. Course Schedule
Decide if all courses can be finished given prerequisite edges — Confluent uses it because cycle detection in a DAG maps directly onto detecting circular dependencies in Kafka Connect pipelines.
- #12mediumfoundational
12. Kth Largest Element in an Array
Find the kth-largest value in an unsorted array — Confluent uses it to probe heap intuition, which lines up with top-K streaming aggregates over a Kafka topic.
- #13mediumfoundational
13. Product of Array Except Self
Return the array of products of all elements except self without using division — Confluent uses it to test prefix/suffix passes, the same pattern used for partition-aware running aggregates.
- #14mediumfoundational
14. Find the Duplicate Number
Find the repeated number in an n+1 array of values [1..n] using O(1) space — Confluent uses it because cycle-detection on an implicit graph mirrors offset duplication checks in a Kafka log.
- #15mediumfoundational
15. Longest Increasing Subsequence
Return the length of the longest strictly increasing subsequence — Confluent uses it to probe DP/binary-search hybrid thinking, which connects to ordered-offset analysis over a Kafka log.
- #16mediumfoundational
16. Coin Change
Find the fewest coins summing to a target — Confluent uses it as the canonical unbounded knapsack to check that you reason about state transitions before extending to streaming DP over a Kafka topic.
- #17mediumfoundational
17. Top K Frequent Elements
Return the k most frequent elements — Confluent uses it because top-K aggregation is one of the bread-and-butter ksqlDB queries running over a Kafka topic.
- #18mediumfoundational
18. Insert Delete GetRandom O(1)
Design a set with O(1) insert, remove, and random selection — Confluent uses it because the dense-array + map trick is the same one that lets a consumer group pick a partition uniformly during sampling.
- #19mediumfoundational
19. Subarray Sum Equals K
Count contiguous subarrays summing to k — Confluent uses it because the prefix-sum hash trick is the same shape as counting offset windows that hit a target inside a Kafka log.
- #20mediumfoundational
20. Top K Frequent Words
Return the k most frequent words ordered by frequency then lexicographically — Confluent uses it because word-frequency aggregations are the canonical KStream demo over a Kafka topic.
- #21hardfoundational
21. Find Median from Data Stream
Design a structure that absorbs numbers and reports the running median — Confluent uses it because two-heap streaming aggregates are the textbook fit for an online consumer over a Kafka topic.
- #22hardfoundational
22. LFU Cache
Design an O(1) get/put cache with least-frequently-used eviction — Confluent uses it because LFU + recency-within-frequency mirrors the partition-pinning logic in a sticky consumer assignor.
- #23hardfoundational
23. Smallest Range Covering Elements from K Lists
Find the smallest range [a, b] containing at least one element from each of k sorted lists — Confluent uses it because k-way merge is the same shape as joining k partitions in a Kafka topic.
- #24hardfoundational
24. The Skyline Problem
Compute the outline of a city skyline from rectangular buildings — Confluent uses it because event-sweep + max-heap aggregation maps onto windowed aggregations over a Kafka topic.
- #25hardfoundational
25. Next Greater Element IV
For each index find the second next greater element to the right — Confluent uses it because monotonic-stack chaining mirrors backpressure handling across two log positions inside a Kafka partition.