Symphony Interview Question: Write a function that, given ... | Glassdoor

Interview Question

Senior Software Engineer Platform Integration Interview New York, NY

Write a function that, given an integer > 0, will return a

  List<Integer> containing all the prime numbers up to, and including, the given integer.

Interview Answer

1 Answer


private static void generatePrimeNumbers(int number) {
        List primeNumbers = new ArrayList();
        for(int i=1;i&lt;=number;i++) {
            boolean isPrime = true;
            for(int j=2;j

Anonymous on Nov 3, 2016

Add Answers or Comments

To comment on this, Sign In or Sign Up.