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, Microsoft, TATA, HUP,

21 31037

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 18089

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

Fusion Systems GmbH,

6 13116




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

Microsoft,

10 15048

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 6888

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 22782

program to Reverse a linked list

Aricent, Microsoft, Ness Technologies,

12 48513

write a program to Insert in a sorted list

Microsoft,

4 10306

Program to Delete an element from a doubly linked list.

Infosys, College School Exams Tests,

4 28176

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

Adobe, Amazon, EFI, Imagination Technologies,

13 76305

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

Microsoft,

3 13661

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,

12 25112

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 10063

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

2 14352

How to swap two variables, without using third variable ?

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

104 178788







Un-Answered Questions { Code Snippets }

what is runtime class?

1376


i really need help about this.. write a program to display the set of odd and even numbers separately. find the highest and lowest value of the given numbers.

1262


How to get the version(major,minor,revision ) of VB6.0 delphi code .I am able to fetch dll file of vb6.0 but not vba file .Can u send me the code snippet in delphi to get the value for vb6.0.

2649


write a program for area of circumference of shapes

1262


write a program that reverses the input number of n.Formulate an equation to come up with the answer.

5980






function to combine two or more arrays

1063


We need to write the function to check the password entered is correct or not based on the following conditions.. a) It must have atleast one lower case character and one digit. b)It must not have any Upper case characters and any special characters c) length should be b/w 5-12. d) It should not have any same immediate patterns like abcanan1 : not acceptable coz of an an pattern abc11se: not acceptable, coz of pattern 11 123sd123 : acceptable, as not immediate pattern adfasdsdf : not acceptable, as no digits Aasdfasd12: not acceptable, as have uppercase character

3277


plz send code for Ecorps in j2ee frontend:J2EE Backend: DB2 Express

1741


why nlogn is the lower limit of any sort algorithm?

1438


Code to Block submission of form by pressing Enter Key

1508


U hv to enter a range from a and b and search hw many no. of times a pattern n. occurs between the range a and b. Eg :i/p:enter range :0 100 Enter pattern: 13 o/p: the no. times 13 occurred betwwn 0 to 100:1 Eg :i/p:enter range :100 1000 Enter pattern: 13 o/p: the no. times 13 occurred betwwn 100 to 1000: (in this 13,113,131,132,133…139,213,313,…913 all these will be counted)

1443


an on-line examination application using html jsp servlet and jdbc. including session management and cookies

3566


Give the code for Handling Mouse Events?

1261


Write a simple encryption program using string function which apply the substitution method.

4446


write a simple calculator c program to perform addition, subtraction, mul and div.

2363