- Build.
- Blog.
- Bresent.
- Misallocation of time
- Start writing code right off the bat
- Attempt to solve problem on the first run through
- Read through the problem twice
- Solve the problem manually first (you should be able to explain the problem clearly to someone else)
- Verbally walk through each step you take to manually solve the problem
- Optimize (if there is a loop that can be put in somewhere, take that into account)
- Pseudo-code the optimized manual solution steps in comments
- Write out the code for each comment underneath
- Optimize the code solution
- Use Pseudocode to document your thought process.
- UML/diagram out your solution to the problem (boxes to represent classes, cylinders to represent database, etc)
- Determine the complexity of an algorithm
- Best Case
- Average Case
- Worst Case
- Algorithms are used in terms of:
- Time efficiency (how much time it takes to run through a collection)
- Space efficiency (how much memory it's taking up)
- Big O used to determine usability of algorithms in cases such as:
- Corporate databases with millions of records accessed frequently
- Search engines
- Computer games
- Jet plane technology that needs to determine a flight path in real-time
- Two ways: counting the number of operations, and timing via system time comparison
- For algorithmic efficiency, it's best to count the number of operations, which can be represented as some sort of cost function that's based upon the input size
def iterate(size)
array, n = [], 0 # declare and initialize array and n => 2 (there are 2 variables being set)
while n < size # comparison and => 1n (because it performs this for every number you iterate through) + 1 (it will eventually reach a point where n = size)
n += 1 # increment => 1n (performs this for every number you iterate through)
array << n # shovel => 1n (performs this for every number you iterate through)
puts array.inspect
end
end
- The exercise above results in a complexity cost of:
Ct = 3n + 3
- Extremely In Depth Tutorial
- Ian Miller Blog Post
- Big O Notation Explained
- How To Caclulate Big O
- Big O Cheat Sheet
- Intro to Algorithm Complexity Analysis
- TopCoder Collections for Review
- Interviewers tend to also be programmers. They're just as nervous as you are.
- Connect with them.
- Be curious. If you don't know an answer to a question, be honest. Ask them if they could explain it to you, and follow up with them afterwards about what you've learned.
- Have at least 1 or 2 programmers that you look up to.
- Why you like them, etc.
- Read up on current events in the programming world.
- I personally like Ruby Weekly (my favorite), Rails Weekly, and frequently read Hacker News
I always turn to inspiration to keep me going. Here are some resources I've dug up.
- You Aren't Late
- Ira Glass on storytelling
- Elon Musk on what drives him
- Benjamin Zander sharing his passion for music
- Tobias van Schneider on side projects