using mocha/chai/sinon for node.js unit-tests? check out my utility: mocha-stirrer to easily reuse test components and mock require dependencies
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
comment | |
comment punctuation | |
comment.block.documentation | |
comment.block.preprocessor | |
comment.documentation | |
constant | |
constant.character | |
constant.character punctuation | |
constant.character.entity | |
constant.character.escape |
##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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @param {number[][]} envelopes | |
* @return {number} | |
*/ | |
var maxEnvelopes = function(envelopes) { | |
// Edge Cases | |
if ( envelopes === null || envelopes.length === 0) { | |
return 0; | |
} | |
if ( envelopes.length === 1) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
After automatically updating Postgres to 10.0 via Homebrew, the pg_ctl start command didn't work. | |
The error was "The data directory was initialized by PostgreSQL version 9.6, which is not compatible with this version 10.0." | |
Database files have to be updated before starting the server, here are the steps that had to be followed: | |
# need to have both 9.6.x and latest 10.0 installed, and keep 10.0 as default | |
brew unlink postgresql | |
brew install [email protected] | |
brew unlink [email protected] | |
brew link postgresql |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Below are the use cases and functional specification for The Cashinator 3000. | |
// As a cashier, I can initialize the cash register with a price list in a simple comma-delimited format. The price list contains product names, SKU's (stock-keeping units, i.e., the product id), the price per unit, and whether the product is taxable. (Staple groceries are typically not taxable.) | |
// As a cashier, I can initialize the register with a starting amount of money. | |
// As a cashier, I can initialize the register with a sales tax percentage. | |
// As a cashier, when I am not actively handling a customer transaction, I can choose to view the current balance of cash that the register contains. | |
// As a cashier, I can start a new transaction. Transactions have id's and are time-stamped upon creation. | |
// As a cashier, I can scan one item, whereupon that item is added to the transaction. | |
// As a customer, I can see the last item scanned and a running subtotal of the current transaction cost. | |
// As a cashier, I can input the money |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @param {number} capacity | |
*/ | |
var LFUCache = function(capacity) { | |
this.capacity = capactiy; | |
this.storage = {}; | |
this.freq = {}; | |
this.lastVisited = []; | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @param {string} s | |
* @return {string} | |
*/ | |
var frequencySort = function(s) { | |
let freqObj = {}; | |
let bucket = {}; | |
let output = []; | |
for (var i = 0; i < s.length; i++) { |
NewerOlder