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.
public class PrintSeries0102030405 {
- Pk October 08, 2017public static void main(String[] args) throws Exception {
Print0 print0 = new Print0();
PrintEven even = new PrintEven(print0);
PrintOdd odd = new PrintOdd(print0);
Thread thread1 = new Thread(print0);
Thread thread2 = new Thread(even);
Thread thread3 = new Thread(odd);
thread1.start();
Thread.sleep(200);
thread3.start();
Thread.sleep(200);
thread2.start();
}
}
class Print0 implements Runnable {
@Override
public void run() {
synchronized (this) {
int even = 2;
while (even < 20) {
System.out.print(0);
try {
this.wait(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
even += 2;
}
}
}
}
class PrintOdd implements Runnable {
Print0 print0;
PrintOdd(Print0 print0) {
this.print0 = print0;
}
@Override
public void run() {
synchronized (print0) {
int odd = 1;
while (odd < 20) {
System.out.print(odd);
try {
print0.wait(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
odd += 2;
}
}
}
}
class PrintEven implements Runnable {
Print0 print0;
PrintEven(Print0 print0) {
this.print0 = print0;
}
@Override
public void run() {
synchronized (print0) {
int even = 2;
while (even < 20) {
System.out.print(even);
try {
print0.wait(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
even += 2;
}
}
}
}