Skip to content

Instantly share code, notes, and snippets.

View sahildua2305's full-sized avatar
🎯
Focusing

Sahil Dua sahildua2305

🎯
Focusing
View GitHub Profile
@sahildua2305
sahildua2305 / The Technical Interview Cheat Sheet.md
Created February 6, 2016 12:15 — 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.
@sahildua2305
sahildua2305 / tic_tac_toe
Last active September 17, 2015 07:38
sds
# '-' for empty position
# 'O' for marking O is there
# 'X' for marking X has made a turn there
board = "---------"
# Assuming I already have a dictionary `board_states` for lookup
def nextMove(curr_move):
board[curr_move] = 'X'
# simply lookup the value of next move from the dictionary
@sahildua2305
sahildua2305 / checkout.js
Created July 12, 2014 08:13
Refiral Checkout Integration Code
<script type="text/javascript">var showButton = false;</script>
<script type="text/javascript">var apiKey = "YOUR_API_KEY";</script>
<script type="text/javascript" src="//rfer.co/api/v0/js/all.js"></script>
<script type="text/javascript">
var customer_name = "CUSTOMER_NAME"; // Replace CUSTOMER_NAME with the customer name
var customer_email = "CUSTOMER_EMAIL"; // Replace CUSTOMER_NAME with the customer email
var grandTotal = "GRAND_TOTAL"; // Replace GRAND_TOTAL with the total amount of the bill of customer
var subTotal = "SUBTOTAL"; // Replace SUBTOTAL with the subtotal amount of the bill of customer
var couponCode = "COUPON_CODE"; // Replace COUPON_CODE with the coupon code applied by customer. Leave it blank if no coupon code is applied.