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,

20 28054

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 17095

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

Fusion Systems GmbH,

6 12027




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

Microsoft,

10 13476

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 6196

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 21229

program to Reverse a linked list

Microsoft, Aricent, Ness Technologies,

12 47126

write a program to Insert in a sorted list

Microsoft,

4 9644

Program to Delete an element from a doubly linked list.

Infosys, College School Exams Tests,

4 26831

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

Amazon, Adobe, EFI, Imagination Technologies,

13 74596

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

Microsoft,

3 12986

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 23399

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 9316

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

2 13325

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 173031









Un-Answered Questions { Code Snippets }

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

2243


write a c program to input initial & final time in the format hh:mm and find the time intervel between them? Ex inputs are initial 06:30 final 00:05 and 23:22 final 22.30

1175


What is the functionality of EnumWindows?

374


why nlogn is the lower limit of any sort algorithm?

1275


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?

1086






write a program to perform generic sort in arrays?

1568


Develop a routine to reflect an object about an arbitrarily selected plane

1736


Write a (n) algorithm that sorts n distinct integers, ranging in size between 1 and kn inclusive, where k is a constant positive integer. (Hint: Use a kn-element array.)

3157


code to set the main window's size

963


Hey, any expert here can help me to creat php code. I want php code to calculate like below. input :12 April 1974 then perform this calculation: 12 + 4 + 1974 = 1990 1 + 9 + 9 + 0 = 19 1 + 9 = 10 1 + 0 = 1(final answer) this code i just want to used to share the personality from date of birth. The input come from user, base on user input, then php will calculate like above, and, the final answer will use do display the person attitude. example, final answer = 1, display patient person final answer = 2, will display hard working person

1520


how to create a search bar which access data from various websites and retrieves the data

1647


Design a timer circuit using VHDL which has the following: input : start_timer(ST) output: long_time(LT) short_time(ST) when the timer is triggered by the ST(either 0 or 1) signal the timer should generate two timing signals accordingly.While the long time is going ON the other should be OFF and vice versa.

1385


c# code to Count number of 1's in a given range of integer (0 to n)

3406


how to determine which Mouse Button was pressed

1073


Write a program to convert postfix expression to infix expression.

3251