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.
hope it helps~
- liujylizf October 06, 2013import java.util.concurrent.CountDownLatch;
public class Sum {
public static Integer sum=new Integer(0);
/**
* @param args
*/
public static void main(String[] args) {
int[] arr = new int[100];
for (int i = 0; i < arr.length; i++) {
arr[i] = 1;
}
int threads = 3;
CountDownLatch count = new CountDownLatch(threads);
int length = arr.length;
int num = length/threads;
for (int i = 0; i < threads-1; i++) {
new Thread(new SumPart(arr, num*i, (num*(i+1))-1, count)).start();
}
new Thread(new SumPart(arr, (threads-1)*num, length-1, count)).start();
try {
count.await();
} catch (Exception e) { }
System.out.println(sum);
}
}
class SumPart implements Runnable{
private CountDownLatch countDownLatch;
private int[] arr = null;
private int start,end=0;
public SumPart(int[] arr, int start, int end, CountDownLatch countDownLatch) {
this.arr = arr;
this.start = start;
this.end = end;
this.countDownLatch = countDownLatch;
}
@Override
public void run() {
while (start<=end) {
Sum.sum = Sum.sum+arr[start++];
}
countDownLatch.countDown();
}
}