Morning challenges allow you to jumpstart your brain and get ready for a day of learning. Each morning, your PM will present a short code puzzle. These puzzles are similar to the kind you'll encounter in job interviews. Your job is to code a solution in a playground, in an application, or in REPL.it to satisfy the requirements laid out in the challenge.
These steps simulate a coding interview and are based on expectations set in industry. Even if you are unable to complete (or start) the challenge code, we expect you to work through the steps that mirror how a programmer approaches a new problem.
Your work must be entirely your own. You may not consult or collaborate with others during this challenge. You may use Apple's developer documents and official Swift Language guides (available free on iBooks) but you may not search the web for answers.
- https://docs.swift.org/swift-book/LanguageGuide/TheBasics.html
- https://itunes.apple.com/us/book/the-swift-programming-language-swift-4-2/id881256329?mt=11
- https://developer.apple.com/documentation/
These challenges are for your benefit. We care that you're learning the language. It's better to submit working code that shows individual thought and effort but it's okay to submit non-working code that shows individual thought and effort.
You have 45 minutes to develop your approach and your code. You must submit your gist to your Section Lead before reviewing the solution.
Start by carefully reading through the challenge. The challenge is often intentionally vague.
Create a new gist on Github.com and write down your assumptions about what the instructions mean. For example, if the challenge states that a function works on positive integers, does that mean that you will never be given negative integers? Or does it mean that you should design your code to filter negative data, to only produce results for positive values?
This clarification reflects the first stage of an interview question and is a mandatory part of your challenge submission.
Most challenges will give you one to a few input samples and present their output. These samples are not sufficient test cases.
Think carefully about the extremes of your function: empty strings or arrays, out-of-bounds values, repeated values, and so forth. List a more exhaustive set of tests that push your function at its limits and add these to your gist, along with the expected result for each input.
Designing test cases are an expected part of your coding interview and you must include them in your challenge submission.
Think through how you will approach the challenge. Describe it in words using your gist file. Your first approach need not be perfect, clean, or elegant. It just needs to work. Write down how you will do this in your gist before you start coding.
Follow your approach and build the requested function. Test it with your test cases, making note of which items failed. If time permits, you can refine the function. If not, take whatever code you have and the results of your tests and put them in your gist file.
If your code works, evaluate its strengths and weaknesses. If relevant, add brief comments to your gist.
In the unlikely event you have sufficient time to refactor your code to try a better approach, add those notes and code to your gist as well.
When your 45-minute coding time finishes, stop what you're doing, save your gist, and send it to your Project Manager before hopping onto Zoom.
Your PM will open a Zoom chat to discuss test cases, approaches, and solutions before wrapping up with a solution overview.