# Category Archives: Algorithms

## VMware Interview Experience | Set 5 (On-Campus for IT Application Developer)

Round 1: ONLINE OBJECTIVE ROUND on HIREPRO platform This round comprised of 30 objective difficult and lengthy paragraph based aptitude questions to be solved in… Read More »

## C++ bitset interesting facts

Bitset is a container in C++ Standard Template Library for dealing with data at the bit level. A bitset stores bits (elements with only two… Read More »

## Count Pairs Of Consecutive Zeros

Consider a sequence that starts with a 1 on a machine. At each successive step, the machine simultaneously transforms each digit 0 into the sequence… Read More »

## A Space Optimized DP solution for 0-1 Knapsack Problem

Given the weights and values of n items, put these items in a knapsack of capacity W to get the maximum total value in the… Read More »

## Find Last Digit of a^b for Large Numbers

You are given two integer numbers, the base a (number of digits d, such that 1 <= d <= 1000) and the index b (0… Read More »

## Third largest element in an array of distinct elements

Given an array of n integers, find the third largest element. All the elements in the array are distinct integers. Example : Input: arr[] =… Read More »

The reverse and add function starts with a number, reverses its digits, and adds the reverse to the original. If the sum is not a… Read More »

## Find all distinct subsets of a given set

Given a set of positive integers, find all its subsets. The set can contain duplicate elements, so any repeated subset should be considered only once… Read More »

## Find number of times a string occurs as a subsequence in given string

Given two strings, find the number of times the second string occurs in the first string, whether continuous or discontinuous. Examples: Input: string a =… Read More »

## Find an index of maximum occurring element with equal probability

Given an array of integers, find the most occurring element of the array and return any one of its indexes randomly with equal probability. Examples:… Read More »

## Number of elements with odd factors in given range

Given a range [n,m], find the number of elements that have odd number of factors in the given range (n and m inclusive). Examples :… Read More »

## Adobe Interview Experience | Set 40 (On-Campus for MTS-1)

Online test: Coding : Time : 90 minutes There were three coding questions as follows: A man starts from his house with a few pan… Read More »

## Stein’s Algorithm for finding GCD

Stein’s algorithm or binary GCD algorithm is an algorithm that computes the greatest common divisor of two non-negative integers. Stein’s algorithm replaces division with arithmetic… Read More »

## Minimum Cost To Make Two Strings Identical

Given two strings X and Y, and two values costX and costY. We need to find minimum cost required to make the given two strings… 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 »