Skip to content
Gblog SDE SHEET – A Complete Guide for SDE Preparation
What is SDE Sheet? SDE Sheet is a list of the most important topics or the most popular questions that are asked in the Software… Read More
Given Preorder traversal of a BST, check if each non-leaf node has only one child. Assume that the BST contains unique entries. Examples   Input: pre[]… Read More
Given three linked lists, say a, b and c, find one node from each list such that the sum of the values of the nodes… Read More
Deterministic Finite Automaton (DFA) can be used to check whether a number “num” is divisible by “k” or not. If the number is not divisible,… Read More
When a variable is declared as a reference, it becomes an alternative name for an existing variable. A variable can be declared as a reference… Read More
Write a function that calculates the day of the week for any particular date in the past or future. A typical application is to calculate… Read More
Predict the output of the below code snippet. #include <iostream> using namespace std;    int i;    class A { public:     ~A()     {         i=10;     }… Read More
Given an array ‘pre[]’ that represents Preorder traversal of a special binary tree where every node has either 0 or 2 children. One more array… Read More
Sieve of Eratosthenes is a method for finding all primes up to (and possibly including) a given natural. This method works well when is relatively… Read More
Given a number n, print all primes smaller than or equal to n. It is also given that n is a small number. For example, if… Read More
Given a number n, print all primes smaller than or equal to n. It is also given that n is a small number. For example,… Read More
  Given a number n, print all primes smaller than or equal to n. It is also given that n is a small number.  Example: … Read More
Given an unsorted array and a number n, find if there exists a pair of elements in the array whose difference is n. Examples:  Input: arr[]… Read More
A magic square of order n is an arrangement of n2 numbers, usually distinct integers, in a square, such that the n numbers in all… Read More
Given an array that contains both positive and negative integers, find the product of the maximum product subarray. Expected Time complexity is O(n) and only… Read More
Given a number n, write a function that returns count of numbers from 1 to n that don’t contain digit 3 in their decimal representation. Examples:  … Read More

Start Your Coding Journey Now!