LEVEL 1 — FUNDAMENTALS Problems 1–15 Goal: Variables, conditions, loops, basic functions
-
Temperature Classifier Given a temperature, classify it as: < 0 → Freezing 0–15 → Cold 16–30 → Moderate 31–40 → Hot
40 → Extreme Heat
-
Number Classifier Given an integer, determine whether it is: Positive / Negative / Zero Even / Odd
-
Largest of Three Find the largest of three integers without using max().
-
Leap Year Determine whether a given year is a leap year.
-
Grade Calculator Given marks for 5 subjects, calculate: Total Percentage Grade Pass/Fail
-
Electricity Bill Calculate electricity bill using slab-based pricing.
-
Factorial Calculate factorial without using math.factorial().
-
Fibonacci Print the first N Fibonacci numbers.
-
Prime Number Determine whether a number is prime.
-
Prime Numbers in Range Print all prime numbers between A and B.
-
Digit Counter Count the number of digits in an integer without converting it to a string.
-
Digit Sum Calculate the sum of all digits of an integer.
-
Reverse Number Reverse an integer mathematically.
-
Armstrong Number Determine whether a number is an Armstrong number.
-
GCD and LCM Calculate GCD and LCM of two integers without using math.gcd().
LEVEL 2 — STRINGS Problems 16–25 Goal: String manipulation and character logic
-
Reverse String Reverse a string without using [::-1].
-
Palindrome String Determine whether a string is a palindrome.
-
Character Frequency Count the frequency of every character.
-
First Non-Repeating Character Return the first character that appears exactly once.
-
Anagram Checker Determine whether two strings are anagrams.
-
Remove Duplicate Characters Remove duplicate characters while preserving original order.
-
Longest Word Find the longest word in a sentence.
-
Word Frequency Count how many times each word appears.
-
String Compression Convert: aaabbccccd into: a3b2c4d1
-
Longest Consecutive Character Find the longest sequence of the same character.
Example: aaabbccccdd Output: 4
LEVEL 3 — LISTS & ARRAYS Problems 26–40 Goal: Array manipulation and algorithmic thinking
-
Find Maximum Find maximum element without max().
-
Find Second Largest Find the second-largest unique number.
-
Remove Duplicates Remove duplicates from a list without using set().
-
Array Rotation Rotate an array right by K positions.
-
Move Zeros Move all zeros to the end while maintaining order.
Example: [0,1,0,3,12] → [1,3,12,0,0]
-
Two Sum Given an array and target, return indices of two numbers whose sum equals target.
-
Three Sum Find all unique triplets whose sum is zero.
-
Missing Number Given numbers from 0 to N with one missing, find the missing number.
-
Duplicate Number Find the duplicate number in an array containing numbers 1–N.
-
Intersection Find the intersection of two arrays.
-
Union Find the union of two arrays without using set().
-
Maximum Subarray Find the contiguous subarray with the maximum sum.
Example: [-2,1,-3,4,-1,2,1,-5,4] Output: 6
-
Minimum Subarray Find the contiguous subarray with the minimum sum.
-
Product Except Self For each element, calculate the product of all other elements.
Do not use division.
- Majority Element Find the element appearing more than N/2 times.
LEVEL 4 — HASH MAPS & FREQUENCY Problems 41–50 Goal: Dictionaries, counting, efficient lookup
-
Two Sum Optimized Solve Two Sum using a dictionary in O(N).
-
Frequency Sort Sort characters according to frequency.
-
Top K Frequent Elements Return the K most frequent elements.
-
Group Anagrams Group words that are anagrams.
Example: ["eat","tea","tan","ate","nat","bat"]
Output: [["eat","tea","ate"], ["tan","nat"], ["bat"]]
-
First Unique Number Find the first number appearing exactly once.
-
Duplicate Detection Determine whether any value appears more than once.
-
Common Elements Find elements occurring in all three arrays.
-
Subarray Sum Determine whether an array contains a subarray whose sum equals K.
-
Longest Consecutive Sequence Find the length of the longest consecutive sequence.
-
Isomorphic Strings Determine whether two strings follow the same character pattern.
LEVEL 5 — TWO POINTERS & SLIDING WINDOW Problems 51–60 Goal: Efficient O(N) algorithms
-
Two Sum Sorted Given a sorted array, find two numbers that sum to target.
-
Remove Duplicates from Sorted Array Modify the array in-place.
-
Container With Most Water Find two lines that contain the maximum amount of water.
-
Valid Palindrome Determine whether a string is a palindrome after removing non-alphanumeric characters.
-
Longest Substring Without Repeating Characters Return the length of the longest substring containing unique characters.
-
Maximum Sum Window Find maximum sum of any subarray of size K.
-
Minimum Size Subarray Find the smallest subarray whose sum is at least K.
-
Longest Ones Given binary array, find longest sequence of 1s after flipping at most K zeros.
-
Permutation in String Determine whether one string contains a permutation of another.
-
Longest Repeating Character Given a string and K replacements, find the longest substring containing one repeated character.
LEVEL 6 — STACKS & QUEUES Problems 61–70 Goal: LIFO/FIFO logic
- Valid Parentheses Check whether brackets are correctly balanced.
Example: "{[()]}" → Valid
- Min Stack Design a stack supporting: push() pop() top() get_min()
All in O(1).
-
Evaluate Reverse Polish Notation Evaluate: ["2","1","+","3","*"]
-
Remove Adjacent Duplicates Repeatedly remove adjacent duplicate characters.
-
Next Greater Element For each element, find the next greater element to its right.
-
Daily Temperatures For each day, determine how many days until a warmer temperature.
-
Queue Using Two Stacks Implement a queue using only two stacks.
-
Stack Using Queues Implement a stack using queues.
-
Simplify Path Convert a Unix-style path into its canonical form.
-
Largest Rectangle in Histogram Find the largest rectangle area in a histogram.
LEVEL 7 — RECURSION & BACKTRACKING Problems 71–80 Goal: Recursive reasoning and search
-
Recursive Factorial Implement factorial recursively.
-
Recursive Fibonacci Implement Fibonacci recursively and explain its complexity.
-
Power Function Calculate x^n recursively.
-
Generate Parentheses Generate all valid combinations of N pairs of parentheses.
-
Subsets Generate all subsets of a list.
-
Permutations Generate all permutations of a list.
-
Combination Sum Find combinations that sum to a target.
-
Letter Combinations Given phone digits, generate all possible letter combinations.
-
Word Search Given a character grid and a word, determine whether the word exists.
-
N-Queens Place N queens on an N×N chessboard so no two queens attack each other.
LEVEL 8 — LINKED LISTS Problems 81–85 Goal: Pointer manipulation
-
Reverse Linked List Reverse a singly linked list.
-
Detect Cycle Determine whether a linked list contains a cycle.
-
Middle of Linked List Find the middle node using O(1) extra space.
-
Merge Two Sorted Lists Merge two sorted linked lists.
-
Remove Nth Node Remove the Nth node from the end of a linked list.
LEVEL 9 — TREES & GRAPHS Problems 86–95 Goal: Graph traversal and hierarchical data
-
Binary Tree Inorder Traversal Return inorder traversal of a binary tree.
-
Maximum Tree Depth Find maximum depth recursively.
-
Level Order Traversal Return nodes level-by-level.
-
Validate Binary Search Tree Determine whether a binary tree is a valid BST.
-
Lowest Common Ancestor Find the lowest common ancestor of two nodes.
-
Number of Islands Given a binary grid, count connected islands.
-
Flood Fill Implement a flood-fill algorithm.
-
Clone Graph Create a deep copy of a graph.
-
Course Schedule Determine whether all courses can be completed given prerequisites.
-
Shortest Path Find the shortest path between two nodes in an unweighted graph.
LEVEL 10 — ADVANCED / BIOINFORMATICS LOGIC Problems 96–100 Goal: Apply algorithmic thinking to biotechnology
- DNA Complement
Given: ATGCCGTA
Return its complementary DNA strand: TACGGCAT
Rules: A ↔ T C ↔ G
Then implement the reverse-complement function.
Constraints: 1 <= sequence length <= 10^6
- DNA Mutation Distance
Given two DNA sequences of equal length, calculate the number of positions where they differ.
Example: ATGCCA ATGCTA
Output: 1
Then extend the problem to calculate percentage identity.
- Longest ORF
Given a DNA sequence, identify the longest open reading frame (ORF).
Start codon: ATG
Stop codons: TAA TAG TGA
Return: Start position Stop position ORF sequence ORF length
Consider all three reading frames.
- Protein Motif Search
Given a protein sequence and a motif pattern, determine every position where the motif occurs.
Example:
Protein: MKTLLVAGAGKTNAA
Motif: GAG
Output: Position(s): 7
Then extend the problem to support wildcard "X".
Example: GAXG
should match: GATG GACG GAGG etc.
- Protein Sequence Analysis Engine
Build a complete protein-analysis program.
Input: A CSV file containing multiple protein sequences.
For every sequence calculate:
- Sequence ID
- Protein length
- Molecular mass
- Amino-acid composition
- Percentage of hydrophobic residues
- Percentage of charged residues
- Number of cysteines
- Number of tryptophans
- Theoretical extinction coefficient
- Basic/acidic residue ratio
- Invalid amino-acid characters
Output: A new CSV file containing all calculated properties.
Additional requirements:
• Handle invalid sequences without crashing. • Process thousands of sequences. • Do not use Biopython. • Separate file handling from biological calculations. • Write reusable functions. • Use appropriate data structures. • Explain the time complexity of your algorithm. • Test your program with at least 10 sequences. • Include edge cases.
BONUS:
After completing the program, optimize it for:
Time complexity Memory usage Large input files
Target: 100,000 protein sequences Average length: 500 amino acids