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

21 33296

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 18711

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

Fusion Systems GmbH,

6 13916

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


10 16117

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.


2 7319

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)


7 23708

program to Reverse a linked list

Microsoft, Aricent, Ness Technologies,

12 49540

write a program to Insert in a sorted list


4 10806

Program to Delete an element from a doubly linked list.

Infosys, College School Exams Tests,

4 28881

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

Amazon, Adobe, EFI, Imagination Technologies,

13 77349

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


3 14069

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 26281

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 10560

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

2 14885

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 183395

Un-Answered Questions { Code Snippets }

how to create an anonymous function


What is SGML?


Implement a command console for changing settings on a particular object. The command console should allow you to enter a string and will return the response (very similar to a terminal session). The commands are as follows: SET propertyname=newvalue will change the target object’s member named “propertyname” to have a value equal to “newvalue”. If the input value is incompatible (i.e. an int being set to a string), print out an appropriate error message. GET propertyname will print out the current value of the target object’s member named “propertyname”. GET * will print out a list of all target object members and their current values. The system should be extensible for future commands and should accept an arbitrary object, such that another developer could insert another object into the system and rely on the command console to get and set the properties correctly.


Can you send Code for Run Length Encoding Of BMP Image in C Language in linux(i.e Compression and Decompression) ?


write a program that reads a series of strings and prints only those strings begging with letter "b"


Can I execute a XML?


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???


Write a python program to count the number of vowels in a string?


I'm calling a JS fcn that fires AJAX to a webmethod and returns a boolean. How do I retrieve the return value in the codebehind? (VB) I can set a hiddenfield value in the JS, but if it's async how can my VB know when it's changed?


What are the special characters used in XML?


Coding for Synchronizing Cache Access in ASP.NET?


Code to Block submission of form by pressing Enter Key


i have some csv files in a directory which have sub-directories also. now how can i merge all .csv files in to one with a single header. for example: have some 4 files. 1.csv--------name,age,sal abc,25,4000 2.csv--------name,age,sal vgd,32,3500 3.csv--------name,age,sal hfg,20,5000 4.csv--------name,age,sal asd,15,2000 now my output file should be like 5.csv----------name,age,sal abc,25,4000 vgd,32,3500 hfg,20,5000 asd,15,2000 and please explain the code for me. as i am new to scripting. thank you in advance


What is Generic" J2ME architecture?


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