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="java" line="1" title="CodeMonkey96989" class="run-this">package com.saral.careercup.amazon;
- amd.anand September 24, 2010import java.util.ArrayList;
import java.util.List;
public class FactorialOfLargeNumber {
public static void main(String[] args) {
int n = 35;
int [] factorial = factorial(n);
boolean start = false;
for(int i=0; i<factorial.length; i++){
if (factorial[i] != 0){
start = true;
}
if(start)
System.out.print(factorial[i]);
}
System.out.println();
}
public static int[] factorial(int n){
int[] result = toIntegerArray(1);
for(int i=2; i<=n; i++){
result = multiply(result, toIntegerArray(i));
}
return result;
}
public static int[] toIntegerArray(int i){
int[] array = new int[String.valueOf(i).length()];
int k=array.length;
while(k>=0){
if(i < 10){
array[--k] = i;
break;
}else{
int r = i % 10;
array[--k] = r;
i = i / 10;
}
}
return array;
}
public static int[] multiply(int[] a, int[] b){
List<int[]> list = new ArrayList<int[]>();
int l = 0;
for(int i=a.length-1; i>=0; i--){
int carry = 0;
int[] r = new int[a.length + b.length + 1];
int k = r.length-++l;
for(int j=b.length-1; j>=0; j--, k--){
int p = (a[i] * b[j]) + carry;
r[k] = p % 10;
carry = p/10;
}
r[k] = r[k] + carry;
list.add(r);
}
return sum(list);
}
public static int[] sum(List<int[]> intList){
int[] sum = null;
int maxLength = 0;
for(int[] i: intList){
if(i.length > maxLength)
maxLength = i.length;
}
sum = new int[maxLength + 1];
for(int i = 0; i<intList.size(); i++){
for(int k=intList.get(i).length-1, l=sum.length-1; k>=0; k--, l--){
int s = sum[l] + intList.get(i)[k];
sum[l] = s % 10;
sum[l-1] = sum[l-1] + (s / 10);
}
}
return sum;
}
}
</pre><pre title="CodeMonkey96989" input="yes">This code prints the value of 35!
</pre>