All Medium Articles
Given a rooted tree, and two nodes are in the tree, find the Lowest common ancestor of both the nodes. The LCA for two nodes… Read More
Given an array of 0’s and 1’s, we need to write a program to find the minimum number of swaps required to group all 1’s… Read More
This was my experience in the hiring drive in Gurgaon in January 2018. Around 20-30 people showed up. Round 1: Written Round A paper was… Read More
Morse code is a method of transmitting text information as a series of on-off tones, lights, or clicks that can be directly understood by a… Read More
A Polybius Square is a table that allows someone to convert letters into numbers. To make the encryption little harder, this table can be randomized… Read More
Given inorder and level-order traversals of a Binary Tree, construct the Binary Tree. Following is an example to illustrate the problem. Examples:  Input: Two arrays… Read More
Round 1: Telephonic round. Find max 1 in a row of a 2D array. Find the biggest square in a 2D array. Round 2: On… Read More
Round 1: Telephonic: 1) Remove duplicate numbers from a very large file. 2) Print anagrams of a string found in a very large file 3)… Read More
Partition given string in such manner that i’th substring is sum of (i-1)’th and (i-2)’nd substring.  Examples: Input : "11235813" Output : ["1", "1", "2",… Read More
We are given n-processes with their completion times in form of an array. We need to find the time instant when a given process p… Read More
Many times it happens that while solving mathematical expressions we require a number to be raised by a specific value. We also call this power… Read More
Consider the following four relational schemas. For each schema, all non-trivial functional dependencies are listed, The underlined attributes are the respective primary keys. Schema I:… Read More
Let G be a simple undirected graph. Let TD be a depth first search tree of G. Let TB be a breadth first search tree… Read More
The instruction pipeline of a RISC processor has the following stages: Instruction Fetch (IF), Instruction Decode (ID), Operand Fetch (OF), Perform Operation (PO) and Writeback… Read More
Consider the relations r(A, B) and s(B, C), where s.B is a primary key and r.B is a foreign key referencing s.B. Consider the query… Read More
Let N be the set of natural numbers. Consider the following sets, P: Set of Rational numbers (positive and negative) Q: Set of functions from… Read More
The number of possible min-heaps containing each value from {1, 2, 3, 4, 5, 6, 7} exactly once is _______. Note –This was Numerical Type… Read More
Let G be a graph with 100! vertices, with each vertex labelled by a distinct permutation of the numbers 1, 2, …, 100. There is… Read More
Consider the following C program: #include <stdio.h> void fun1(char *s1, char *s2) {   char *temp;   temp = s1;   s1 = s2;   s2 = temp; }… Read More
Consider the minterm list form of a Boolean function F given below. F(P, Q, R, S) = Σm(0, 2, 5, 7, 9, 11) + d(3,… Read More