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 30179

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 17846

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

Fusion Systems GmbH,

6 12823




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

Microsoft,

10 14560

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 6691

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 22353

program to Reverse a linked list

Microsoft, Aricent, Ness Technologies,

12 48054

write a program to Insert in a sorted list

Microsoft,

4 10101

Program to Delete an element from a doubly linked list.

Infosys, College School Exams Tests,

4 27828

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

Amazon, Adobe, EFI, Imagination Technologies,

13 75796

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

Microsoft,

3 13450

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 24592

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 9840

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

2 14094

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 176957







Un-Answered Questions { Code Snippets }

How to palindrom string in c language?

5497


Using C# Write a program that performs the following. The user inputs a number and then enters a series of numbers from 1 to that number. Your program should determine which number (or numbers) is missing or duplicated in the series, if any. For example, if the user entered 5 as the initial number and then entered the following sequences, the results should be as shown. Input Sequence Output ---------------------- --------------- 1 2 3 4 5 Nothing bad However, if 7 were the high number, the user would see the results on the right for the following number entries: Input Sequence Output ---------------------- --------------- 1 3 2 4 5 Missing 6 Missing 7 And if 10 were the high number and the user entered the numbers shown on the left, note the list of missing and duplicate numbers: Input Sequence Output ---------------------- --------------- 1 2 4 7 4 4 5 10 8 2 6 Duplicate 2 ( 2 times) Missing 3 Duplicate 4 ( 3 times ) Missing 9 The program should check the high number that the user inputs to ensure that it does not exceed the size of any array you might be using for storage.

2747


How to Bind Nested XML to a Repeater Control with Container.DataItem?

2450


Code for using a Hot Key in an ActiveX Control?

1252


how to remove or delete multiple selected items from listbox in on button click in asp?

468






Give me some tips in c#?

1482


write a java program to create a Frame with three scrolls, change the back ground color of the frame using functions with values of scrolls.

3371


i want run following code on button click of view. i am trying to retrieve data from isc_order_details table and isc_product table. but after retriaval of data i m getting error like FIELD MUST BE ENTERED!! DECLARE m number; n number; CURSOR order_details IS SELECT PRODUCT_ORDER_QUAN,PRODUCT_ID FROM isc_order_details WHERE order_id=:isc_order_master.order_id; amount NUMBER (8,2):=0.0; alert number; BEGIN go_block('isc_order_details'); first_record; m:=:system.cursor_record; last_record; n:=:system.cursor_record; OPEN order_details; --for i in m..n loop FETCH order_details INTO :ISC_ORDER_DETAILS.PRODUCT_ORDER_QUAN,:ISC_ORDER_DETAIL S.PRODUCT_ID; IF order_details%FOUND THEN SELECT order_value,order_date INTO :ISC_ORDER_MASTER.ORDER_VALUE,:ISC_ORDER_MASTER.ORDER_D ATE FROM isc_order_master WHERE order_id=:ISC_ORDER_MASTER.ORDER_ID; SELECT product_desc,product_price INTO :ISC_ORDER_DETAILS.PRODUCT_DESC,:ISC_ORDER_DETAILS.PROD UCT_PRICE FROM isc_product WHERE product_id=:ISC_ORDER_DETAILS.PRODUCT_ID; next_record; END IF; EXIT WHEN order_details%NOTFOUND; END LOOP; last_record; CLOSE order_details; EXCEPTION when NO_DATA_FOUND then alert:=SHOW_ALERT('ENTER_DATA'); Go_Item('isc_order_master.order_id'); END;

1224


Please give me the vb.net codes for deadlock(like detecting,& avoiding) in any version of vb.net.

2529


Code for IP Address Comparison and Conversion in C#?

3280


I am attempting to work on a game panel with multi-server support, so in one of the pages there is a dropdown menu with servers on it, this is the part i am having issues with is server 1 is chosen i need access to the username running a script to server 1 chosen i need a script that will realize its been chosen and pop up below with a username thats associated with it because the users differ on each server so i choose server 1 i need a code to pull from the db and choose the user associated with the said server please help..

1551


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

1310


How to Check if Folder Exists?

413


A suduco given & u hv 2 check if it is incomplete(blanks left),or correct or incorrect

1574


How to check if Folder is a Special Shell Folder ?

384