This is the fine-grained list of coding problems to jump start with the coding questions and get confidence in writing algorithms and learning data structures and algorithms.
As per experience, the right way to learn data structures and algorithms is through solving a coding problem. Start solving the coding problems and learn the data structure and algorithms coming your way. With this technique, you will learn and get hold on both, mastering the coding problems and learning the data structures and algorithms.
Besides, that you will learn the proper utilization of different types of data structures and algorithms and can understand them with their uses.
By the way, we learn the data structures and algorithms to use in application to solve a problem. Don’t we?
- No copy-paste
- You must understand and write logic first on paper, and then code.
Here are the list of coding Questions to get you involved and get amazing confidence. It will start from easy to hard.
(Please allow me some time to update with the best and easy understanding solutions. Till then find solutions by searching the problems on google or YouTube).
- Find the sum of all elements of an integer array. Solution: Java
- Extract numbers from a String. Solution: Java
- Find if a given number is odd or even.
- Check if a number is a prime number
- Print all vowels from a string
- Reverse a given string etc. (1) In place., (2) using recursion
- Count frequency of every words in a string
- Print the following patterns: (1) Pyramid pattern, (2) Floyd’s, (3) Pascal Triangles.
- find factorial of a number using (1) loop, (2) recursion
- Print all prime number between a given range
- Write program to display Fibonacci series
- Write code for the following two programs based on a number: (1) Reverse the digits of a number, (2) find sum of the digits using (a) loop, (b) recursion.
- Find the missing number between 0-100 in an array.
- Find the smallest and highest elements of an integer array.
- Remove duplicates in an integer array.
- Check if a year is a leap year.
- Check if a word is palindrome etc.
- Check if a tree is a BST (Binary Search Tree)
- Find the value of the nth node from a linked list
- Find height of a tree.
- Write program for sum of two matrix
- Move all zeros to the end of an array maintaining the relative orders of the elements.
- Reverse the sentence without reversing each word. E.g. “Hello World” to World “Hello”
- Check if two strings are anagram to each other.
- Find the second largest element from an array. [ Constraints: Apply no sorting]
- Count duplicate words in a given string
- Find common elements from two integer array
- Check if a number is Armstrong number
- Compare two arrays if they are equal.
- Check balanced parenthesis using stack
- Stack design to retrieve minimum element in constant time.