## Globaltech Research Interview Question for Software Engineer / Developers

Comment hidden because of low score. Click to expand.
0
of 0 vote

p & p^2+8 are primes, if p not equal to 2.

p*(p^2 + 8) is not prime as it is factored into prime numbers......(p^3+p*8)

To make it prime, we need to convert p*8 into something not divisble by p,

We take 2 in this case. So, it makes (p^3+2^4) a prime....this cannot be factored furthur.

Can someone comment on the solution ?

Comment hidden because of low score. Click to expand.
0
of 0 vote

i m not sure if the argument is correct bcos P & P^2 + 8 is not prime even in case of P=5,
infact ur argument "We take 2 in this case. So, it makes (p^3+2^4) a prime....this cannot be factored furthur" is leading to the generalization that we can have even P^3 + 2^n as prime, so i m not sure if it is the correct way of proving.....

Comment hidden because of low score. Click to expand.
0
of 0 vote

lk, ur argument is correct. Perhaps, we can assume p & p^2+8 are primes. p cannot be '2' is a case. There are can be other cases as well, like '5'. Have to think more on this...m not good @ number theory.

Maybe someone else can help ?

Comment hidden because of low score. Click to expand.
0
of 0 vote

Any prime integer p can be written as 6k+1 or 6k-1, except 2,3.
when p!=2,3 then..ie p=6k(+/-)1
p^2+8 = 36k^2 (+/-) 12k + 9
...... this is a multiple of 3 n also greater than 8 and hence cannot be prime if p!=2,3...!
if p=2... p^2+8 cannot be prime obviously..
that leaves us with p=3 case..
p^2+8 = 17 (prime)
p^3+16 = 43 (prime) n proved!!!

Comment hidden because of low score. Click to expand.
0
of 0 vote

We know that p is surely an odd number there p^2 when divided by 3 must leave a remainder 1.(obviously it cant have remainder 0 ;it would be multiple of 3 ( here I m not considering case p=3)and not even two it can be shown easily by letting the number of form 3k+r where r=1,2)
Now we know p^2=3m+1 so p^2+8=3m+9 =3(m+3) so it isnt prime
Now all cases have been rejected except for p=3; p^2+8=17 and p^3+16=43 .
So done p=3 satisfies it and that's the only answer:)

Name:

Writing Code? Surround your code with {{{ and }}} to preserve whitespace.

### Books

is a comprehensive book on getting a job at a top tech company, while focuses on dev interviews and does this for PMs.

### Videos

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.