This questionnaire is intended to help us pre-screen applicants to our software development internship position. Submissions should be made in the form of a secret gist (for help creating gists, see this article). You will send the link to that gist to the email address provided to you when you were sent the link to this challenge. NOTE: Unsolicited gists will be completely ignored. You must apply for the position and be asked to submit a gist before sending one.
Your submission should be a single gist, but you may have multiple files within the submission if desired (e.g: one file per coding challenge, and one file with the answers to all the questions).
Please don't spend more than one or two evenings to complete this.
Please answer the following questions, in your own words, to the best of your ability, (as part of the gist) with a few full and complete sentences per response:
-
In HTML, what are the differences between a
<div>
and a<span>
? -
What is the difference between a
class
andid
in HTML/CSS? -
What Linux/Unix command would you use to find all files with contents including a particular string in a given folder?
-
Why is Bubble Sort bad?
-
Compare/Contrast XML with JSON. What strengths does each format offer?
-
What regular expression would you use to reasonably match an email address?
-
Why are powers of 2 important in Computer Science?
-
What is polymorphism?
-
What are database transactions and when would you use one?
-
Does P = NP?
Please submit solutions to the following challenges in Java:
- Write a function that takes in a positive integer (hereby referred to as N) and returns the first N odd integers as an array (or some other iterable object). Ex:
odds(0) => []
odds(1) => [1]
odds(2) => [1, 3]
odds(3) => [1, 3, 5]
odds(4) => [1, 3, 5, 7]
...
- Write a function that takes a positive integer (N) as an exponent, which returns the base-10 sum of the base-10 digits of 2^N. Ex:
2^3 = 8 => 8
2^4 = 16 => 1 + 6 = 7
2^10 = 1024 => 1 + 0 + 2 + 4 = 7
2^11 = 2048 => 2 + 0 + 4 + 8 = 14
-
Write a
Plant
class with aname
(string) attribute, asize
attribute (initially1
), agrow
method which increases the plant's size by1
, and adie
method which destroys/deletes thatPlant
. -
Write an
Animal
class with aname
(string) attribute, asize
attribute (initially1
), aneat
method which takes either aPlant
instance or anAnimal
instance as the argument and returns nothing, and adie
method which destroys/deletes thatAnimal
. -
Write a
Carnivore
class which inherits fromAnimal
. Itseat
method should invokedie
on thePlant
orAnimal
eaten, and do the following: - If the object eaten was aPlant
, theCarnivore
should decrease its size by 1 (if it reaches0
, it shoulddie
). - If the object eaten was anAnimal
, it should increase itssize
by thesize
of the animal eaten.