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 34359

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 18961

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

Fusion Systems GmbH,

6 14297




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

Microsoft,

10 16601

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 7501

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 24110

program to Reverse a linked list

Microsoft, Aricent, Ness Technologies,

12 50075

write a program to Insert in a sorted list

Microsoft,

4 11056

Program to Delete an element from a doubly linked list.

Infosys, College School Exams Tests,

4 29155

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

Amazon, Adobe, EFI, Imagination Technologies,

13 77897

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

Microsoft,

3 14290

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 26888

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 10776

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

2 15123

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 186044







Un-Answered Questions { Code Snippets }

write a program that prompt the user to enter his height and weight,then calculate the body mass index and show the algorithm used

3788


Write a python program to find the second largest number in a list?

51


What is the functionality of FindWindow?

484


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)

1398


code to detect availability of cookies

1346






Write a program to find sum of the digits of a number in python?

52


Write a python program to check if a number is a perfect number?

56


How to Link Different Data Sources Together?

1253


Who could write how to find a prime number in dynamic array?

1447


How to Check if Folder Exists?

481


What are the benefits of XML?

24


write a program that can LOCATE and INSERT elements in array using c++ programming languages.

2854


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

1816


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

3733


#include int main(void) { int a=4, b=2; a=b<>2 ; printf("%d",a); return 0; }

350