Deloitte Silicon Valley Fast 50
Deloitte Fast 500
Red Herring
Forbes Best of the Web
Inc 500
San Jose Business Journal 50 Fastest Growing Companies
  
Jobs: Engineering

To apply for a development position at Nextag you can take the conventional route and mail your resume to 'resume' at nextag.com and then come in for a test and interview. Or you can solve the programming problem described below to prove your talent even before the interview.

Programming Problem

Given a deck of nCards unique cards, cut the deck iCut cards from top and perform a perfect shuffle. A perfect shuffle begins by putting down the bottom card from the top portion of the deck followed by the bottom card from the bottom portion of the deck followed by the next card from the top portion, etc., alternating cards until one portion is used up. The remaining cards go on top. The problem is to find the number of perfect shuffles required to return the deck to its original order. Your function should be declared as:

    static long shuffles(int nCards,int iCut);

Please send the result of shuffles(1002,101) along with your program and your resume to 'resume' at nextag.com.