## Maximum distance between two occurrences of same element in array

Given an array with repeated elements, the task is to find the maximum distance two occurrences of an element. Examples: Input : arr[] = {3,… Read More »

## Root to leaf paths having equal lengths in a Binary Tree

Given a binary tree, print the number of root to leaf paths having equal lengths. Examples: Input : Root of below tree 10 / \… Read More »

## Check for Palindrome after every character replacement Query

Given a string str and Q queries. Each query contains a pair of integers (i1, i2) and a character ‘ch’. We need to replace characters… Read More »

## Minimum delete operations to make all elements of array same

Given an array of n elements such that elements may repeat. We can delete any number of elements from array. The task is to find… Read More »

## Find if there is a pair in root to a leaf path with sum equals to root’s data

Given a binary tree, find if there is a pair in root to a leaf path such that sum of values in pair is equal… Read More »

## Distinct strings with odd and even changes allowed

Given an array of lower case strings, the task is to find the number of strings that are distinct. Two strings are distinct if on… Read More »

## Find pairs with given sum such that elements of pair are in different rows

Given a matrix of distinct values and a sum. The task is to find all the pairs in given whose summation is equal to given… Read More »

## Count all pairs with given XOR

Given an array of distinct positive integers and a number x, find the number of pairs of integers in the array whose XOR is equal… Read More »

## Amazon Interview Experience | Set 315

Interviewed for Mumbai location. Round 1 (Written round – 45 min) 1. Count the number of occurrences in a sorted array 2. In given range,… Read More »

## Count Substrings with equal number of 0s, 1s and 2s

Given a string which consists of only 0s, 1s or 2s, count the number of substrings that have equal number of 0s, 1s and 2s.… Read More »

## Count maximum points on same line

Given N point on a 2D plane as pair of (x, y) co-ordinates, we need to find maximum number of point which lie on the… Read More »

## Group Shifted String

Given an array of strings (all lowercase letters), the task is to group them in such a way that all strings in a group are… Read More »

## Streamoid Technologies Interview Experience | Set 1 (For Freshers)

Written Round: This Round was pen and paper round consisted of 45 questions out of which only 2-3 are aptitude and rest are from DS,… Read More »

## Amazon Interview Experience | Set 303 (On-Campus)

Round 0: (Written): 20 MCQs + 2 Coding Questions MCQs – Topics: OS ,DS ,DBMS – (Serialization etc.), Aptitude (simple puzzle kind.) Coding Questions: Given a… Read More »

## Find all strings that match specific pattern in a dictionary

Given a dictionary of words, find all strings that matches the given pattern where every character in the pattern is uniquely mapped to a character… Read More »