1.
You are given a suit of playing cards, 13 cards—Ace through King. For the purpose of this game, consider the Ace as being worth 1, Jack 11, Queen 12 and King 13.
You are to divide the 13 cards into 2 face-down piles: a pile of 6 and a pile of 7.
Each pile is then shuffled thoroughly.
The top card from each pile is flipped and their product is calculated.
This process is then repeated 5 more times, until only one card from the pile of 7 remains face down.
The 6 products are summed up.
How do you divide the deck to maximize the expected sum of the products?
2.
There is a lie detector which can detect lies with 90% accuracy. (If a person lies, the machine will beep 90% of the time, and if a person tells the truth it will stay silent 90% of the time.) Suppose that 85% of people tell the truth.
If a person answers a question and the machine beeps, what is the probability that they are telling the truth?
3.
How many distinct ways are there to rearrange the letters in the word ‘REARRANGE’?
What if the N and the G always had to be adjacent?
4.
Let x1, x 2, x 3… x 8 be a permutation of the integers 1, 2, 3, …, 8. For each permutation, form the sum
| x 1 – x 2| + | x 3 – x 4| + | x 5 – x 6| + | x 7 – x 8|
Find the average value of all such sums.
5.
You are receiving data over a network. Packets are supposed to arrive once per millisecond. Occasionally, there is a pause of about 200 milliseconds between arrivals. What might be causing that latency? (Do not spend more than two minutes on this question.)
6.
Describe a parallel (multi-threaded) implementation of QuickSort that runs on a computer with n processors.
7.
You are debugging on an Intel x86 processor. You are looking at the following line of 16 bytes of memory dump. The values are displayed in hexadecimal notation.
0x004b56a0 56 4f 50 55 00 00 00 00 00 00 00 00 00 00 00 00 00
What data type do you think is at address 0x004b56a0?
What would the above line of memory look like if the integer 65538 was written to memory location 0x004b56a8?
9FFEA
8.
What is the purpose of each of the following C# functions?
static public double Calc(long n)
{
long z = 0;
for (long x = -n; x for (long y = -n; y if (x * x + y * y z++;
return ((double)z) / (n * n)
}
static public double Calc(int n)
{
double x = 1;
double y = 1;
for (int j = 1; j {
y = y * n / j;
x += y;
}
return x;
}