Puzzle CornerSign In
HomeFeedbackBlogResourcesAbout
Starred
Add Question
All (696)
coding (266)
c++ (157)
algorithms (151)
puzzle (134)
CS Fundamentals (83)
oop (55)
arrays (45)
internet (40)
string (34)
math (31)
databases (28)
system (26)
probability (26)
networking (25)
linkedlist (24)
binarytrees (24)
tree (22)
bit manipulation (19)
sorting (11)
stack (10)
bst (9)
java (8)
xml (8)
sql (7)
next in series (7)
traversal (6)
graph (4)
debugging (4)
lateral thinking (4)
palindrome (4)
mysql (4)
prime (4)
general (4)
unix (3)
CGI (3)
duplication (3)
threading (3)
random (3)
search (3)
fibonacci (3)
encryption (3)
joins (3)
hash (3)
queue (3)
asm (3)
design patterns (2)

next »

Random
Array problem[2007-02-26 23:42:19]   
Given a set of n real numbers, a real number t, and an integer , how quicly can you determine whether there exists a k-element subset of the set that sums to at most t?
linkAuthor:premTags: arraysAnswer

Matched sequences[2007-05-29 04:26:59]   
Matched sequence is like {}[(fd)()]. Unmatched sequence is like [{]}. Give a function to find if a given sequence is matched. Test your function.
linkAuthor:premTags: c++Answer

Triangle area mismatch problem[2008-10-02 08:08:42]   

Both triangles contain the same pieces, albeit arranged differently. How come the upper triangle is larger by one square?
linkAuthor:premTags: puzzle2 CommentsAnswer

Minimal vertex set[2008-09-08 19:40:44]   
Given a graph (any type - Directed acyclic graph or undirected graphs with loops), find a minimal set of vertices which affect all the edges of the graph. An edge is affected if the edge is either originating or terminating from that vertex.
linkAuthor:premTags: algorithms | coding | c++1 CommentAnswer

Sum of the most common element in an array[2008-09-08 19:39:30]   
Find the sum of the most common element in an array. Example: A[]={12,23,24,89,78,76,24} OutPut:48
linkAuthor:premTags: algorithms | coding | arrays | c++1 CommentAnswer

Triangle problem[2008-06-24 23:31:30]   
given a triangle ABC, how would you use only a compass and a straight edge to find a point P such that triangles ABP, ACP & BCP have equal perimeters?(Assume that ABC is constructed so that a solution does exist)
linkAuthor:premTags: puzzle | math1 CommentAnswer

[2008-06-24 23:28:10]   
# Say we have a data structure as follows: enum {RED,BLUE,GREEN}; struct Ball { /*...*/ int color; }; int ColorOfBall(Ball b) { return b.color; } Ball arr[SIZE]; The array arr consists of balls of with one of the three colours (Red,Green,Blue). Now we need to sort the array in such a way that all the Red coloured balls come first, followed by blue and then green. The restriction is that call to function ColorOfBall is a very costly operation. You have to use it as less as possible. (In other words we would be looking for the solution with least number of calls to the function ColorOfBall.)
linkAuthor:premTags: coding | arrays | c++ | sortingAnswer

Preorder traversal[2008-04-04 00:38:02]   
Write a c code (both recursive & non recursive) to do preorder traversal of a binary tree
linkAuthor:premTags: algorithms | coding | c++ | tree | CS Fundamentals1 CommentAnswer

Minimum possible races[2008-03-14 11:29:29]   
There are 25 horses and 5 lanes. You have no idea about which horse is better than other. Find in minimum possible races, the first three fastest running horses.
linkAuthor:premTags: puzzleAnswer

What is the age of my children?[2008-03-13 18:29:30]   
Mr. X meet Mr. Y during an early morning walk. Mr Y asks the age of Mr. X\'s children and Mr. X is a math professor so gives Mr Y a problem to solve. Mr X says -> I have 3 children -> The product of their ages is 36 -> The sum of their age is equal to the number of houses in my street. -> And my first daughter has blue eyes. Using these clues Mr Y was able to say the ages of the 3 children.
linkAuthor:premTags: puzzle | lateral thinking | math4 CommentsAnswer

Lucky Vs Unlucky Number[2008-03-13 18:28:26]   
In Russia you get into a bus, take a ticket, and sometimes say : Wow, a lucky number! Bus tickets are numbered by 6-digit numbers, and a lucky ticket has the sum of 3 first digits being equal to the sum of 3 last digits. When we were in high school (guys from math school No. 7 might remember that ) we had to write a code that prints out all the lucky tickets\' numbers; at least I did, to show my loyalty to the progammers\' clan. Now, if you add up all the lucky tickets\' numbers you will find out that 13 (the most unlucky number) is a divisor of the result. Can you prove it (without writing a code)?
linkAuthor:premTags: puzzle | mathAnswer

Bank card fraud[2007-11-03 05:31:52]   
A bank has a collection of n bank cards that they€™ve confiscated, suspecting them of being used in a fraud. Each bank card corresponds to a unique account in the bank. Each account can have many cards corresponding to it, and we€™ll say that two bank cards are equivalent if they correspond to the same account. The only way to say 2 cards are equivalent is by using a high-tech €œequivalence-tester€ that takes in 2 cards, and after performing some computations, determines whether they are equivalent. Their question is the following: among the collection of n cards, is there a set of more than n/2 of them that are all equivalent to one another? Assume that the only feasible operations you can do with the cards are to pick two of them and plug them in to the equivalence tester. Answer in O(n)
linkAuthor:premTags: puzzle | math2 CommentsAnswer


next »




Created by Premchand Jayamohan