A COMPILATION OF COMMON INTERVIEW QUESTIONS AND SOLUTIONS.
PLEASE FILE AN ISSUE IN CASE OF A BUG OR ADD A COMMENT.
- Given +ve numbers in an array.Put the even #s to the left of the array and the odd to the right side of the array . Don't use extra array.
- Given a sequence of non-negative integers find a subsequence of length 3 having maximum product with the numbers of the subsequence being in ascending order.
- Shift array of integers circularly given input array and shift size.
- Check if a sub-array exists in parent array.
- Find duplicates count in sorted array.
- Write a program takes array input{1,0,2,3} and num = 3 and provides output {1,2}{0,3}{2,1}{3,0} sum equals the num.
- Find the contiguous subarray which has the largest sum. Kadane's algorithm.
- Print numbers with frequency.
- Find Number with Highest frequency in sorted array.
- Find cartesian of lists.
- Implement custom linked list.
- Check if a linked list has loops.
- Find nth element from end of the linked list.
- Flatten a nested list.
- Given a nested list of integers, returns the sum of all integers in the list weighted by their depth.
- Implement custom iterator.
- Breadth First Search
- File Dependency Resolution
- Max Heaps
- Min Heaps
- Custom HashMap implementation.
- Least Recently Used (LRU) cache implementation.
- Concatenate two numbers. for e.g. 123, 0456 = 1230456
- Convert string to number.
- Find factorial of a number.
- Find missing number in stream of numbers.
- Swap Numbers.
- Cloning example (Linked List).
- Implement an Immutable class.
- Pass by value example.
- Implement a singleton class.
- Bubble Sort.
- Insertion Sort.
- Merge Sort.
- Quick Sort.
- Selection Sort.
- Shell Sort.
- Implement a queue using stack.
- Check string palindrome.
- Find common prefix for a given list of strings.
- Find duplicate strings in list of strings.
- Find latest version problem.
- Find Longest Common Subsequence.
- Find Longest Palindrome in a string.
- Print permutations of all characters in a string.
- Find total number of palindromes in a String.
- Find first non-repeated character.
- Given two (dictionary) words as Strings, determine if they are isomorphic.
- Given s string, Find max size of a sub-string, in which no duplicate chars present.
- Find min substring that contains all the char of target string.
- Print diamonds on basis of input size.
- Reverse a string.
- Find all dictionary words in a given string.
- Return true if stringA is subsequence of stringB.
- Implement blocking queue.
- Simulate a deadlock.
- Check Balanced Tree.
- Check if a tree is Subtree of parent tree.
- Find diameter Of Tree.
- Find All Paths Equal To Sum.
- Find Sum Of All Nodes Except Leaf.
- Left View of a Tree.
- Mirror Given Tree.
- Check if a tree is Mirror of another Tree.
- Print Nary Tree With Levels.
*** NOTE: Some problems might be in-complete. I have added TODO for such problems. ***