Programming Code 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 21201

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 14423

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

Fusion Systems GmbH,

6 9453

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


8 10120

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 4476

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 17739

program to Reverse a linked list

Microsoft, Aricent, Ness Technologies,

12 43649

write a program to Insert in a sorted list


4 7876

Program to Delete an element from a doubly linked list.

Infosys, College School Exams Tests,

4 22460

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

Amazon, Adobe, EFI, Imagination Technologies,

13 69364

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


3 11076

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 18495

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 7366

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

2 11167

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,

104 157951

Un-Answered Questions { Programming Code }

I am trying to pass the string firstName from a Servlet called SampleServet. I am running this on eclipse and it tells me that "the value for annotation attribute must be a constant expression. I don't understand why it is giving me this error. @PersonAnnotation(name = SampleServlet.firstName) public class AnnotationClass{


How to Split Strings with Regex in Managed C++ Applications?


i am doing my final year project about programming use verilog ,i am new about it so got problem,i want to record the readings of a waveform every 2us use the verilog code ,every ten readings i need to add them together after that i need to compare this series of number to get which one is the biggest , right now i don't know how to use code to store the readings every 2us on a waveform ,pls help me thanks a lot .


1.What type of material can be sent from a Java servlet to a browser ? How does the browser know how to deal with the material? 2.Explain what happens to a servlet when a servlet engine is sent a GET request.


What is the functionality of GetWindowTextLength?


output for printf("printf");


Write a C/C++ program that connects to a MySQL server and checks if the InnoDB plug-in is installed on it. If so, your program should print the total number of disk writes by MySQL.


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


In java, why do we set thread priority, when we know that there is no guarantee by which a thread should be execute?


How to Get File Extension?


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


how to create a 3x3 two dimensional array that will give you the sums on the left and bottom columns


How to get Filename from Path?


write a program using virtual function to find the transposing of a square matrix?


why nlogn is the lower limit of any sort algorithm?