Archive for the ‘Companies’ Category

Microsoft contests Information

Thought of sharing information about ongoing contests.

1. Microsoft High Performance Computing Scholars program

Prizes: Student Awards of $1000 and Faculty Research Grants worth  $5,000, many more prizes can be avaialed just by registering.

Target Audience: All undergraduate, postgraduate, diploma and training students (along with supervising Faculty) of India.

Duration of contest: 15th May 2007 to 30th June 2007

2. Win 1 in 3 copies of Microsoft Expression Studio Commemorative Editions

Prizes: Microsoft Expression Studio Commemorative Editions

Target Audience: General

Duration of Contest: Running..till 6th of July 2007

3. Win with Windows

Prizes: Cafe coffee day vouchers.

Target Audience: General

Duration of Contest: July 2 to July 14, 2007

4. Project Shutter Photo Contest!

Microsoft has initiated a Photography Contest – the Project Shutter Photo Contest! This is aimed at enthusiasts with an eye for photogenic visuals across three themes that best represent the individual’s locality – Food, Culture and Architecture. There are tons of goodies up for grabs, including a T-Shirt every 30-minutes through the next 12 days.

Be sure to check out their gallery to find some of coolest pics.

Good Luck! 

Puzzle 1 : Take a chill pill!

This is one of the Microsoft interview questions, should be easier to answer as writing a code is not required. 🙂

“You have 5 jars of pills. Each pill weighs 10 gram, except for contaminated pills contained in one jar, where each pill weighs 9 gm. Given a scale, how could you tell which jar had the contaminated pills in just one measurement?”

By scale I mean a digital weight measuring machine.

SOLUTION:

1. Mark the jars with numbers 1, 2, 3, 4, and 5.
2. Take 1 pill from jar 1, take 2 pills from jar 2, take 3 pills from jar 3, take 4 pills from jar 4 and take 5 pills from jar 5.
3. Put all of them on the scale at once and take the measurement.
4. Now, subtract the measurement from 150 ( 1*10 + 2*10 + 3*10 + 4*10 + 5*10)
5. The result will give you the jar number which has contaminated pill.

Algortihm Challenge 1: No division!

I have decided to come up with series of challenges n problems which are algorithmic in nature and are asked in interviews of reputed companies like Microsoft, Google.

This one was asked in a Google interview recently. Try to answer it in your comments. I will post the solutions if no one comes up with the right answer (let’s hope not).

“You have an unordered array X of N integers. Find the array M containing N elements where M_i is the product of all integers in X except for X_i. You may not use division. You can use extra memory.

What is the best way of doing this?”

Example:

N=4

X = {2, 5, 3, 7}

M_0 = 5*3*7 = 105

M_1 = 2*3*7 = 42

M_2 = 2*5*7 = 70

M_3 = 2*5*3 = 30

M = {105, 42, 70, 30}

(hint: There are solutions faster than O(N^2))

NOTE: while posting solution put your code (if any) inside <code></code> tags.


SOLUTION:
Thanks for your efforts. The solution presented here runs in O(N) time. Yes O(N), and thats what an interviewer would expect you to come up with, in less than an hour.

Form two arrays P and Q such that
P[1] = 1
P[i] = X[1] * X[2] * … * X[i-1] for 1 < i <= N
 
and
 
Q[i]  = X[i+1]*X[i+2]*… * X[N] for 1 <= i < N
Q[N] = 1
 
Set M[i] = P[i]*Q[i]
 
Both P and Q (i.e. M) can be found in O(N) time.

Once can access corresponding code snippet here.

Windows : Map a Path to a Drive letter

Ever wondered if you could assign your favorite directories lying deep under a large chain of directories, as seperate drives?

This post is going to tell you how to refer to a path like “D:\workspace\topcoder\development\javaprojects\” as simply “T:”

First let me tell you the manual way of doing it using the command prompt.

Suppose the path is “D:\workspace\topcoder\development\javaprojects\” and we want it to map to a drive letter say “T:”, then all we need to do is to open the command prompt and type the following command.

subst T: "D:\workspace\topcoder\development\javaprojects\"

Now, instead of typing the full path, you can reach this directory by typing the letter of the virtual drive, followed by a colon, as follows:

T:

You will see that a new drive entry is created under your “My Computer” as “T:” which maps to the desired folder. After doing this we can refer to a path like “D:\workspace\topcoder\development\javaprojects\ProjectABC” as simply “T:\ProjectABC\”

If you want to delete this drive then just issue the following command.

subst T: \d

Points to remember:

  1. This is not a permanent mapping as the mapping will be lost after you restart windows or log off. (You can create a batch file for this and put it on startup to have your drive everytime you log on to windows. Read further to know how to avoid this.)
  2. The commands like chkdsk, diskcomp, diskcopy, fomrat, label and recover, do not work and should not be used on drives created with subst command.
  3. To see more details of the command. Type: subst /?

Now, for the people who hate command line stuffs, there’s a nice little tool available called Visual Subst. It uses the API similar to the console ‘subst’ utility, but makes it easier to create and remove virtual drives in a GUI way. This tool also allows you to persist the virtual drive mapping on windows restart.

Note: This works with Windows 2000/XP as well as Windows Vista platforms.

Extra Note (Added for my own safety) : I am not responsible if anything goes wrong, while trying out the commands or softwares presented here.

Searching for faces

Some upcoming technology for you: Google face-search technology is now available for use.

Google’s face search allows you to narrow down your image-search to only those images that contain faces. Having tried it out for a few search terms, I can say that it works pretty well to the extent that the returned images indeed have faces in them. However, it seems to miss a few valid images. On the face of it (pun unintended) it seems as if images containing smaller or many faces seem to go unrecognized.

To actually perform a face-search, do a normal image search at http://images.google.com and then add &imgtype=face to the end of the URI in the address-bar. There seems to be no direct link to use this feature at the moment.

UPDATE: Check out this article on ars technica related to this post.