DSA-Gen
All Interview Categories

Data Structures and Algorithms

Core coding and algorithmic interview questions organized from foundational patterns to advanced problem solving.

Frequently Asked DSA Questions

  • Find two numbers in an array that add up to a specific target sum.

  • Find the contiguous subarray with the largest sum (Kadane's Algorithm).

  • Reverse a singly linked list iteratively and recursively.

  • Determine whether an expression of parentheses and brackets is balanced.

  • Detect whether a singly linked list contains a cycle.

  • Find the maximum profit achievable from buying and selling a stock once.

  • Count the number of connected islands in a 2D binary grid.

  • Find the majority element appearing more than n/2 times in an array.

Basic Coding Questions

Intermediate Coding Questions

  • Search for a target value in a rotated sorted array.

  • Merge all overlapping intervals in a collection.

  • Perform level-order traversal of a binary tree.

  • Design and implement a Least Recently Used (LRU) Cache.

  • Find the lowest common ancestor of two nodes in a binary tree.

  • Determine if all courses can be finished given prerequisite pairs (cycle detection / topological sort).

  • Find the length of the longest substring without repeating characters.

  • Find the kth smallest element in a Binary Search Tree.

Advanced Coding Questions

  • Compute how much rainwater can be trapped between elevation bars.

  • Solve the N-Queens placement problem on an N x N chessboard.

  • Compute the minimum edit distance between two strings.

  • Merge k sorted linked lists into a single sorted list.

  • Find the median from a continuous stream of integers.

  • Find the shortest paths from a source vertex using Dijkstra's algorithm.