Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 

Repository files navigation

RivoHire Coding Problems

A curated collection of coding interview problems, data structure and algorithm patterns, hints, reasoning frameworks and solution approaches.

This repository is maintained by RivoHire, an AI-powered interview preparation and hiring platform.

Purpose

Many candidates memorize coding solutions without learning how to identify the correct approach.

This repository focuses on the complete interview-thinking process:

  1. Understand the problem
  2. Extract important signals
  3. Translate signals into properties
  4. Identify possible patterns
  5. Compare alternative approaches
  6. State assumptions
  7. Analyze time and space complexity
  8. Implement the solution clearly
  9. Explain trade-offs to the interviewer

SPARK Problem-Solving Framework

RivoHire uses the SPARK framework to help candidates recognize coding interview patterns.

S — Signals

Identify important words and constraints such as:

  • Sorted
  • Subarray
  • Substring
  • Pair
  • Frequency
  • Minimum
  • Maximum
  • Shortest path
  • Tree
  • Graph
  • Repeated choices

P — Properties

Translate signals into algorithmic properties:

  • Ordering
  • Contiguity
  • Connectivity
  • Frequency counting
  • Monotonicity
  • Repeated subproblems
  • Fast lookup
  • Range processing

A — Available Patterns

Consider likely patterns before choosing one:

  • Hash map
  • Two pointers
  • Sliding window
  • Binary search
  • Prefix sum
  • BFS
  • DFS
  • Heap
  • Backtracking
  • Dynamic programming

R — Reasoning

Explain why the selected pattern matches the problem better than alternatives.

K — Key Assumptions

State the assumptions that make the solution valid and identify what would break the approach.

Read the full guide:

How to Recognize DSA Patterns in Coding Interviews

Problem Categories

Arrays and Strings

  • Two Sum
  • Maximum Subarray
  • Product Except Self
  • Longest Substring Without Repeating Characters
  • Merge Intervals
  • Rotate Array

Hash Maps and Sets

  • Frequency counting
  • Duplicate detection
  • Complement lookup
  • Grouping and indexing
  • Prefix-sum lookup

Two Pointers

  • Pair sum in sorted arrays
  • Palindrome checking
  • Container problems
  • Partitioning
  • Removing duplicates

Sliding Window

  • Longest valid substring
  • Maximum or minimum window
  • Fixed-size window calculations
  • Frequency-constrained ranges

Binary Search

  • Search in sorted arrays
  • First and last occurrence
  • Rotated sorted arrays
  • Binary search on answer
  • Monotonic decision problems

Linked Lists

  • Reversal
  • Cycle detection
  • Middle node
  • Merging lists
  • Pointer manipulation

Trees and Graphs

  • Tree traversal
  • Lowest common ancestor
  • Connected components
  • Shortest paths
  • Topological sorting
  • Cycle detection

Heaps and Priority Queues

  • Top K elements
  • Kth largest or smallest
  • Scheduling
  • Streaming data
  • Merging sorted sources

Dynamic Programming

  • Knapsack
  • Coin change
  • Longest common subsequence
  • Grid paths
  • State transitions
  • Memoization and tabulation

Backtracking

  • Permutations
  • Combinations
  • Subsets
  • Constraint solving
  • Search-space exploration

Standard Problem Format

Each problem should use the following structure:

Problem title
Difficulty
Problem statement
Examples
Constraints
Signals
Properties
Candidate patterns
Recommended pattern
Reasoning
Key assumptions
Hints
Time complexity
Space complexity
Solution
Alternative approaches
Common interview mistakes
Follow-up questions

About

Coding interview problems, DSA patterns, hints, complexity analysis and solution approaches for technical interview preparation by RivoHire.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors