Skip to content

Instantly share code, notes, and snippets.

View niharika88's full-sized avatar

Niharika niharika88

  • Banglore
View GitHub Profile
@niharika88
niharika88 / gist:8eb8ecd430729f6caa647804bee1e011
Last active October 10, 2018 20:50
The function called populate_template which takes in a template string e.g. " Hello {!first_name} - How are you?" and a hash of fields e.g { "first_name" : "John" } as arguments and returns the template string with the fields inserted in the correct place. It takes in 2 arguments: - template (String) - fields (hash / dictionary)
import re
def populate_template(template, fields= {}):
for key, value in fields.items():
if template.find(key):
template_new = re.sub(key, fields[key], template)
return template_new
@niharika88
niharika88 / latency.txt
Created March 17, 2017 21:21 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers
--------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@niharika88
niharika88 / The Technical Interview Cheat Sheet.md
Created August 31, 2016 19:24 — 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.
@niharika88
niharika88 / interviewitems.MD
Created August 29, 2016 18:37 — forked from KWMalik/interviewitems.MD
My answers to over 100 Google interview questions

##Google Interview Questions: Product Marketing Manager

  • Why do you want to join Google? -- Because I want to create tools for others to learn, for free. I didn't have a lot of money when growing up so I didn't get access to the same books, computers and resources that others had which caused money, I want to help ensure that others can learn on the same playing field regardless of their families wealth status or location.
  • What do you know about Google’s product and technology? -- A lot actually, I am a beta tester for numerous products, I use most of the Google tools such as: Search, Gmaill, Drive, Reader, Calendar, G+, YouTube, Web Master Tools, Keyword tools, Analytics etc.
  • If you are Product Manager for Google’s Adwords, how do you plan to market this?
  • What would you say during an AdWords or AdSense product seminar?
  • Who are Google’s competitors, and how does Google compete with them? -- Google competes on numerous fields: --- Search: Baidu, Bing, Duck Duck Go
@niharika88
niharika88 / gist:dae271d5ff2d555e10ae
Created May 20, 2015 13:51
plz read it cool stuff
http://www.benknowscode.com/2013/12/multi-column-sort-in-backbone-collections.html
Multi sort example based on ascending and descending criteria