Interesting :-
Programming Puzzles - Job Interview Puzzles
Some companies certainly ask for these things. Specially Microsoft. Here are my favorite puzzles. Don't send me emails asking for the solutions.
- Write a "Hello World" program in 'C' without using a semicolon.
- Write a C++ program without using any loop (if, for, while etc) to print numbers from 1 to 100 and 100 to 1;
- C/C++ : Exchange two numbers without using a temporary variable.
- C/C++ : Find if the given number is a power of 2.
- C/C++ : Multiply x by 7 without using multiplication (*) operator.
- C/C++ : Write a function in different ways that will return f(7) = 4 and f(4) = 7
- Remove duplicates in array
- Finding if there is any loop inside linked list.
- Remove duplicates in an no key access database without using an array
- Convert (integer) number in binary without loops.
- Write a program whose printed output is an exact copy of the source. Needless to say, merely echoing the actual source file is not allowed.
- From a 'pool' of numbers (four '1's, four '2's .... four '6's), each player selects a number and adds it to the total. Once a number is used, it must be removed from the pool. The winner is the person whose number makes the total equal 31 exactly.
- Swap two numbers without using a third variable.
- Given an array (group) of numbers write all the possible sub groups of this group.
Good questions...
ReplyDeletelike it..