Back to Interview Hub

DSA Questions

Data Structures and Algorithms for coding interviews.

Showing 1-6 of 283 questions

1 / 48
1QuestionsHard🔥 80% Asked

Find the longest subarray with at most K distinct characters.

Asked in:GoogleAmazonFacebookMicrosoftApple

Core Approach:

  • O(N) time and O(1) space solution usually preferred.
  • Discuss brute-force vs optimized approaches.

Detailed algorithm breakdown coming soon.

2QuestionsHard🔥 80% Asked

Given an array, find the maximum sum of a subarray with exactly K elements where no two elements are adjacent.

Asked in:GoogleAmazonMicrosoftNetflixUber

Core Approach:

  • O(N) time and O(1) space solution usually preferred.
  • Discuss brute-force vs optimized approaches.

Detailed algorithm breakdown coming soon.

3QuestionsHard🔥 80% Asked

Implement a data structure that supports insert, delete, getRandom, and getMedian in O(1) time.

Asked in:GoogleAmazonFacebookAppleStripe

Core Approach:

  • O(N) time and O(1) space solution usually preferred.
  • Discuss brute-force vs optimized approaches.

Detailed algorithm breakdown coming soon.

4QuestionsHard🔥 80% Asked

Find the smallest window in a string containing all characters of another string.

Asked in:AmazonMicrosoftGoogleFacebookAdobe

Core Approach:

  • O(N) time and O(1) space solution usually preferred.
  • Discuss brute-force vs optimized approaches.

Detailed algorithm breakdown coming soon.

5QuestionsHard🔥 80% Asked

Given an array of integers, find all triplets that sum to zero with no duplicates.

Asked in:AmazonGoogleFacebookMicrosoftApple

Core Approach:

  • O(N) time and O(1) space solution usually preferred.
  • Discuss brute-force vs optimized approaches.

Detailed algorithm breakdown coming soon.

6QuestionsHard🔥 80% Asked

Find the maximum product subarray in an array with both positive and negative numbers.

Asked in:GoogleAmazonMicrosoftLinkedInUber

Core Approach:

  • O(N) time and O(1) space solution usually preferred.
  • Discuss brute-force vs optimized approaches.

Detailed algorithm breakdown coming soon.