## Search an element in an array where difference between adjacent elements is 1

Given an array where difference between adjacent elements is 1, write an algorithm to search for an element in the array and return the position… Read More »

- Sliding Window Maximum (Maximum of all subarrays of size k) using stack in O(n) time
- Optimal Strategy for a Game | Set 2
- Find k closest numbers in an unsorted array
- Create linked list from a given array
- Check if given Preorder, Inorder and Postorder traversals are of same tree | Set 2
- Maximum Sum Subsequence of length k
- Maximum sum such that no two elements are adjacent | Set 2
- Sort an array without changing position of negative numbers
- Kth smallest element in a subarray
- Introduction to Data Structures | 10 most commonly used Data Structures
- Given two arrays count all pairs whose sum is an odd number
- Find maximum xor of k elements in an array
- Count the triplets such that A[i] < B[j] < C[k]
- Find the longest string that can be made up of other strings from the array
- Find minimum difference between any two elements | Set 2
- Partition an array of non-negative integers into two subsets such that average of both the subsets is equal
- Count of integers of length N and value less than K such that they contain digits only from the given set
- Number of subsets with zero sum
- Split the given array into K sub-arrays such that maximum sum of all sub arrays is minimum
- Greatest contiguous sub-array of size K
- Remove duplicate elements in an Array using STL in C++
- Find the smallest positive number missing from an unsorted array | Set 3
- Maximum sum combination from two arrays
- Flip minimum signs of array elements to get minimum sum of positive elements possible
- Remove duplicates from unsorted array using Set data structure
- Maximum water that can be stored between two buildings
- Pair with largest sum which is less than K in the array
- Iterative approach to print all permutations of an Array
- Find the smallest positive number missing from an unsorted array : Hashing Implementation
- Maximize the happiness of the groups on the Trip

Given an array where difference between adjacent elements is 1, write an algorithm to search for an element in the array and return the position… Read More »

Given an array with all distinct elements, find the largest three elements. Expected time complexity is O(n) and extra space is O(1). Examples : Input:… Read More »

Microsoft Interview for Software Engineer Hyderabad. Round 1: (1 hr) 1. Given 3 sorted arrays. Find the common element of all the arrays in O(N)… Read More »

Given a sorted array in which all elements appear twice (one after one) and one element appears only once. Find that element in O(log n)… Read More »

Given an array with both +ive and -ive integers, return a pair with highest product. Examples : Input: arr[] = {1, 4, 3, 6, 7,… Read More »

Given two sorted arrays A and B, generate all possible arrays such that first element is taken from A then from B then from A… Read More »

Given two unsorted arrays of same size, write a function that returns true if two arrays are permutations of each other, otherwise false. Examples: Input:… Read More »

Given a number n, find count of all numbers from 1 to n that have 4 as a digit. Examples : Input: n = 5… Read More »

How to design a system that takes big URLs like “https://www.geeksforgeeks.org/count-sum-of-digits-in-numbers-from-1-to-n/” and converts them into a short 6 character URL. It is given that URLs… Read More »

Given a number n, find sum of digits in all numbers from 1 to n. Examples: Input: n = 5 Output: Sum of digits in… Read More »

Given an unsorted array of n integers which can contain integers from 1 to n. Some elements can be repeated multiple times and some other… Read More »

Given an infinite stream of integers, find the k’th largest element at any point of time. Example: Input: stream[] = {10, 20, 11, 70, 50,… Read More »

Given an array of integers, find the nearest smaller number for every element such that the smaller element is on left side. Examples: Input: arr[]… Read More »

Snapdeal interview experience for Software Engineer position: Round 1: Simulation round Ques: Develop REST API for adding, fetching, updating and deleting a bookmark. Developed API… Read More »

I got a chance to participate in walk-in drive at Paytm Headquarters. Went through the following process. Written test: It contained 20 objective questions having… Read More »