Skip to content
All Medium Articles
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
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
Copy elision (or Copy omission) is a compiler optimization technique that avoids unnecessary copying of objects. Now a days, almost every compiler uses it. Let… Read More
Write a program to find sum of positive integers without using any operator. Only use of printf() is allowed. No other library function can be… Read More
In this post, we will try to cover many ambiguous questions like following. Guess the output of following programs. // PROGRAM 1 #include <stdio.h> int… Read More
Given a partially filled 9×9 2D array ‘grid[9][9]’, the goal is to assign digits (from 1 to 9) to the empty cells so that every… Read More
Function prototype tells compiler about number of parameters function takes, data-types of parameters and return type of function. By using this information, compiler cross checks… Read More
Following questions have been asked in GATE CS 2007 exam. 1) Information about a collection of students is given by the relation studinfo(studId, name, sex).… Read More
Partition problem is to determine whether a given set can be partitioned into two subsets such that the sum of elements in both subsets is… Read More
Following questions have been asked in GATE CS 2009 exam. 1) S –> aSa| bSb| a| b ;The language generated by the above grammar over… Read More
Following questions have been asked in GATE CS 2012 exam. 1) What is the complement of the language accepted by the NFA shown below? Assume… Read More
Following questions have been asked in GATE CS 2006 exam. 1) Station A uses 32 byte packets to transmit messages to Station B using a… Read More
Following questions have been asked in GATE CS 2007 exam. 1) The address of a class B host is to be split into subnets with… Read More
Following questions have been asked in GATE CS 2008 exam. 1) What is the maximum size of data that the application layer can pass on… Read More
Following questions have been asked in GATE CS 2008 exam. 1) Which of the following system calls results in the sending of SYN packets? (A)… Read More
Following questions have been asked in GATE CS 2005 exam. 1) An organization has a class B network and wishes to form subnets for 64… Read More
Following questions have been asked in GATE 2008 CS exam. 1) Let R and S be two relations with the following schema R (P,Q,R1,R2,R3) S… Read More
Following questions have been asked in GATE CS 2005 exam. 1) Normally user programs are prevented from handling I/O directly by I/O instructions in them.… Read More
Following questions have been asked in GATE CS 2012 exam. 1) The protocol data unit(PDU) for the application layer in the Internet stack is (A)… Read More