Menu

Earn Premium with Referrals

Invite your friends and earn Premium rewards through our referral program.

See how it works and start inviting friends.

Pattern Recognition Quiz 2
DSA

Pattern Recognition Quiz 2

Challenge yourself to recognize the appropriate algorithmic pattern before writing a solution.

Quiz

Given an array of positive integers, find the shortest contiguous subarray whose sum is at least k.


Quiz

Given an array that may contain negative numbers, find the shortest subarray with sum at least k.


Quiz

Find the kth smallest element in an unsorted array.


Quiz

Given a sorted array of integers, find the number of occurrences of a target.


Quiz

You are given a grid where each cell has a time when it becomes passable. Find the minimum time to reach the bottom-right cell.


Quiz

Given intervals, determine if a person can attend all meetings.


Quiz

Find the longest increasing subsequence.


Quiz

Given a string, find the longest palindromic substring.


Quiz

You are given n cities and connections between them. Determine the number of connected components.


Quiz

Find the maximum length subarray with equal number of 0s and 1s.


What These Questions Test

  • Do you understand when sliding window fails?
  • Can you detect weighted vs unweighted graph?
  • Can you recognize prefix sum transformations?
  • Can you detect when binary search is hidden?
  • Can you avoid keyword traps like ‘substring’?

Common Trap Signals

  • Presence of negative numbers (breaks sliding window)
  • Word “substring” (not always sliding window)
  • “Minimum time” (could be Dijkstra)
  • “Sorted” (binary search opportunity)
  • “Connected components” (graph)

My Private Notes

Notes are auto-saved locally to this device.