Main Navigation
Share your interview in your own words — our AI handles the rest. Hardly takes 2 minutes.
Practice mock interviews or book a 1:1 call for career guidance, resume reviews, and more.
Connect with us on social media
Interview experiences & questions tagged Dsa 2
Solve a variation of the Longest Repeating Character Replacement problem.
Find the longest zigzag path in a binary tree. A zigzag path is defined as one where the direction alternates between left and right. **Approach**: Track the previous direction and current length. If the last move was to the left, the next must be to the right, and vice versa.
Given an array of policy names with Roman numeral suffixes (e.g., ['MAX_BUPA_IX', 'ICICI_LOMBARD_XIX']), sort them by the integer value of the Roman numeral first, then alphabetically. **Approach**: Parse Roman numerals into integers using a HashMap, create pairs of {policyName : number}, and sort these entries using a custom Comparator and lambda (first by value, then by key).
Given an array, maximize the number of segments (chunks) such that after sorting each chunk and concatenating, the result is sorted. Use a monotonically increasing stack. **Follow-ups**: Consider caching, observability, and sharding.
Given a string containing `()`, `{}`, and `[]`, determine whether the brackets are properly balanced and valid.
Coming Soon