Code Snippets Interview Questions
Questions Answers Views Company eMail

Given an array of size N in which every number is between 1 and N, determine if there are any duplicates in it. You are allowed to destroy the array if you like.

ABC, eBay, Goldman Sachs, Google, HUP, Microsoft, TATA,

21 48940

Write a routine to draw a circle (x ** 2 + y ** 2 = r ** 2) without making use of any floating point computations at all.

Mentor Graphics, Microsoft,

2 22151

Given only putchar (no sprintf, itoa, etc.) write a routine putlong that prints out an unsigned long in decimal.

Fusion Systems GmbH,

6 20589

Give a one-line C expression to test whether a number is a power of 2.

Microsoft,

10 25610

Given an array of characters which form a sentence of words, give an efficient algorithm to reverse the order of the words (not characters) in it.

Wipro,

2 10705

Give a very good method to count the number of ones in a 32 bit number. (caution: looping through testing each bit is not a solution)

Microsoft,

7 29790

program to Reverse a linked list

Aricent, Microsoft, Ness Technologies,

12 59126

write a program to Insert in a sorted list

Microsoft,

4 14312

Program to Delete an element from a doubly linked list.

College School Exams Tests, Infosys,

4 33052

Write a function to find the depth of a binary tree.

Adobe, Amazon, EFI, Imagination Technologies,

13 88186

Write a routine that prints out a 2-D array in spiral order

Microsoft,

3 17218

Write, efficient code for extracting unique elements from a sorted list of array. e.g. (1, 1, 3, 3, 3, 5, 5, 5, 9, 9, 9, 9) -> (1, 3, 5, 9).

Intel, Microsoft, TCS,

13 37411

Given a list of numbers ( fixed list) Now given any other list, how can you efficiently find out if there is any element in the second list that is an element of the first list (fixed list)

Disney, Google, ZS Associates,

3 14031

Print an integer using only putchar. Try doing it without using extra storage.

2 20588

How to swap two variables, without using third variable ?

AB, ADP, BirlaSoft, Cisco, Cygnet Infotech, HCL, Hewitt, Honeywell, HP, IBM, Infosys, Manhattan, Microsoft, Mobius, Percept, Satyam, SofTMware, TCS, Wipro, Yamaha,

104 234899


Un-Answered Questions { Code Snippets }

write a program that creates a sequenced array of numbers starting with 1 and alternately add 1 and then 2 to create the text number in the series , as shown below. 1,33,4,6,7,9,............147,148,150 Then , using a binary search , searches the array 100 times using randomly generated targets in the range of 1 to 150

3485


write a program to calculate the amount of investment after a period n years if the principal investors was p and interest is calculated using compound interest,formular=a=p(1+r)^n

2596


can you use proc sql to manpulate a data set or would u prefer to use proc report ? if so why ? make up an example and explain in detail

2579


program to bring a window to the front

1772


Which keyword is alias for count keyword in php?

1830


output for printf("printf");

2212


code to positioning of window in certain dimensions

1867


how to diplay a external image of output on winxp by using c & c++,

3175


What is the best way to make wordpress plugin

2851


Hello Sir, Thanks for the Solution but, can you pls. Explain the coding for the Static Function & static variable from the below coding....waiting for Ans. class fact { public static void Main() { fact f=new fact(); int x=1; //Declaration of x as 1 int k=Convert.ToInt32(Console.ReadLine()); for(int i=1;i<=k;i++) { x= x *i; } System.Console.WriteLine(x); } }

2201


code to images to rollover

2035


In LSMW , what does the following error mean and how to rectify it : Incorrect interface data for set 78 in method C . This error is occuring in idoc processing step of LSMW.

2316


i don't know about working of nested for loop can any one help me

2018


Given a string=”me,I,myself”; .Using javascript only create an array out of this string and then send a POST request to the url “record.php” without reloading the page. The post key parameters should be n1,n2 and n3 respectively.

2770


create a .dll component operation and use created component in another project. required methods events and properties. connect, add,search,data report

2266