Kotak | SDE 2 | Reject
Summary
I interviewed for an SDE 2 position at Kotak and was rejected after two rounds. The interview included a DSA problem on maximizing coins in a tree with non-adjacent nodes and a system design problem to build a concurrent log processor.
Full Experience
Experience: ~4 Years
Round 1 – DSA + Discussion
We started with a general discussion about my job, the most challenging work I’ve done, and related experience.
Problem Statement :
Given a tree T with N nodes, where each node i has Ci coins attached to it:
You need to choose a subset of nodes such that:
No two chosen nodes are adjacent (i.e., directly connected by an edge)
The sum of coins from the chosen nodes is maximized
Input
Number of nodes: 4
Edges:
0 - 1 0 - 2 2 - 3
Coins:
[2, 5, 3, 1]
Output 8
Explanation: We can choose nodes 1 and 2 with coins 5 and 3.
My Approach
Used DFS + Dynamic Programming
For each node, computed:
Max sum if the node is included
Max sum if the node is excluded
Time Complexity: O(N) Space Complexity: O(N)
The interviewer seemed satisfied with the solution.
The round ended with a few questions on: HLD and Java Internals
Round 2 – Concurrent Systems (Java) Problem Statement :
You are asked to design a Concurrent Log Processor in Java.
Log entries come as strings in the format:
userId,eventType,timestamp
Example Logs u1,LOGIN,2026-01-01T11:15:10 u2,LOGOUT,2026-04-12T11:16:00 u1,LOGIN,2026-04-11T12:17:10
Multiple threads will push logs concurrently.
Requirements
Implement a class LogProcessor with:
public void acceptLog(String logLine); // Called by multiple threads
public Map<String, Integer> getUserEventCounts(String userId);
acceptLog must be thread-safe
getUserEventCounts("u1") should return something like:
{ "LOGIN": 2, "LOGOUT": 1 }
Solution should be thread-safe and reasonably efficient
My Solution :
Used ConcurrentHashMap
Outer map: userId → eventMap
Inner map: eventType → count
Interviewer was okay-ish with this approach
Follow-up Questions :
Interviewer asked how I would implement ConcurrentHashMap internally
I explained basic ideas like:
-
Fine-grained locking
-
Locking on writes
-
Concurrent reads
However, I lacked deep knowledge of its internal implementation
I also suggested a scheduler-based batching approach
-
Accept logs into a queue
-
Periodically update aggregates
This introduces slight latency in reads
The interviewer did not seem fully satisfied with these answers.
Final Outcome
The interview ended politely. I received a rejection email after a couple of days.
Request for Feedback :
It would be great if someone could suggest, a better design for the concurrent log processor.
Hope this helps others preparing for similar interviews.
Interview Questions (2)
Given a tree T with N nodes, where each node i has Ci coins attached to it:
You need to choose a subset of nodes such that:
No two chosen nodes are adjacent (i.e., directly connected by an edge)
The sum of coins from the chosen nodes is maximized
Input
Number of nodes: 4
Edges:
0 - 1 0 - 2 2 - 3
Coins:
[2, 5, 3, 1]
Output 8
Explanation: We can choose nodes 1 and 2 with coins 5 and 3.
You are asked to design a Concurrent Log Processor in Java.
Log entries come as strings in the format:
userId,eventType,timestamp
Example Logs u1,LOGIN,2026-01-01T11:15:10 u2,LOGOUT,2026-04-12T11:16:00 u1,LOGIN,2026-04-11T12:17:10
Multiple threads will push logs concurrently.
Requirements
Implement a class LogProcessor with:
public void acceptLog(String logLine); // Called by multiple threads
public Map<String, Integer> getUserEventCounts(String userId);
acceptLog must be thread-safe
getUserEventCounts("u1") should return something like:
{ "LOGIN": 2, "LOGOUT": 1 }
Solution should be thread-safe and reasonably efficient