Skip to content
📚 programming

Algorithms Code Quick Start

Sharpen your Algorithms Code skills with targeted coding flashcards.

🎓 422 cards Beginner ⏱ 211 min Developers
Share: 𝕏 Twitter LinkedIn WhatsApp

🎯 What You'll Learn

Preview Cards

12 of 422 shown

What is Binary Search and what is its time complexity? Write the implementation in Python.

Show ▼

Binary Search finds a target in a sorted array by repeatedly halving the search space.

Time: O(log n)  |  Space: O(1)

def binary_search(arr, target):
lo, hi = 0, len(arr) - 1
while lo

What is Bubble Sort and what is its time complexity? Write the implementation in Python.

Show ▼

Bubble Sort repeatedly swaps adjacent elements if they are in the wrong order.

Time: O(n²)  |  Space: O(1)

def bubble_sort(arr):
n = len(arr)
for i in range(n):
swapped = False
for j in range(0, n - i - 1):
if arr[j] > arr[j + 1]:
arr[j], arr[j + 1] = arr[j + 1], arr[j]
swapped = True
if not swapped:
break
return arr

What is Merge Sort and what is its time complexity? Write the implementation in Python.

Show ▼

Merge Sort is a divide-and-conquer algorithm that splits the array in half, recursively sorts each half, then merges them.

Time: O(n log n)  |  Space: O(n)

def merge_sort(arr):
if len(arr)

What is Quick Sort and what is its time complexity? Write the implementation in Python.

Show ▼

Quick Sort picks a pivot, partitions elements around it, then recursively sorts each partition.

Time: O(n log n) avg, O(n²) worst  |  Space: O(log n)

def quick_sort(arr, lo=0, hi=None):
if hi is None:
hi = len(arr) - 1
if lo < hi:
pivot_idx = partition(arr, lo, hi)
quick_sort(arr, lo, pivot_idx - 1)
quick_sort(arr, pivot_idx + 1, hi)

def partition(arr, lo, hi):
pivot = arr[hi]
i = lo - 1
for j in range(lo, hi):
if arr[j]

What is BFS (Breadth-First Search) and what is its time complexity? Write the implementation in Python.

Show ▼

BFS explores a graph level by level using a queue. Used for shortest path in unweighted graphs.

Time: O(V + E)  |  Space: O(V)

from collections import deque

def bfs(graph, start):
visited = set([start])
queue = deque([start])
result = []
while queue:
node = queue.popleft()
result.append(node)
for neighbor in graph[node]:
if neighbor not in visited:
visited.add(neighbor)
queue.append(neighbor)
return result

What is DFS (Depth-First Search) and what is its time complexity? Write the implementation in Python (iterative and recursive).

Show ▼

DFS explores a graph by going as deep as possible before backtracking.

Time: O(V + E)  |  Space: O(V)

Iterative:

def dfs_iterative(graph, start):
visited = set()
stack = [start]
result = []
while stack:
node = stack.pop()
if node not in visited:
visited.add(node)
result.append(node)
for neighbor in graph[node]:
stack.append(neighbor)
return result

Recursive:
def dfs_recursive(graph, node, visited=None):
if visited is None:
visited = set()
visited.add(node)
for neighbor in graph[node]:
if neighbor not in visited:
dfs_recursive(graph, neighbor, visited)
return visited

What is Dijkstra's Algorithm and what is its time complexity? Write the implementation in Python.

Show ▼

Dijkstra's finds the shortest path from a source to all vertices in a weighted graph with non-negative weights.

Time: O((V + E) log V) with min-heap  |  Space: O(V)

import heapq

def dijkstra(graph, start):
dist = {node: float('inf') for node in graph}
dist[start] = 0
heap = [(0, start)]
while heap:
d, u = heapq.heappop(heap)
if d > dist[u]:
continue
for v, weight in graph[u]:
if dist[u] + weight < dist[v]:
dist[v] = dist[u] + weight
heapq.heappush(heap, (dist[v], v))
return dist

What is the Two Pointers technique? Write a Python example: find a pair in a sorted array that sums to a target.

Show ▼

Two Pointers uses two indices moving toward each other (or in the same direction) to solve problems on sorted arrays or linked lists in O(n).

