Cognitree | Interview Experience | SDE 2
Anonymous User
223

Round 1 – DSA

Insert Interval
Problem: Given a set of non-overlapping intervals, insert a new interval (merge if needed).

K Most Frequent Elements
Problem: Return the k most frequent elements from an array.

Round 2 – Java + OOPS + DSA
Java Concepts
OOPS principles, SOLID principles discussion.

HashSet duplicate check question:
Set studs = new HashSet<>();
studs.add(new Student("tom"));
studs.add(new Student("tom"));
Need to store tom as only one oject in hashset

Longest Substring Without Repeating Characters
Example: "abcabcbb" → 3

Longest Substring With At Most 2 Distinct Characters
Example: "adanm" → 3

Overall Experience
Round 1 went smoothly with complete solutions.
Round 2 was good for DSA with complete solutions, but missed the exact explanation for the HashSet duplicate scenario. Learned to always recall equals() + hashCode() behavior for such cases.
Got a Rejection , only missed the hashset solution

Comments (0)