Internship interview questions shared by candidates
How work you work out all the prime numbers up to a given range?
Store all the prime numbers in an array and compare the next number with the array to find out whether it is prime or not.
Sieve of Eratosthenes algorithm. create an array of the numbers, set them all to the value 1. Start at 2, set every second number after 2 to 0. move to the next number (3). change every third number after three to zero. stop when there's no more numbers set to 1 or you reach the end of the array. At the end, the numbers marked 1 are the primes.
Interview candidate - did you give that answer in the interview? If so, what did they say?
Given four number 7 and one number 1, make it equal to 100 using only + - * / and (). In the presentation, I was given a summary article on market condition. I was then asked to present to a senior on what assets he should invest on. I didn't use much information from the article and more from my own knowledge, which is a minus. Also I didn't use up to 10 minutes given, which is not good as well.