Time: O(n)  |  Space: O(1)

def two_sum_sorted(arr, target):
lo, hi = 0, len(arr) - 1
while lo < hi:
s = arr[lo] + arr[hi]
if s == target:
return (lo, hi)
elif s < target:
lo += 1
else:
hi -= 1
return None

What is the Sliding Window technique? Write a Python example: find the max sum of a subarray of size k.

Show ▼

Sliding Window maintains a window of elements and slides it across the array, adding/removing one element at a time.

Time: O(n)  |  Space: O(1)

def max_sum_subarray(arr, k):
window_sum = sum(arr[:k])
max_sum = window_sum
for i in range(k, len(arr)):
window_sum += arr[i] - arr[i - k]
max_sum = max(max_sum, window_sum)
return max_sum

What is Dynamic Programming (Fibonacci)? Write top-down (memoization) and bottom-up (tabulation) in Python.

Show ▼

DP solves problems by breaking them into overlapping subproblems and storing results to avoid recomputation.

Top-down (Memoization): O(n) time, O(n) space

def fib_memo(n, memo={}):
if n

What is Kadane's Algorithm? Write the implementation in Python.

Show ▼

Kadane's Algorithm finds the maximum sum contiguous subarray in O(n) time.

Time: O(n)  |  Space: O(1)

def max_subarray(arr):
max_ending_here = arr[0]
max_so_far = arr[0]
for num in arr[1:]:
max_ending_here = max(num, max_ending_here + num)
max_so_far = max(max_so_far, max_ending_here)
return max_so_far

What is the 0/1 Knapsack problem? Write the DP solution in Python.

Show ▼

Given items with weights and values and a capacity W, find the maximum value without exceeding W. Each item is used at most once.

Time: O(n * W)  |  Space: O(n * W)

def knapsack(weights, values, W):
n = len(weights)
dp = [[0] * (W + 1) for _ in range(n + 1)]
for i in range(1, n + 1):
for w in range(W + 1):
dp[i][w] = dp[i-1][w]
if weights[i-1]

🎮 Study Modes Available

🔄

Flashcards

Flip to reveal

🧠

Focus Mode

Spaced repetition

Multiple Choice

Test your knowledge

⌨️

Type Answer

Active recall

📚

Learn Mode

Multi-round mastery

🎯

Match Game

Memory challenge

💡 Why Study Programming?

Programming is one of the most valuable and versatile skills in the modern economy. Whether you're a bootcamp graduate solidifying fundamentals, a CS student preparing for exams, or a developer prepping for FAANG interviews, these flashcards help you master the concepts that separate junior developers from senior engineers — algorithms, system design, and software architecture.

📝 Study Tips

Code alongside flashcards

After reviewing an algorithm or data structure card, implement it from scratch in your preferred language to build muscle memory.

Understand time complexity

For every algorithm, know its Big O time and space complexity — this is the most commonly tested concept in technical interviews.

Study patterns, not just solutions

Focus on recognizing problem patterns (sliding window, two pointers, dynamic programming) rather than memorizing individual solutions.

📖 Learning Resources

❓ Frequently Asked Questions

Do these help with coding interviews?

Yes, our programming decks cover algorithms, data structures, and system design concepts frequently tested in technical interviews at top companies.

Which programming languages are covered?

Our flashcards focus on language-agnostic concepts, but examples reference popular languages like Python, JavaScript, Java, and C++.

Are these suitable for beginners?

We offer decks from introductory programming concepts to advanced topics like distributed systems and compiler design.

Which programming languages are covered?

Our flashcards cover concepts in Python, JavaScript, Java, C++, Go, and more, with language-agnostic cards on algorithms and design patterns.

Do you cover data structures and algorithms?

Yes, we have extensive coverage of arrays, linked lists, trees, graphs, sorting algorithms, dynamic programming, and complexity analysis.

Are these suitable for coding interview prep?

Absolutely — our decks focus on the algorithmic patterns, system design concepts, and problem-solving frameworks tested at top tech companies.

LearnCoachAssist

Free flashcards for coaching, sales, and career skills. Powered by spaced repetition to help you learn faster and retain more.

© 2026 LearnCoachAssist. Free flashcard learning for everyone. ·