Skip to content

Category Archives: Recursion

Given two integers x and n, we need to find number of ways to express x as sum of n-th powers of unique natural numbers.… Read More
Given a string of digits, determine whether it is a ‘sum-string’. A string S is called a sum-string if the rightmost substring can be written… Read More
Given a string you need to print all possible strings that can be made by placing spaces (zero or one) in between them  Examples : … Read More
Mutual recursion is a variation recursion. Two functions are called mutually recursive if the first function makes a recursive call to the second function and… Read More
Given a string of length m containing lowercase alphabets only. We need to find the n-th permutation of string lexicographic ally. Examples:  Input: str[] =… Read More
Given an array of positive integers arr[] and an integer x, The task is to find all unique combinations in arr[] where the sum is… Read More
Given a number n, our task is to find all 1 to n bit numbers with no consecutive 1s in their binary representation. Examples:   Input :… Read More
Round 1 15 Technical Aptitude (predominantly DS), 3 Queries, 2 Coding Question hosted in HackerRank Round 2 (F2F Technical Interview) Find the number of rotations… Read More
Given an array of 2n elements in the following format { a1, a2, a3, a4, ….., an, b1, b2, b3, b4, …., bn }. The… Read More
Some time back I went through an interview for for SDE-1 role, and here is my experience to help other aspirants : Written –… Read More
Round 1: Hackerearth online coding round.  Round 2: (1 hrs 15 minutes) Left View of a binary tree  Explain Binary search and it’s complexity.  How does a… Read More
Round 1(Telephonic) Dynamic memory allocation for 2d array How polymorphism works in C++(Vptr and Vtable implementation) Rope burning puzzle (Measure 45 mins) Round 2(Skype) Find… Read More
Given a stack of integers, sort it in ascending order using another temporary stack. Examples:  Input : [34, 3, 31, 98, 92, 23] Output :… Read More
Round I 1.Implement expiry cache system : every page in cache have id and expiry time (TTL of few seconds). After page expires it behaves… Read More
Round I Say millions of players are playing a game online and their scores keep changing. Every player is represented by ID and SCORE. How… Read More