Skip to content

Instantly share code, notes, and snippets.

// given an array, you would first need to sort it
// how would you sort it?
// assuming you don't have access to ordered collections, you have to order it yourself, so implement that shit
// starting at index 0, all you can literally and reasonably do is ask about your neighbor behind you
// you ask your neighbor behind you: "Are you bigger than me?"
// If it's a yes, your neighbor stays at home and you stay at home
// If it's a no, you and your neighbor trade houses, meaning, your neighbor is smaller than you. You are a bully and your neighbor has a better house and you Ghenghis Khan that shit and you make them move.
// This means, when your neighbor is smaller than you are, you swap.
// You keep doing that dance until you get to the end of the line. Do you ever have to ask ahead? Can I think of a case where you have to ask ahead?
Binary search compares the target value to the middle element of the array; if they are unequal, the half in which the target cannot lie is eliminated and the search continues on the remaining half until it is successful or the remaining half is empty.
@Stellara
Stellara / The Technical Interview Cheat Sheet.md
Last active August 29, 2015 14:28 — forked from tsiege/The Technical Interview Cheat Sheet.md
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

###Array ####Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.

Switch To Vim For Good

This guide is coming from an email I used to send to newcomers to Vim. It is not intended to be a complete guide, it is about how I did the switch.

Some background: my decision to switch to Vim has been made a long time ago. Coming from TextMate 1, I wanted to learn an editor that is Open Source (so I don’t lose my time learning a tool that can be killed), cross platform (so I can use it everywhere), and powerful enough (so I won’t regret TextMate). For these reasons, Vim has always been the editor I wanted to learn, but it took me several years before I did it in a way that works for me. I tried to switch progressively, using the Janus Vim distribution for a few months, then got back to using TextMate 2 for a time, waiting for the next attempt… here is what finally worked for me.

Non Optional

  1. Watch the Derek Wyatt videos in order (at least the “Novice” ones for now): http://derekwyatt.org/vim/tutorials/
  2. Read the first part of this Sta