## 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 »

## Find the largest three elements in an array

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 Experience | Set 58 (For Software Engineer)

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 »

## Find the element that appears once in a sorted array

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 »

## Find a pair with maximum product in array of Integers

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 »

## Generate all possible sorted arrays from alternate elements of two given sorted arrays

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 »

## Check if two arrays are permutations of each other

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 »

## Count numbers from 1 to n that have 4 as a digit

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 tiny URL or URL shortener?

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 »

## Compute sum of digits in all numbers from 1 to n

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 »

## Count frequencies of all elements in array in O(1) extra space and O(n) time

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 »

## K’th largest element in a stream

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 »

## Find the nearest smaller numbers on left side in an array

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 | Set 14 (For Software Engineer)

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 »

## Paytm Interview Experience | Set 4 (Walk-in Drive)

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 »