All Medium Articles

## Find if there is a subarray with 0 sum 3

Given an array of positive and negative numbers, find if there is a subarray (of size at-least one) with 0 sum. Examples : Input: {4,… Read More »

## Amazon Interview | Set 75 (For SDE-1) 3

I am currently in my 8th semester . I recently attended the off campus drive for SDE1 at Amazon. Here’s my journey. Round 1:- (Written)… Read More »

## Divide and Conquer | Set 5 (Strassen’s Matrix Multiplication) 3.4

Given two square matrices A and B of size n x n each, find their multiplication matrix. Naive Method Following is a simple way to… Read More »

## Count all possible groups of size 2 or 3 that have sum as multiple of 3 3.1

Given an unsorted integer (positive values only) array of size ‘n’, we can form a group of two or three, the group should be such… Read More »

## Amazon Interview | Set 71 (For SDE-2) 3.5

Recruitment Drive – Delhi (22 March 2014) Position SDE-2 1st Round – Coding and Algo (50 Minutes) 1. Find In order predecessor in BST. 2.… Read More »

## Print a Binary Tree in Vertical Order | Set 1 3

Given a binary tree, print it vertically. The following example illustrates vertical order traversal. 1 / \ 2 3 / \ / \ 4 5… Read More »

## Adobe Interview | Set 8 (Off-Campus) 3

Experience : 8 months First Round : Held on interview street .Aptitude + technical (standard pattern and questions) Second Round (f2f): Started of with the… Read More »

## Amazon Interview | Set 70 (On-Campus For Internship) 3.7

Online Round Coding Question: Given a float number 7.64, convert it into the string WITHOUT using any inbuilt function/library. for eg: input float no.: 7.64… Read More »

## Flipkart Interview | Set 4 (For SDE-1) 3

Company: Flipkart Profile: SDE 1 Experience: 7 months Round 1: Online Coding Exam (2 hour on interviewstreet) (Need to pass 4 test cases + if… Read More »

## Rearrange a string so that all same characters become d distance away 3.8

Given a string and a positive integer d. Some characters may be repeated in the given string. Rearrange characters of the given string such that… Read More »

## Sort n numbers in range from 0 to n^2 – 1 in linear time 3.2

Given an array of numbers of size n. It is also given that the array elements are in range from 0 to n2 – 1.… Read More »

## GATE | GATE-CS-2006 | Question 1 3

Consider the polynomial p(x) = a0 + a1x + a2x2 + a3x3 , where ai ≠ 0 ∀i. The minimum number of multiplications needed to… Read More »

## GATE | GATE-CS-2007 | Question 84 3

Suppose that a robot is placed on the Cartesian plane. At each step it is allowed to move either one unit up or one unit… Read More »

## GATE | GATE-CS-2007 | Question 66 3

In a token ring network the transmission speed is 10^7 bps and the propagation speed is 200 metres/micro second. The 1-bit delay in this network… Read More »

## GATE | GATE-CS-2007 | Question 65 3

There are n stations in a slotted LAN. Each station attempts to transmit with a probability p in each time slot. What is the probability… Read More »

## GATE | GATE-CS-2007 | Question 61 3

Consider the table employee(empId, name, department, salary) and the two queries Q1 ,Q2 below. Assuming that department 5 has more than one employee, and we… Read More »

## GATE | GATE-CS-2007 | Question 59 3.5

Information about a collection of students is given by the relation studinfo(studId, name, sex). The relation enroll(studId, courseId) gives which student has enrolled for (or… Read More »

## GATE | GATE-CS-2007 | Question 58 3

Two processes, P1 and P2, need to access a critical section of code. Consider the following synchronization construct used by the processes:Here, wants1 and wants2… Read More »

## Print all nodes that are at distance k from a leaf node 3.5

Given a Binary Tree and a positive integer k, print all nodes that are distance k from a leaf node. Here the meaning of distance… Read More »

## GATE | GATE-CS-2007 | Question 43 3

A complete n-ary tree is a tree in which each node has n children or no children. Let I be the number of internal nodes… Read More »