Monthly Archives: February 2013

Interview brainteaser asked at Google

Problem. You are in the room with n computers. Some of them are good, and some of them are bad. You can query any computer about the status of any computer in the room. Good computers will always tell you … Continue reading

Posted in Interview, Math | Tagged , | Leave a comment

Popular computer science interview question: thieves locking treasure in cryptographic way :)

This problem is quite common in interviews with people coming from computer science background. The problem is from some famous paper on cryptography. Problem. 7 thieves stole treasure. They would like to place N locks on it. Each lock can … Continue reading

Posted in Interview, Math | Tagged , , | Leave a comment

C++: some simple pointer arithmetic

What will be the output of the following code: Correct answer is: 1001 2002 3004 Because of the following table: char : 1 byte short : 2 bytes int : 4 bytes long : 4 bytes float : 4 bytes … Continue reading

Posted in C++, Interview, Programming | Tagged , , | Leave a comment

Things I was never aware of: C++. Comma operator.

In C++ comma “,” can be used in two ways. First, as an operator: expression1,expression2 Evaluation is from left to right. Expression on the left is evaluated first. Expression on the right is evaluated second giving the result of the … Continue reading

Posted in C++, Interview, Programming | Tagged , , | Leave a comment

Binary Search Trees

Binary search tree is one of the most often used data structure in computer science. It seems that computer science people like asking about BST and its algorithms in job interviews. The following are advantages of binary search trees (summarized … Continue reading

Posted in C++, Interview, Programming | Leave a comment

Mounting memory card on Ubuntu

sudo fdisk -l sudo mount -t vfat /dev/mmcblk1p1 /media/external

Posted in Bash, UNIX/Linux | Leave a comment

Interview questions on Perl

What is the difference between my and local? my creates a new variable; local temporarily amends the value of a variable. Example: “local temporarily changes the value of the variable, but only within the scope it exists in.” Use my … Continue reading

Posted in Interview, Perl, Programming, Uncategorized | Leave a comment