Tech Interview

A site for technical interview questions, brain teasers, puzzles, quizzles (whatever the heck those are) and other things that make you think!

    • 31 Aug 2017

      Prime number problem

      Posted at 11:01 pm by Admin, on August 31, 2017

      You need to a number of floors in a building. There are 68 floors (numbered 1 to 64).

      Conditions:
      1. Can’t buy floors which numbers are prime.
      2. Cannot buy floors which number contains a prime digit.
      3. Can’t buy floor number 1.
      4. Distance between all purchased floors must be different (i.e. you can’t buy floors 4, 6, and 8 because they both have 1 floor between them).
      5. Distance between all purchased floors must be prime.

      Using code or pseudocode figure out:
      1. Maximum number of floors you can buy using conditions 1, 2 and 3?
      2. Maximum number of floors you can buy using all conditions?

      0 Comments
      Posted in Uncategorized

Proudly powered by WordPress.

Theme: Minipress by Obox Themes.