DSA track

DSA interview questions and answers

Panel-ready DSA interview set questions for freshers and experienced developers. Practice at Coding Cadre in Faridabad, or Online from Delhi NCR.

2 Moderate Arrays DSA

How do you find the maximum sum of any contiguous subarray?

Short take Full answer on next page

Simple meaning

Kadane's algorithm keeps a running sum, resetting it to the current value when the running sum goes negative, and tracks the global max.

Open the full page for Why, Steps, Example and Key takeaway.

Read full answer Example · Mistake · Say this
3 Moderate Arrays DSA

How do you merge overlapping intervals?

Short take Full answer on next page

Simple meaning

Sort intervals by start time, then scan and either extend the last merged interval when the next start is at most the current end, or push a new interval.

Open the full page for Why, Steps, Example and Key takeaway.

Read full answer Example · Mistake · Say this
9 Moderate Strings DSA

How do you find the longest palindromic substring?

Short take Full answer on next page

Simple meaning

Expand around each center (and each pair of centers for even length), tracking the longest window.

Open the full page for Why, Steps, Example and Key takeaway.

Read full answer Example · Mistake · Say this
15 Moderate Two Pointers DSA

How do you find all unique triplets that sum to zero?

Short take Full answer on next page

Simple meaning

Sort, then for each index i run two pointers on the right side looking for -nums[i], skipping duplicates at all three positions.

Open the full page for Why, Steps, Example and Key takeaway.

Read full answer Example · Mistake · Say this
Page 1 of 4 Next
Chat with us