Skip to content

Tag Archives: SAP Labs

GCD (Greatest Common Divisor) or HCF (Highest Common Factor) of two numbers is the largest number that divides both of them.  Hey! Looking for some… Read More
Given a sorted array arr[] of n elements, write a function to search a given element x in arr[].A simple approach is to do a… Read More
Like Merge Sort, QuickSort is a Divide and Conquer algorithm. It picks an element as pivot and partitions the given array around the picked pivot.… Read More
Hi, A brief documentation of my SAP Labs, India interview is as follows: Interview Round 1: Q1. What is I of ACID properties?Hey geek! It's… Read More
Given an array of random numbers, Push all the zero’s of a given array to the end of the array. For example, if the given… Read More
  The cost of a stock on each day is given in an array, find the max profit that you can make by buying and… Read More
Heap sort is a comparison-based sorting technique based on Binary Heap data structure. It is similar to selection sort where we first find the minimum… Read More
  Given an array of integers where each element represents the max number of steps that can be made forward from that element. Write a… Read More
Given that integers are read from a data stream. Find median of elements read so for in an efficient way. For simplicity assume, there are… Read More
Given a boolean matrix mat[M][N] of size M X N, modify it such that if a matrix cell mat[i][j] is 1 (or true) then make… Read More
Given two binary trees, check if the first tree is subtree of the second one. A subtree of a tree T is a tree S… Read More
Given an array and an integer K, find the maximum for each and every contiguous subarray of size k. Examples : Become a success story instead… Read More
Given an array A[] consisting 0s, 1s and 2s. The task is to write a function that sorts the given array. The functions should put… Read More
Given a linked list, write a function to reverse every k nodes (where k is an input to the function).  Example: Become a success story instead… Read More

Start Your Coding Journey Now!