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.

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

20 26082

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

Microsoft, Mentor Graphics,

2 16246

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

Fusion Systems GmbH,

6 11286




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

Microsoft,

10 12400

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 5683

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 20177

program to Reverse a linked list

Microsoft, Aricent, Ness Technologies,

12 46125

write a program to Insert in a sorted list

Microsoft,

4 9183

Program to Delete an element from a doubly linked list.

Infosys, College School Exams Tests,

4 25503

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

Amazon, Adobe, EFI, Imagination Technologies,

13 73061

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

Microsoft,

3 12439

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).

TCS, Intel, Microsoft,

12 22156

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 8753

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

2 12776

How to swap two variables, without using third variable ?

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

104 169406







Un-Answered Questions { Code Snippets }

Cluster head selection in Wireless Sensor Network using C programming language.

1709


How to call JavaScript Function from Code-behind in asp.net?

386


Give me some tips in c#?

1332


Find out the list of roles which gives access to all t-codes in SAP? Thanks in advance.

1143


Can we run Applet in Web browser with security policy files

1221


How to Check if Folder Exists?

372


how to pass data between pages using Cookies

936


create a stucture student containing field for roll no,class,year and marks.create 10 student annd store them in a file

1259


create Drop-Down Navigation Menus

937


What is the functionality of SendMessage?

418


I have a file which contains so many lines and variable number of lines are treated as a record. For example *first ooooo xxxxx ttttt mmmm vvvvvvv *end uuu bbbb *first kkkkvvvvvv nnnn mmmmm kkkkk fffff gggg ffff kkkk lllll *end. Here the lines from *first to *end are treated as a record. The number of lines between *first and *end is not same for all the records. Suppose there are 100 records (or number of records are not predefined)like the format given in the above example. Now the entire file needs to split into two files, first having 40 and remaining in the second file. Can we split using sort utility? If possible then what is the sort card?

1028


Write a function that takes an array of integers and returns that array rotated by N positions. For example, if N=2, given the input array [1, 2, 3, 4, 5, 6] the function should return [5, 6, 1, 2, 3, 4]

650


Bubble Sort. java thereafter the user will be asked to inpout the size of the list,sort the list in ascending order and display the sorted list in a horizontal manner???

1488


How do you verify if the two sentences/phrases input is an anagram using predefined functions in string.h and by using arrays?

910


write a function that allocates memory for a single data type passed as a parameter.the function uses the new operator and return a pointer to the allocated memory.the function must catch and handle any exception during allocation

1256