- Write a program to print the string "Hello, World"
- Nth Natural Number
- Smallest Positive Integer that cannot be represented as Sum of Elements of the given array
- Write a program to find the only non-duplicate number in an array where all other elements have been repeated even number of times. (eg. [2, 3, 7, 3, 1, 7, 7, 9, 2, 9, 7] ans-1)
- Given a number x, check if it is a palindrome.
- Convert given Roman numeral to integer
- Given two sorted arrays of sizes m, n respectively. Merge the two arrays into a third sorted array of size m + n. (same question can be done with two linked lists)
- Given a string 's' consisting of words and spaces, return the length of the last word in the string.
- Find all possible subsets of a given set.
- Consider a ternary tree (each node has a maximum of 3 children). Perform inorder traversal in such a way that if a node has a prime value, it's subtrees are pruned.
- Find the number of palindromes in a given string.
- Consider a ladder of n steps. A monkey can climb the ladder either 1 step or 2 steps at a time. Find the number of ways in which the monkey climbs the ladder exactly.
- Find sum of all elements in the anti-principle diagonal.
- Given an array with both positive and negative integers, find the subarray which gives maximum sum and return the starting and ending indices.
- Remove all duplicates from an array in a single array traversal.
- Given a string, print out the character with the highest frequency.
- Write a program to emulate a 4 bit adder, input given in binary as strings.
- Given an array and integer k, find the closest pair of elements which add up to k.
- Implement stack data structure using queue. (try doing with single queue for a challenge)
- Divide a by b without using divide , multiplication or modulus operator.
- Calculate x^n.
- remove duplicates from sorted array.
- Reverse an input string.
- Concatenate two strings.
- Given two sorted arrays, write a function to merge them into a single sorted array.
- Given an unsorted array of non-negative integers and a target sum, write a function to find and print a continuous subarray that adds up to the target sum.
- Longest palindrome in a given string.
- Convert from integer to roman numerals.
- Given a array of integers and a target , find all combinations of integers such that sum is the target.
- Longest substring without any repeating characters.
- Give an efficient algorithm to find the nth root of input x.
- Given an array nums with n objects colored red, white, or blue, sort them in-place so that objects of the same color are adjacent, with the colors in the order red, white, and blue.
- Find the kth smallest element in a given array.
- Find if two binary search trees are same. Their roots can be taken as arguments.
- Convert a sorted array into binary search tree.
- Given an integer array and an integer k , find the contigious subarray of size k with the highest sum.
- determine , given a head of a linked list , if it is has a cycle.
- There are n children standing in a line. Each child is assigned a rating value given in the integer array ratings.You are giving candies to these children subjected to the following requirements: Each child must have at least one candy and Children with a higher rating get more candies than their neighbors.Return the minimum number of candies you need to have to distribute the candies to the children.
- Given a positive integer n, you can apply one of the following operations: If n is even, replace n with n / 2. If n is odd, replace n with either n + 1 or n - 1. Return the minimum number of operations needed for n to become 1.
- The following is the definition of Sum-Product of digits of a float : the numbers at 'i'th place after the decimal point should be multiplied with number at the 'i'th place before decimal point. i.e. 1/10th place should be multiplied with 10s place and 1/100th place should be multiplied with 100s place... . Write an efficient algorithm to calculate the Sum-Product of digits of input float number.
- Print prime numbers from 1 to 100
- Take input integer array from user and find the maximum and minimum element in it
- Take an integer input and find the sum of its digits
- Implement binary search
- Write function that translates a text to Pig Latin and back. English is translated to Pig Latin by taking the first letter of every word, moving it to the end of the word and adding ‘ay’. “The quick brown fox” becomes “Hetay uickqay rownbay oxfay”.
- Given two strings, write a program that efficiently finds the longest common subsequence.
- Write a function that combines two lists by alternatingly taking elements, e.g. [a,b,c], [1,2,3] → [a,1,b,2,c,3].
- Write a program to check if the given strings are anagram or not.
- Count Ways to Express a Number as the Sum of Consecutive Natural Numbers.
- Minimum Steps Required to Make Product Equal to One
- Count Trailing Zeros in Factorial
- Find the Number of Combinations, Given N and R