Code Snippets Interview Questions

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.

23035

Write a routine to draw a circle (x ** 2 + y ** 2 = r ** 2) without making use of any floating point computations at all.

15020

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

10136

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

10866

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.

4836

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)

18728

program to Reverse a linked list

44458

write a program to Insert in a sorted list

8294

Program to Delete an element from a doubly linked list.

23483

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

70520

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

11518

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).

19786

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)

7821

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

11782

How to swap two variables, without using third variable ?

161831

Un-Answered Questions { Code Snippets }

How to Get File Extension?

305

Given a string=”me,I,myself”; .Using javascript only create an array out of this string and then send a POST request to the url “record.php” without reloading the page. The post key parameters should be n1,n2 and n3 respectively.

1530

How can you relate the function with the structure? Explain with an appropriate example.

1594

what full form name of B.K.U.

1416

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?

2428

What is the functionality of GetWindowTextLength?

367

844

Bubble Sort. java thereafter the user will be asked to inpout the size of the list,sort the list in ascending order and display the sorted list in a horizontal manner???

1377

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

1357

find out the list of users who have access to all t-codes starts with 'SU'? thanks in advance all.

1087

How can restrict user to type upto 8 characters in textbox in php?

717

how to Auto Scroll the page

790

Code for Small C++ Class to Transform Any Static Control into a Hyperlink Control?

1585

write a simple calculator c program to perform addition, subtraction, mul and div.

1907

write a program in java to find the moving average of all prime numbers between 2 and 100.

2286