100+ Basic Coding Questions
Strings (20)
1. Reverse a string
2. Check if a string is a palindrome
3. Find the first non-repeating character
4. Count vowels and consonants
5. Check if two strings are anagrams
6. Remove duplicate characters
7. Find the most frequent character
8. Count words in a string
9. Convert string to title case
10.Check if a string contains only digits
11.Replace spaces with “%20” (URLify)
12.Find all substrings of a string
13.Longest substring without repeating characters
14.Check if one string is a rotation of another
15.Compress a string (e.g., “aaabb” → “a3b2”)
16.Check if a string is a pangram
17.Remove a specific character from a string
18.Find all permutations of a string
19.Implement atoi() (convert string to integer)
20.Find the first repeated character
Arrays & Lists (20)
21.Find the largest element in an array
22.Find the smallest element in an array
23.Reverse an array
24.Find the sum of elements in an array
25.Check if array contains a duplicate
26.Find second largest element
27.Rotate an array by k positions
28.Remove duplicates from a sorted array
29.Merge two sorted arrays
30.Find missing number in 1 to n sequence
31.Find all pairs with a given sum
32.Find intersection of two arrays
33.Move all zeros to the end
34.Find majority element (appears more than n/2 times)
35.Sort an array without built-in sort
36.Find maximum product of two elements
37.Implement binary search
38.Find the equilibrium index (sum left = sum right)
39.Find longest increasing subarray
40.Check if array is sorted
Math & Numbers (15)
41.Check if a number is prime
42.Find factorial of a number
43.Print Fibonacci series up to n
44.Find GCD and LCM
45.Reverse digits of a number
46.Check if a number is palindrome
47.Find power of a number without using built-in functions
48.Convert decimal to binary
49.Find sum of digits of a number
50.Check if a number is Armstrong
51.Find the nth Fibonacci number (recursion & DP)
52.Count number of set bits in a number
53.Find next greater power of 2
54.Check if a number is perfect square
55.Find all prime numbers up to n (Sieve of Eratosthenes)
Basic Logic & Patterns (15)
56.Print a pyramid pattern of stars
57.Print a diamond pattern
58.Print Pascal’s Triangle
59.Print multiplication table
60.Check leap year
61.Swap two numbers without a temp variable
62.Count number of even and odd numbers in a list
63.Generate random numbers without using built-in random
64.Implement a basic calculator (add, subtract, multiply, divide)
65.Find the sum of first n natural numbers
66.Find the average of elements in a list
67.Print all divisors of a number
68.Find the HCF of two numbers
69.Generate first n prime numbers
70.Print a hollow rectangle of stars
Hashing & Frequency (10)
71.Find frequency of each element in an array
72.Find most frequent element in an array
73.Find elements appearing more than n/k times
74.Check if two arrays are equal (elements)
75.Group elements by frequency
76.Find all duplicates in an array
77.Find first element occurring k times
78.Find common elements in three arrays
79.Check if an array can be rearranged into a palindrome
80.Count distinct elements in every window of size k
Stack & Queue Basics (10)
81.Implement a stack using arrays
82.Implement a queue using arrays
83.Reverse a stack
84.Check for balanced parentheses
85.Next greater element for each element in array
86.Implement two stacks in one array
87.Evaluate a postfix expression
88.Convert infix to postfix
89.Implement a circular queue
90.Design a min-stack (stack with getMin in O(1))
Recursion & Backtracking (10)
91.Factorial using recursion
92.Fibonacci using recursion
93.Solve Tower of Hanoi
94.Find all subsets of a set
95.Find all permutations of an array
96.Count paths in a grid (n x m)
97.N-Queens problem (basic version)
98.Solve Rat in a Maze (backtracking)
99.Generate balanced parentheses
100. Find power set of a given set
Bonus (10 for Interviews)
101. Implement a basic Linked List (insert, delete, traverse)
102. Detect a loop in a linked list
103. Reverse a linked list
104. Find middle of a linked list
105. Merge two sorted linked lists
106. Detect cycle in a graph (DFS)
107. Implement BFS and DFS for a graph
108. Find shortest path in an unweighted graph (BFS)
109. Implement bubble sort
110. Implement quicksort
Additional resource
Main Topics to Cover
1. Core Programming Concepts
2. Object-Oriented Programming (OOP)
3. Error Handling & Debugging
4. File Handling
5. Database Basics & SQL
6. APIs (REST, JSON)
7. Version Control (Git)
8. Code Optimization (Time/Space Awareness)
9. Concurrency & Multithreading Basics
10.System Design Basics (for entry level)
11.Testing (Unit Tests & Basic TDD)
12.Common Libraries & Frameworks (specific to language)
13.Environment & Tooling (Build tools, package managers)
Descriptions & Why They Matter
1. Core Programming Concepts – Understanding variables, loops, functions, recursion,
and memory handling (companies test clarity, not just syntax).
2. OOP – Classes, objects, inheritance, polymorphism, encapsulation (often combined with
real-world scenarios).
3. Error Handling & Debugging – Knowing try/except, debugging tools, and reading
stack traces.
4. File Handling – Reading/writing files, parsing CSV/JSON, basic logging.
5. Database & SQL – CRUD operations, Joins, simple queries (sometimes integrated with
a coding task).
6. APIs – How to make GET/POST requests, parse responses, and connect APIs to your
program.
7. Version Control (Git) – Basic commands like clone, commit, push, branch.
8. Code Optimization – Writing efficient, clean code (companies may ask you to refactor).
9. Concurrency & Multithreading Basics – Threads/processes, locks, async
programming (for backend-heavy roles).
10.System Design Basics – High-level: RESTful API design, database choice, scalability
(lightweight for juniors).
11.Testing – Writing unit tests (e.g., using unittest in Python or JUnit in Java).
12.Libraries & Frameworks – Popular ones in your stack (e.g., Python’s requests,
pandas, Flask/Django basics).
13.Tooling – Familiarity with package managers (pip, npm) and build tools.
Resources to Learn
General (Multi-language)
● [Link] → [Link] (concept overviews)
● Exercism → [Link] (practice coding skills)
● GeeksforGeeks (Non-DSA) → [Link]
For SQL & Databases
● SQLZoo
● Mode SQL Tutorial
● LeetCode Database Questions
For APIs
● Postman API Tutorials
● REST API Guide
For Git
● Learn Git Branching (Interactive)
● Git Handbook
For Testing
● Test Automation University
● Real Python Testing Guide
For Concurrency & Multithreading
● Python: Real Python Concurrency
● Java: Baeldung Concurrency