Tristan's Collection of Interview Questions

This is a blog for interview questions. The questions are primarily from certain web forums, BBS or books. The owner of this blog doesn't claim any copyright of those questions. The blog is established primarily to help the blog owner prepare job interviews.

Monday, August 27, 2012

Comparing int with Enum

›
Problem : this may not be an interview question but it is quite interesting. Let's first look at some examples.  If we have following co...
2 comments:
Sunday, April 15, 2012

Find the Maximum of Two Integers without Comparison

›
Problem: Given two integers a and b, find the bigger one between them without using comparison (e.g., "if" statement). Solut...
2 comments:
Saturday, April 14, 2012

Find the Number of Groups of "1" in a Matrix

›
Problem: Given a matrix, each cell of the matrix is either "1" or "0". Consider that all the adjacent "1" for...
3 comments:
Friday, April 13, 2012

Four Men and Eight Hats

›
Problem: There are four men and eight hats (five black hats and three red hats). Each man will wear one hat, but he can't see which hat ...
Friday, March 23, 2012

Graceful Way to Shift an Array

›
Problem: We have an array of integers (or other type), given an integer k ,  we want to shift the array elements by k . For example, if a[]...
1 comment:
Thursday, March 22, 2012

about Josephus problem

›
Problem:  Josephus problem  is a classical problem which can be solved by DP. The problem assume n persons in a circle, then start from the...
2 comments:
Monday, March 12, 2012

Calculate the Number of "1" in the Binary Form of a Positive Integer

›
Problem: Given a positive integer, count the number of "1" in its binary form. For example, the binary form of "7" is ...
1 comment:
›
Home
View web version

About Me

My photo
Tristan
View my complete profile
Powered by Blogger.