mlb- / fc-interview-puzzle

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

fc-interview

Funding Circle coding challenge

Usage

To run:

$ lein run

Options

No options are accepted.

Notes

  • Consider complexity.

  • How fast does your code run?

    This code takes about 20 seconds to run on my laptop, but the majority of the time spent is due to JVM/Clojure startup.

  • How does it scale?

    There is a nested reduce, which will scale poorly for larger tables (in hundreds or greater) due not to duplication of multiplication operations, but for inefficient string operations.

    Also, in choosing to use the Sieve of Eratosthenes, as primes are discovered, memory usage will increase. However, this reduces CPU usage by avoiding any division operations.

  • Consider cases where we want N primes.

    When N primes are desired, change the argument passed to primes.

License

Copyright © 2018 Matthew Batema

Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.

About

License:Eclipse Public License 1.0


Languages

Language:Clojure 100.0%