Skip to content
All Medium Articles
Rules of the Game The game is to be played between two people (in this program between HUMAN and COMPUTER). One of the player chooses… Read More
I had around 1 year and 9 months of experience. And applied for SDE1 First Round (F2F): 1. What are data structures in which you… Read More
Prerequisites: Minimax Algorithm in Game Theory, Evaluation Function in Game TheoryLet us combine what we have learnt so far about minimax and evaluation function to… Read More
Prerequisite : Find day of the week for given dateProblem: To print the calendar of any given year. The program should be such that it… Read More
Prerequisite : Multithreading in Java, Synchronized in Java What is Polling and what are problems with it? The process of testing a condition repeatedly till… Read More
Given an unsorted array of integers, find a subarray that adds to a given number. If there is more than one subarray with the sum… Read More
Given a boolean 2D matrix, find the number of islands.A group of connected 1s forms an island. For example, the below matrix contains 5 islands … Read More
We have discussed sorting weapons used by different languages in previous article. In this article, C++’s Sorting Weapon, Introsort is discussed. What is Introsort? Simply… Read More
Given a positive integer, find the maximum integer possible by doing at-most K swap operations on its digits.Examples:  Input: M = 254, K = 1… Read More
Given a positive integer n, find the no of factors in n! where n <= 105. Examples :   Input : n = 3 Output : 4… Read More
Given an array that contains odd number of occurrences for all numbers except for a few elements which are present even number of times. Find… Read More
Remember the old Minesweeper ? We play on a square board and we have to click on the board on the cells which do not have… Read More
What is the best sorting algorithm to use for the elements in array are more than 1 million in general? (A) Merge sort. (B) Bubble sort.… Read More
Given a set of strings, find the longest common prefix. Input : {“geeksforgeeks”, “geeks”, “geek”, “geezer”} Output : "gee" Input : {"apple", "ape", "april"} Output… Read More
Given a set of strings, find the longest common prefix. Input : {“geeksforgeeks”, “geeks”, “geek”, “geezer”} Output : "gee" Input : {"apple", "ape", "april"} Output… Read More
1st Round (2 hr) 1) About current work 2) OS -> factors to consider while designing an Operating system. followed by discussions on virtual memory,… Read More
What is a buffer? A temporary storage area is called buffer. All standard input and output devices contain an input and output buffer. In standard C/C++,… Read More
Many of us know the traditional uses of scanf. Well, here are some of the lesser known facts How to read only a part of… Read More
Dinoo is worried that he might have a rare disease. He decides to get himself  tested, and suppose that the testing methods for this disease… Read More
Given a word, find lexicographically smaller permutation of it. For example, lexicographically smaller permutation of “4321” is “4312” and next smaller permutation of “4312” is… Read More