## Samsung Interview Experience | Set 21 (On-Campus)

Recently, Samsung has visited our campus for hiring FTEs and they have put a CGPA cut off of 7.0/10.The number of rounds varied from 2-4… Read More »

## Find first and last positions of an element in a sorted array

Given a sorted array with possibly duplicate elements, the task is to find indexes of first and last occurrences of an element x in the… Read More »

## Finding the maximum square sub-matrix with all equal elements

Given a N x N matrix, determine the maximum K such that K x K is a submatrix with all equal elements i.e., all the… Read More »

## Find sum of sum of all sub-sequences

Given an array of n integers. The task is to find the sum of sum of each of sub-sequence of the array. Examples: Input :… Read More »

## Efficiently check if a string has duplicates without using any additional data structure

Implement an space efficient algorithm to determine if a string (of characters from ‘a’ to ‘z’) has all unique characters or not. Use additional data… Read More »

## Find the Rotation Count in Rotated Sorted array

Consider an array of distinct numbers sorted in increasing order. The array has been rotated (anti-clockwise) k number of times. Given such an array, find… Read More »

## Minimum step to reach one

Given a positive number N, we need to reach to 1 in minimum number of steps where a step is defined as converting N to… Read More »

## Virtual Memory | Questions

Advantages Large virtual memory. More efficient use of memory. Unconstrained multiprogramming. There is no limit on degree of multiprogramming. Disadvantages Number of tables and amount… Read More »

## Queries on the sum of prime factor counts in a range

There are Q queries. Each query is of the form of L and R. The task is to output sum of number of prime factors… Read More »

## strdup() and strdndup() functions in C/C++

The strdup() and strndup() functions are used to duplicate a string. strdup() : Syntax : char *strdup(const char *s); This function returns a pointer to… Read More »

## Find duplicates under given constraints

A sorted array contains 6 different numbers, only 1 number is repeated five times. So there are total 10 numbers in array. Find the duplicate… Read More »

## Python Input Methods for Competitive Programming

Python is an amazingly user friendly language with the only flaw of being slow. In comparison to C, C++ and Java, it is quite slower.… Read More »

## An Insertion Sort time complexity question

Question : How much time Insertion sort takes to sort an array of size n in below form? arr[] = 2, 1, 4, 3, 6,… Read More »

## Amazon Interview experience | Set 326 (For Application Engineer)

Requirement was that the candidates should have strong troubleshooting skills, strong knowledge of scripting in any language + Strong coding skills and problem solving skills.… Read More »

## Count trailing zero bits using lookup table

Given an integer, count the number of trailing zeroes. For example, for n = 12, its binary representation is 1100 and number of trailing zero… Read More »