Skip to content

Instantly share code, notes, and snippets.

@jatinganhotra
jatinganhotra / The Technical Interview Cheat Sheet.md
Last active August 25, 2015 19:39 — 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.
@jatinganhotra
jatinganhotra / Octave install error
Created April 1, 2014 15:07
'brew --config', 'brew doctor' and 'brew install octave' logs
bash-3.2$ brew --config
HOMEBREW_VERSION: 0.9.5
ORIGIN: https://github.com/Homebrew/homebrew.git
HEAD: 7b68e440f1626fc17a33afb2784404139cafd24c
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
CPU: quad-core 64-bit sandybridge
OS X: 10.9.2-x86_64
Xcode: 5.1
CLT: 5.1.0.0.1.1393561416
@jatinganhotra
jatinganhotra / difffile_file_names.txt
Created November 26, 2014 13:27
Issue in ruby-git - Inconsistency with Diff contents
deploy/core/LightTable.html
deploy/core/css/codemirror.css
deploy/core/css/skins/dark.css
deploy/core/css/structure.css
deploy/core/css/themes/eclipse.css
deploy/core/css/themes/ibdknox.css
deploy/core/node_modules/codemirror/codemirror.js
deploy/core/node_modules/codemirror/modes/clojure-mode.js
deploy/core/node_modules/codemirror/overlay.js
deploy/core/node_modules/lighttable/background/threadworker.js
@jatinganhotra
jatinganhotra / rspec-syntax-cheat-sheet.rb
Created July 7, 2011 10:52 — forked from dnagir/rspec-syntax-cheat-sheet.rb
RSpec 2 syntax cheat sheet by example
# RSpec 2.0 syntax Cheet Sheet by http://ApproachE.com
# defining spec within a module will automatically pick Player::MovieList as a 'subject' (see below)
module Player
describe MovieList, "with optional description" do
it "is pending example, so that you can write ones quickly"
it "is already working example that we want to suspend from failing temporarily" do
pending("working on another feature that temporarily breaks this one")
@jatinganhotra
jatinganhotra / Master.h
Created November 25, 2012 18:50
Use forward declarations in C++ in all the following cases:
class Master {
private:
// Declare a member to be a pointer or a reference to the incomplete type
Forward *ptr1;
Forward &ptr2;
public:
// Declare functions or methods which accepts/return incomplete types:
void ByValue(Forward by_value);
@jatinganhotra
jatinganhotra / sparklistener-checkpointing.scala
Created November 9, 2015 00:38
SparkListener - Checkpointing jobs
import scala.collection.JavaConversions._ // for propertiesAsScalaMap function
sc.addSparkListener(new SparkListener() {
override def onJobStart(jobStart: SparkListenerJobStart) {
println("ADAPT: INSIDE Job Start Listener ");
var props = propertiesAsScalaMap(jobStart.properties)
if (props.contains("spark.rdd.scope"))
{
val propsMap = // Convert props to propsMap
if ( propsMap.contains("name") && propsMap("name") == "checkpoint")
@jatinganhotra
jatinganhotra / brew status info
Last active January 2, 2016 07:49
brew doctor, brew --config and brew install -v foo 2>&1 Information
-> brew doctor
bash-3.2$ brew doctor
Your system is ready to brew.
-> brew --config
bash-3.2$ brew --config
HOMEBREW_VERSION: 0.9.5
ORIGIN: https://github.com/Homebrew/homebrew.git
HEAD: 5dea7fc768fb1c1fba875332f9002378157e5286
HOMEBREW_PREFIX: /usr/local
@jatinganhotra
jatinganhotra / gist:8509597
Created January 19, 2014 19:14
brew status info (Trouble installing octave 3.8.0 on OS X Mavericks 10.9.1)
-> brew doctor
bash-3.2$ brew doctor
Your system is ready to brew.
-> brew --config
bash-3.2$ brew --config
HOMEBREW_VERSION: 0.9.5
ORIGIN: https://github.com/Homebrew/homebrew.git
HEAD: b51461cb280581aa6fb197229912f79a850f9dad
HOMEBREW_PREFIX: /usr/local
@jatinganhotra
jatinganhotra / integral_type_sizes.cpp
Created December 24, 2012 06:21
C++ snippet to list MIN, MAX values & other attributes of Integral Types
#include <iostream>
#include <limits>
using namespace std;
int main()
{
cout << "Size of size_t = " << sizeof(std::size_t) << endl << endl;
cout << "Minimum value for bool: " << numeric_limits<bool>::min() << endl;
@jatinganhotra
jatinganhotra / Master.h
Created November 25, 2012 18:48
Can't use forward declarations in C++ in all the following cases:
// Use it as a base class
class Master : Forward {} // compiler error!
// Use it to declare a member:
class Master {
Forward cannot_define_obj_member; // compiler error!
};
// Define functions or methods using the incomplete type
void SomeFunc1(Forward x) {} // compiler error!