is a comprehensive book on getting a job at a top tech company, while focuses on dev interviews and does this for PMs.
CareerCup's interview videos give you a real-life look at technical interviews. In these unscripted videos, watch how other candidates handle tough questions and how the interviewer thinks about their performance.
Most engineers make critical mistakes on their resumes -- we can fix your resume with our custom resume review service. And, we use fellow engineers as our resume reviewers, so you can be sure that we "get" what you're saying.
Our Mock Interviews will be conducted "in character" just like a real interview, and can focus on whatever topics you want. All our interviewers have worked for Microsoft, Google or Amazon, you know you'll get a true-to-life experience.
<pre lang="" line="1" title="CodeMonkey57212" class="run-this"> import java.util.*;
- Anonymous May 10, 2011public class ListCollectionDemo {
public static void main(String[] args) {
if (args.length < 2) {
System.out.println("Usage: ListCollectionDemo hands cards");
return;
}
int numHands = Integer.parseInt(args[0]);
int cardsPerHand = Integer.parseInt(args[1]);
// Make a normal 52-card deck.
String[] suit = new String[] {
"Spades", "Hearts", "Diamonds", "Clubs" };
String[] rank = new String[] {
"Ace","2","3","4","5","6","7","8",
"9","10","Jack","Queen","King" };
List<String> deck = new ArrayList<String>();
// Create deck
for (int i = 0; i < suit.length; i++)
for (int j = 0; j < rank.length; j++)
deck.add(rank[j] + " of " + suit[i]);
System.out.println("The Deck:" + deck);
// Shuffle the deck.
Collections.shuffle(deck);
System.out.println("Shuffled Deck:" + deck);
if (numHands * cardsPerHand > deck.size()) {
System.out.println("Not enough cards.");
return;
}
for (int i=0; i < numHands ; i++)
System.out.println(ListCollectionDemoHand(deck, cardsPerHand));
System.out.println("Flop" + ListCollectionDemoHand(deck, 3));
System.out.println("Turn" + ListCollectionDemoHand(deck, 1));
System.out.println("River" + ListCollectionDemoHand(deck, 1));
}
public static <E> List<E> ListCollectionDemoHand(List<E> deck, int n) {
int deckSize = deck.size();
List<E> handView = deck.subList(deckSize - n, deckSize);
List<E> hand = new ArrayList<E>(handView);
handView.clear();
return hand;
}
}
</pre><pre title="CodeMonkey57212" input="yes">Program deals cards for poker - can be used for generic purpose
how many hands to deal = arg[0] = 5
how many cards per hand = arg[1] = 2</pre>