Questions I was asked in different telephonic and onsite interviews.
Implement Throttling
- Design Data Structure and Algorithm for implementing throttling.Implement pow(x, n)
- Optimized solution with recursion LeetCode050Merge Two Sorted Array
- Merge two sorted array in first array, given that first array has space to add all elements of second array.Merge k Sorted Lists
- Merge k sorted linked lists and return it as one sorted list. LeetCode023Merge and Sort Search Results
- Merge, and Sort Search results from different markets to make one search result.Odd Even Linked List
- Given a singly linked list, group all odd nodes together followed by the even nodes LeetCode328Longest Increasing Path in a Matrix
- Given an integer matrix, find the length of the longest increasing path. LeetCode329Evaluate Given Expression
- Given an expression with +, * and @ operations.Find Dominant Language
- Given phrase and API to give confidence percentage of dominant languages in given line, return dominant language of phrase.House Robber
- LeetCode198Find All Anagrams in a String
- Given a string s and a non-empty string p, find all the start indices of p's anagrams in s. LeetCode438String to Number
- Convert given string to number (integer, double)Binary Tree Reverse Level Order Traversal
- Given a binary tree, return the bottom-up level order traversal of its node values LeetCode107Serialize and De-serialize Binary Tree
- Serialize a binary tree to a doubly linked list and De-serialize it back to same tree. Variation of LeetCode297Design Data Structure for throttling
- Design a data structure for throttling requests exceeding given threshold or queries per second.Insert Delete GetRandom O(1)
- Design a data structure that supports insert(val), remove(val) and getRandom() in average O(1) LeetCode381Path Sum
- Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum. LeetCode112Longest Palindromic Subsequence
- Given a string s, find the longest palindromic subsequence's length in s. LeetCode516Find Word Count
- For given word, find its count from a very large file which cannot be loaded in memory.Find longest substring with two unique characters
- Given a string, find a longest substring with maximum two unique characters. Variation of LeetCode003First Unique Character in a String
- Given a string, find first non-repeating character and return its index. LeetCode387Set Mismatch
- Find the duplicate and missing number from a given set of integers originally having set of 1 to n. LeetCode645Find words made using given characters
- Given list of words, return words which can be made using just characters from given character array.LRU Cache
- Design and implement a data structure Least Recently Used (LRU) cache with get and put method. LeetCode146Two Sum
- return pair of numbers such that they adds up to a target number LeetCode001Minimum distance
- Find minimum distance between two given integers in a given integer array.Can Knight Cover all Chess Board
- Given a Knight's initial position in a chess board, check return true if Knight can cover all squares in the board with all possible moves.Integer to English Words
- Convert a non-negative integer to its English words representation LeetCode27325 Horses Problem
- GeeksforGeeksSpiral Matrix
- Given a matrix of m x n elements (m rows, n columns), return all elements of the matrix in spiral order LeetCode054Is Valid Palindrome
- Given a string, determine if it is a palindrome LeetCode125