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 20655

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 14204

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

Fusion Systems GmbH,

6 9248

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

Microsoft,

8 9887

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 4356

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 17409

program to Reverse a linked list

Microsoft, Aricent, Ness Technologies,

12 43416

write a program to Insert in a sorted list

Microsoft,

4 7752

Program to Delete an element from a doubly linked list.

Infosys, College School Exams Tests,

4 22145

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

Amazon, Adobe, EFI, Imagination Technologies,

13 69012

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

Microsoft,

3 10957

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 18160

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 7225

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

2 10984

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 157021



Un-Answered Questions { Programming Code }

write a program in java to solve a system of n-variabled simultaneous equations using the guassian elimination method. let the maximum possible value of n be 100. run the program using hypothetical values for a set of 10- variables simultaneous equations. print out the program, the input equation and the results generated by the program.

2420


How to add a value from textBox over an existing certain column in SQL Server

1309


ArrayList declaration in .net

1703


output for printf("printf");

702


Definition of priority queue was given. We have to implement the priority queue using array of pointers with the priorities given in the range 1..n. The array could be accessed using the variable top. The list corresponding to the array elements contains the items having the priority as the array index. Adding an item would require changing the value of top if it has higher priority than top. Extracting an item would require deleting the first element from the corresponding queue. The following class was given: class PriorityQueue { int *Data[100]; int top; public: void put(int item, int priority); // inserts the item with the given priority. int get(int priority); // extract the element with the given priority. int count(); // returns the total elements in the priority queue. int isEmpty(); // check whether the priority queue is empty or not. }; We had to implement all these class functions.

3232


What is Generic" J2ME architecture?

782


1.What happens to a session object when the browser associated with it is closed? 2. Explain what happens when a servlet is sent a POST request? 3. Why does only one copy of a servlet get created? 4. Explain what happens when a browser requests a servlet? (for the first time) 5.How is information stored in a session object?

978


I have this code in leftmenu.ascx page..now on leftmenu.ascx.cs page i want to access id values. but i dont want to check manually like Accommodation,Arts etc.. In cs file my code is like string str[]; //this array contains some values say 10 strings for(i=0;i<100;i++) { if(str[i]==id id.visible=true } i.e.i want to travel for each element of str and each value of id.if they match then id.visible=true how to do?

2343


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

846


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

1017


I need your help, i need a Turbo C code for this problem.. hope u'll help me guys.? Your program will have a 3x3 array. The user will input the sum of each row and each column. Then the user will input 3 values and store them anywhere, or any location or index, temporarily in the array. Your program will supply the remaining six (6) values and determine the exact location of each value in the array. Example: Input: Sum of row 1: 6 Sum of row 2: 15 Sum of row 3: 24 Sum of column 1: 12 Sum of column 2: 15 Sum of column 3: 18 Value 1: 3 Value 2: 5 Value 3: 6 Output: Sum of Row 1 2 3 6 4 5 6 15 7 8 9 24 Sum of Column 12 15 18 Note: Your program will not necessary sort the walues in the array Thanks..

1443


What is the functionality of SendMessage?

305


design a class car having variables model, yr_of_manufacture, owner,reg_no. Design methods for assigning the values, Printing the values( you decide gui,control, any other methods if require)

1047


How to get Filename from Path?

273


how to take time as input in the format (12:02:13) from user so that controls remains between these columns?

889