SlideShare a Scribd company logo
GayleL.McDowell | Founder/ CEO
gayle in/gaylemcdgayle
Cracking the Algorithm &
Coding Interview
SVCC
SiliconValleyCodeCamp
gayle in/gaylemcdgayleGayle Laakmann McDowell 2
Hi! I’m Gayle LaakmannMcDowell
Author Interview Coach Interview Consulting
<dev> </dev>
(CS) (MBA)
Gayle Laakmann McDowell 3gayle in/gaylemcdgayle
Yes! Slidesare online!
Gayle.com
 Click“Events”
 Ctrl-F for “SiliconValley”
But why?
Why why why why why why meeeee
01
gayle in/gaylemcdgayle 5
z
Gayle Laakmann McDowell
What
Really
Happens
Gayle Laakmann McDowell 6gayle in/gaylemcdgayle
Why?
Strong CS
fundamentals
Analytical skills
Make tradeoffs
Push throughhard
problems
Communication
How you think
Preparation
Why why why why why why meeeee
02
gayle in/gaylemcdgayleGayle Laakmann McDowell 8
Essential Knowledge
Data Structures Algorithms Concepts
ArrayLists Merge Sort BigO Time
Hash Tables QuickSort BigO Space
Trees(+Tries) Breadth-FirstSearch Recursion
Graphs Depth-FirstSearch Memoization/ Dynamic
Programming
Stacks/ Queues BinarySearch
Heaps
gayle in/gaylemcdgayleGayle Laakmann McDowell 9
Preparation
ImplementDS/Algorithms
MASTER BigO
Practice with interviewquestions
Code on paper/whiteboard
Mock interviews
PUSHYOURSELF!
Expectations &
Evaluation
Why why why why why why meeeee
03
gayle in/gaylemcdgayle 11
z
Gayle Laakmann McDowell
What
is NOT
expected
To know the answers
To solve immediately
To code perfectly
(It’snice.Itjustdoesn’t
happen*.)
*Okayfine.Ithappenedonce,in2000+hiringpackets.
gayle in/gaylemcdgayle 12
z
Gayle Laakmann McDowell
What
IS
expected
Be excitedabout hard problems
More thanjust “correct”
Drive!
Keeptrying when stuck
Write real code
Showmehowyouthink!
gayle in/gaylemcdgayle 13
z
Gayle Laakmann McDowell
How
You’re
Evaluated
RELATIVE
Not a “metric” / timer
Nooneisperfect!
Solving
Why why why why why why meeeee
04
gayle in/gaylemcdgayle 15
z
Gayle Laakmann McDowell
How
To
Approach
CrackingTheCodingInterview.com“Resources”
gayle in/gaylemcdgayle 16Gayle Laakmann McDowell
step
Listen (for clues)
Gayle Laakmann McDowell 17gayle in/gaylemcdgayle
What’sthe clue?
Anagram server
 Ex: rates ->aster, stare, taser, tears
Clue:why is it ona server?
gayle in/gaylemcdgayle 18Gayle Laakmann McDowell
step
Draw an Example
Big Enough
General Purpose
+
gayle in/gaylemcdgayleGayle Laakmann McDowell 19
Ex:Intersection ofTwo Sorted Arrays
Most people draw somethinglike this:
[1, 12, 15, 19]
[2, 12, 13, 20]
 Toosmall
 Toospecial-case-y
• same size, one common element, sameindex
gayle in/gaylemcdgayleGayle Laakmann McDowell 20
Ex:Intersection ofTwo Sorted Arrays
Better:
[1, 12, 15, 19, 20, 21]
[2, 15, 17, 19, 21, 25, 27]
 Big
 No specialcases
gayle in/gaylemcdgayle 21Gayle Laakmann McDowell
step
Brute Force / Naive
Stupid&terribleisokay!
gayle in/gaylemcdgayle 22Gayle Laakmann McDowell
step
Optimize
Walk through brute
force
Look for optimizations
Gayle Laakmann McDowell 23gayle in/gaylemcdgayle
Techniques to Develop Algorithms
Optimize
A. BUD
B. Space/time
C. Doityourself
Solve
D. Recursion
E. Solve “incorrectly”
F. Other data structures
Pushyourself!
Gayle Laakmann McDowell 24gayle in/gaylemcdgayle
(A) Look for BUD
Bottlenecks
Unnecessary work
Duplicated work
Gayle Laakmann McDowell 25gayle in/gaylemcdgayle
What’s the bottleneck?
 Ex: countingthe intersection
[1, 12, 15, 19, 20, 21]
[2, 15, 17, 19, 21, 25, 27]
 Bottleneck:searching
B
Gayle Laakmann McDowell 26gayle in/gaylemcdgayle
What’s unnecessary?
 Ex: a3 + b3 = c3 + d3 (1 <=a,b, c, d<= 1000
 Unnecessary: looking for d
U
Gayle Laakmann McDowell 27gayle in/gaylemcdgayle
What’s unnecessary?
 Ex: a3 + b3 = c3 + d3 (1 <=a,b, c, d<= 1000
 Unnecessary: looking for d
U
Gayle Laakmann McDowell 28gayle in/gaylemcdgayle
What’s duplicated?
 Ex: a3 + b3 = c3 + d3 (1 <=a,b, c, d<= 1000
 Duplicated: c, d pairs
D
Gayle Laakmann McDowell 29gayle in/gaylemcdgayle
What’s duplicated?
 Ex: a3 + b3 = c3 + d3 (1 <=a,b, c, d<= 1000
 Duplicated: c, d pairs
D
Gayle Laakmann McDowell 30gayle in/gaylemcdgayle
What’s duplicated?
 Ex: a3 + b3 = c3 + d3 (1 <=a,b, c, d<= 1000
D
Gayle Laakmann McDowell 31gayle in/gaylemcdgayle
What’s duplicated?
 Ex: a3 + b3 = c3 + d3 (1 <=a,b, c, d<= 1000
D
Gayle Laakmann McDowell 32gayle in/gaylemcdgayle
(B)Space/TimeTradeoffs
Hashtables & other datastructures
Precomputing
Gayle Laakmann McDowell 33gayle in/gaylemcdgayle
Space/Time Tradeoffs Hashtables
 Find # pairs withsum
INPUT: array = [5, 15, 8, 9, 3, 2, -1, 4]
sum = 7
OUTPUT: 3
pairs = (5, 2), (8, -1), (3, 4)
 Putitemsinto hashtable
Gayle Laakmann McDowell 34gayle in/gaylemcdgayle
Space/Time Tradeoffs  Precomputing
 Find rectangle at origin w biggest sum
6 5 -9 2
-2 -5 -2 7
3 -2 10 13
-8 -3 1 -2
 Brute force: compute all rectanglesand sums
Gayle Laakmann McDowell 35gayle in/gaylemcdgayle
Space/Time Tradeoffs  Precomputing
 Find rectangle with biggest sum
6 5 -9 2
-2 -5 -2 7
3 -2 10 13
-8 -3 1 -2
-+ + 10=
Gayle Laakmann McDowell 36gayle in/gaylemcdgayle
Space/Time Tradeoffs  Precomputing
 Find rectangle with biggest sum
6 5 -9 2
-2 -5 -2 7
3 -2 10 13
-8 -3 1 -2
-+ + 13=
Gayle Laakmann McDowell 37gayle in/gaylemcdgayle
(C)Do it yourself
Findpermutationsof swithinb
 s = abbc
 b = babcabbacaabcbabcacbb
Findthem!
 … now how didyou actuallydoit?
Gayle Laakmann McDowell 38gayle in/gaylemcdgayle
Techniques to Develop Algorithms
Optimize
A. BUD
B. Space/time
C. Doityourself
Solve
D. Recursion
E. Solve “incorrectly”
F. Other data structures
Pushyourself!
Gayle Laakmann McDowell 39gayle in/gaylemcdgayle
(D) Recursion/ Base Case & Build
Subsets of a set
 {}  {}
 {a}  {}, {a}
 {a, b}  {}, {a}, {b}, {a, b}
 {a, b, c}  …
Subsets of {S1…Sn-1} + Sn to each
Gayle Laakmann McDowell 40gayle in/gaylemcdgayle
(E) Solve “incorrectly”
① Develop incorrectsolution
② Identifywhy preciselyit’s incorrect
③ Repair
④ (& Repeat)
Gayle Laakmann McDowell 41gayle in/gaylemcdgayle
(E)Solve “incorrectly”
Random node in BST
Try: flipcoin
Coin=Heads
 Branch Left
Coin=Tails
 Branch Right
Gayle Laakmann McDowell 42gayle in/gaylemcdgayle
(E)Solve “incorrectly”
Random node in BST
Try: random number in {0, 1, 2}
R=0
 Branch Left
R=2
 Branch Right
R=1
 Return root
Gayle Laakmann McDowell 43gayle in/gaylemcdgayle
(E)Solve “incorrectly”
Random node in BST
Try:
 Return rootwith1/n probability
 Then flipcoin(heads left,tails->right)
Gayle Laakmann McDowell 44gayle in/gaylemcdgayle
(E)Solve “incorrectly”
Random node in BST
Try: pick random # 0 throughn-1
R=0
 Return root
R>left.size
 Branch right
1<=R<=left.size
 Branch left
Gayle Laakmann McDowell 45gayle in/gaylemcdgayle
(F) Other Data Structures
Giving outphone numbers
 “I wantany availablenumber”
 “I wantthisnumber”
Try: sorted array?Sorted linkedlist?Hashtable?
BST?
gayle in/gaylemcdgayle 46Gayle Laakmann McDowell
step
Walk Through
Know the variables
andwhen they change
gayle in/gaylemcdgayle 47Gayle Laakmann McDowell
step
Write Beautiful Code
Gayle Laakmann McDowell 48gayle in/gaylemcdgayle
How to Write WhiteboardCode
Modularized
Error cases / TODOs
Good variables
Write straight
Top-leftcorner
Use arrows if needed
Languagechoiceisuptoyou!
gayle in/gaylemcdgayleGayle Laakmann McDowell 49
Modularization
gayle in/gaylemcdgayle 50Gayle Laakmann McDowell
step
Testing
FIRST Analyze
 What’sitdoing?Why?
 Anythingthatlooksweird?
 Errorhotspots
THEN use test cases
 Smalltestcases
 Edgecases
 Bigger testcases
Final Thoughts
And questions
05
gayle in/gaylemcdgayle 52
z
Gayle Laakmann McDowell
It’s done
for a
reason!
Be a great teammate.
Be a great engineer.
gayle in/gaylemcdgayleGayle Laakmann McDowell 53
Other Resources
Gayle.com
CareerCup.com
CrackingThe
CodingInterview.com
Or, follow me online
• facebook.com/gayle
• twitter.com/gayle
• gayle.com
• gayle@gayle.com
• quora.com

More Related Content

What's hot

Cracking The Technical Interview
Cracking The Technical InterviewCracking The Technical Interview
Cracking The Technical Interviewcareercup
 
Best Practices for Data Warehousing with Amazon Redshift | AWS Public Sector ...
Best Practices for Data Warehousing with Amazon Redshift | AWS Public Sector ...Best Practices for Data Warehousing with Amazon Redshift | AWS Public Sector ...
Best Practices for Data Warehousing with Amazon Redshift | AWS Public Sector ...
Amazon Web Services
 
Everyday I'm Shuffling - Tips for Writing Better Spark Programs, Strata San J...
Everyday I'm Shuffling - Tips for Writing Better Spark Programs, Strata San J...Everyday I'm Shuffling - Tips for Writing Better Spark Programs, Strata San J...
Everyday I'm Shuffling - Tips for Writing Better Spark Programs, Strata San J...
Databricks
 
ClickHouse Introduction by Alexander Zaitsev, Altinity CTO
ClickHouse Introduction by Alexander Zaitsev, Altinity CTOClickHouse Introduction by Alexander Zaitsev, Altinity CTO
ClickHouse Introduction by Alexander Zaitsev, Altinity CTO
Altinity Ltd
 
BigQuery walk through.pptx
BigQuery walk through.pptxBigQuery walk through.pptx
BigQuery walk through.pptx
VikRam S
 
Garbage First Garbage Collector (G1 GC) - Migration to, Expectations and Adva...
Garbage First Garbage Collector (G1 GC) - Migration to, Expectations and Adva...Garbage First Garbage Collector (G1 GC) - Migration to, Expectations and Adva...
Garbage First Garbage Collector (G1 GC) - Migration to, Expectations and Adva...
Monica Beckwith
 
ClickHouse ReplacingMergeTree in Telecom Apps
ClickHouse ReplacingMergeTree in Telecom AppsClickHouse ReplacingMergeTree in Telecom Apps
ClickHouse ReplacingMergeTree in Telecom Apps
Altinity Ltd
 
MongoDB 101
MongoDB 101MongoDB 101
MongoDB 101
Abhijeet Vaikar
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
Mike Dirolf
 
Top 5 mistakes when writing Spark applications
Top 5 mistakes when writing Spark applicationsTop 5 mistakes when writing Spark applications
Top 5 mistakes when writing Spark applications
hadooparchbook
 
Introducing Drools
Introducing DroolsIntroducing Drools
Introducing DroolsMario Fusco
 
Modules or microservices?
Modules or microservices?Modules or microservices?
Modules or microservices?
Sander Mak (@Sander_Mak)
 
Apply Hammer Directly to Thumb; Avoiding Apache Spark and Cassandra AntiPatt...
 Apply Hammer Directly to Thumb; Avoiding Apache Spark and Cassandra AntiPatt... Apply Hammer Directly to Thumb; Avoiding Apache Spark and Cassandra AntiPatt...
Apply Hammer Directly to Thumb; Avoiding Apache Spark and Cassandra AntiPatt...
Databricks
 
Mongo DB 102
Mongo DB 102Mongo DB 102
Mongo DB 102
Abhijeet Vaikar
 
Testing in go
Testing in goTesting in go
What it takes to run Hadoop at Scale: Yahoo! Perspectives
What it takes to run Hadoop at Scale: Yahoo! PerspectivesWhat it takes to run Hadoop at Scale: Yahoo! Perspectives
What it takes to run Hadoop at Scale: Yahoo! Perspectives
DataWorks Summit
 
Clickhouse Capacity Planning for OLAP Workloads, Mik Kocikowski of CloudFlare
Clickhouse Capacity Planning for OLAP Workloads, Mik Kocikowski of CloudFlareClickhouse Capacity Planning for OLAP Workloads, Mik Kocikowski of CloudFlare
Clickhouse Capacity Planning for OLAP Workloads, Mik Kocikowski of CloudFlare
Altinity Ltd
 
Traversing Graph Databases with Gremlin
Traversing Graph Databases with GremlinTraversing Graph Databases with Gremlin
Traversing Graph Databases with Gremlin
Marko Rodriguez
 
Webinar: MongoDB Schema Design and Performance Implications
Webinar: MongoDB Schema Design and Performance ImplicationsWebinar: MongoDB Schema Design and Performance Implications
Webinar: MongoDB Schema Design and Performance Implications
MongoDB
 
Introducing Delta Live Tables: Make Reliable ETL Easy on Delta Lake
Introducing Delta Live Tables: Make Reliable ETL Easy on Delta LakeIntroducing Delta Live Tables: Make Reliable ETL Easy on Delta Lake
Introducing Delta Live Tables: Make Reliable ETL Easy on Delta Lake
Databricks
 

What's hot (20)

Cracking The Technical Interview
Cracking The Technical InterviewCracking The Technical Interview
Cracking The Technical Interview
 
Best Practices for Data Warehousing with Amazon Redshift | AWS Public Sector ...
Best Practices for Data Warehousing with Amazon Redshift | AWS Public Sector ...Best Practices for Data Warehousing with Amazon Redshift | AWS Public Sector ...
Best Practices for Data Warehousing with Amazon Redshift | AWS Public Sector ...
 
Everyday I'm Shuffling - Tips for Writing Better Spark Programs, Strata San J...
Everyday I'm Shuffling - Tips for Writing Better Spark Programs, Strata San J...Everyday I'm Shuffling - Tips for Writing Better Spark Programs, Strata San J...
Everyday I'm Shuffling - Tips for Writing Better Spark Programs, Strata San J...
 
ClickHouse Introduction by Alexander Zaitsev, Altinity CTO
ClickHouse Introduction by Alexander Zaitsev, Altinity CTOClickHouse Introduction by Alexander Zaitsev, Altinity CTO
ClickHouse Introduction by Alexander Zaitsev, Altinity CTO
 
BigQuery walk through.pptx
BigQuery walk through.pptxBigQuery walk through.pptx
BigQuery walk through.pptx
 
Garbage First Garbage Collector (G1 GC) - Migration to, Expectations and Adva...
Garbage First Garbage Collector (G1 GC) - Migration to, Expectations and Adva...Garbage First Garbage Collector (G1 GC) - Migration to, Expectations and Adva...
Garbage First Garbage Collector (G1 GC) - Migration to, Expectations and Adva...
 
ClickHouse ReplacingMergeTree in Telecom Apps
ClickHouse ReplacingMergeTree in Telecom AppsClickHouse ReplacingMergeTree in Telecom Apps
ClickHouse ReplacingMergeTree in Telecom Apps
 
MongoDB 101
MongoDB 101MongoDB 101
MongoDB 101
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
 
Top 5 mistakes when writing Spark applications
Top 5 mistakes when writing Spark applicationsTop 5 mistakes when writing Spark applications
Top 5 mistakes when writing Spark applications
 
Introducing Drools
Introducing DroolsIntroducing Drools
Introducing Drools
 
Modules or microservices?
Modules or microservices?Modules or microservices?
Modules or microservices?
 
Apply Hammer Directly to Thumb; Avoiding Apache Spark and Cassandra AntiPatt...
 Apply Hammer Directly to Thumb; Avoiding Apache Spark and Cassandra AntiPatt... Apply Hammer Directly to Thumb; Avoiding Apache Spark and Cassandra AntiPatt...
Apply Hammer Directly to Thumb; Avoiding Apache Spark and Cassandra AntiPatt...
 
Mongo DB 102
Mongo DB 102Mongo DB 102
Mongo DB 102
 
Testing in go
Testing in goTesting in go
Testing in go
 
What it takes to run Hadoop at Scale: Yahoo! Perspectives
What it takes to run Hadoop at Scale: Yahoo! PerspectivesWhat it takes to run Hadoop at Scale: Yahoo! Perspectives
What it takes to run Hadoop at Scale: Yahoo! Perspectives
 
Clickhouse Capacity Planning for OLAP Workloads, Mik Kocikowski of CloudFlare
Clickhouse Capacity Planning for OLAP Workloads, Mik Kocikowski of CloudFlareClickhouse Capacity Planning for OLAP Workloads, Mik Kocikowski of CloudFlare
Clickhouse Capacity Planning for OLAP Workloads, Mik Kocikowski of CloudFlare
 
Traversing Graph Databases with Gremlin
Traversing Graph Databases with GremlinTraversing Graph Databases with Gremlin
Traversing Graph Databases with Gremlin
 
Webinar: MongoDB Schema Design and Performance Implications
Webinar: MongoDB Schema Design and Performance ImplicationsWebinar: MongoDB Schema Design and Performance Implications
Webinar: MongoDB Schema Design and Performance Implications
 
Introducing Delta Live Tables: Make Reliable ETL Easy on Delta Lake
Introducing Delta Live Tables: Make Reliable ETL Easy on Delta LakeIntroducing Delta Live Tables: Make Reliable ETL Easy on Delta Lake
Introducing Delta Live Tables: Make Reliable ETL Easy on Delta Lake
 

Similar to Cracking the Algorithm & Coding Interview

Cracking the Coding interview (Abbreviated) - aug 2016
Cracking the Coding interview (Abbreviated) - aug 2016Cracking the Coding interview (Abbreviated) - aug 2016
Cracking the Coding interview (Abbreviated) - aug 2016
Gayle McDowell
 
Cracking the Coding interview (College)
Cracking the Coding interview (College)Cracking the Coding interview (College)
Cracking the Coding interview (College)
Gayle McDowell
 
How to Hire Software Engineers: Best and Worst Practices
How to Hire Software Engineers: Best and Worst PracticesHow to Hire Software Engineers: Best and Worst Practices
How to Hire Software Engineers: Best and Worst Practices
Gayle McDowell
 
Cracking the PM Interview
Cracking the PM InterviewCracking the PM Interview
Cracking the PM Interview
Gayle McDowell
 
Creating the (Im)perfect Developer Interview
Creating the (Im)perfect Developer InterviewCreating the (Im)perfect Developer Interview
Creating the (Im)perfect Developer Interview
Gayle McDowell
 

Similar to Cracking the Algorithm & Coding Interview (7)

Cracking the Coding interview (Abbreviated) - aug 2016
Cracking the Coding interview (Abbreviated) - aug 2016Cracking the Coding interview (Abbreviated) - aug 2016
Cracking the Coding interview (Abbreviated) - aug 2016
 
Cracking the Coding interview (College)
Cracking the Coding interview (College)Cracking the Coding interview (College)
Cracking the Coding interview (College)
 
How to Hire Software Engineers: Best and Worst Practices
How to Hire Software Engineers: Best and Worst PracticesHow to Hire Software Engineers: Best and Worst Practices
How to Hire Software Engineers: Best and Worst Practices
 
Cracking the PM Interview
Cracking the PM InterviewCracking the PM Interview
Cracking the PM Interview
 
Creating the (Im)perfect Developer Interview
Creating the (Im)perfect Developer InterviewCreating the (Im)perfect Developer Interview
Creating the (Im)perfect Developer Interview
 
Math Gr4 Ch12
Math Gr4 Ch12Math Gr4 Ch12
Math Gr4 Ch12
 
Math Gr4 Ch12
Math Gr4 Ch12Math Gr4 Ch12
Math Gr4 Ch12
 

More from Gayle McDowell

How to Interview Like Google (But Better) - SVCC
How to Interview Like Google (But Better) - SVCCHow to Interview Like Google (But Better) - SVCC
How to Interview Like Google (But Better) - SVCC
Gayle McDowell
 
Cracking the PM Interview
Cracking the PM InterviewCracking the PM Interview
Cracking the PM Interview
Gayle McDowell
 
Cracking the Product Manager Interview
Cracking the Product Manager InterviewCracking the Product Manager Interview
Cracking the Product Manager Interview
Gayle McDowell
 
Prepping Your Engineering Candidates to Reduce Your False Negatives
Prepping Your Engineering Candidates to Reduce Your False NegativesPrepping Your Engineering Candidates to Reduce Your False Negatives
Prepping Your Engineering Candidates to Reduce Your False Negatives
Gayle McDowell
 
Hiring Great Product Managers
Hiring Great Product ManagersHiring Great Product Managers
Hiring Great Product Managers
Gayle McDowell
 
Cracking the Product Manager Interview
Cracking the Product Manager InterviewCracking the Product Manager Interview
Cracking the Product Manager Interview
Gayle McDowell
 
Cracking the Coding Interview
Cracking the Coding InterviewCracking the Coding Interview
Cracking the Coding Interview
Gayle McDowell
 
Reverse Engineering Engineering Interviewing: How to Be a Great Interviewer
Reverse Engineering Engineering Interviewing: How to Be a Great InterviewerReverse Engineering Engineering Interviewing: How to Be a Great Interviewer
Reverse Engineering Engineering Interviewing: How to Be a Great Interviewer
Gayle McDowell
 
Transitioning from Engineering to Product Management
Transitioning from Engineering to Product ManagementTransitioning from Engineering to Product Management
Transitioning from Engineering to Product Management
Gayle McDowell
 
Interviewing Great Developers: Reverse Engineering Interview Coaching to Crea...
Interviewing Great Developers: Reverse Engineering Interview Coaching to Crea...Interviewing Great Developers: Reverse Engineering Interview Coaching to Crea...
Interviewing Great Developers: Reverse Engineering Interview Coaching to Crea...
Gayle McDowell
 
Cracking the Coding & PM Interview (Jan 2014)
Cracking the Coding & PM Interview (Jan 2014)Cracking the Coding & PM Interview (Jan 2014)
Cracking the Coding & PM Interview (Jan 2014)
Gayle McDowell
 

More from Gayle McDowell (11)

How to Interview Like Google (But Better) - SVCC
How to Interview Like Google (But Better) - SVCCHow to Interview Like Google (But Better) - SVCC
How to Interview Like Google (But Better) - SVCC
 
Cracking the PM Interview
Cracking the PM InterviewCracking the PM Interview
Cracking the PM Interview
 
Cracking the Product Manager Interview
Cracking the Product Manager InterviewCracking the Product Manager Interview
Cracking the Product Manager Interview
 
Prepping Your Engineering Candidates to Reduce Your False Negatives
Prepping Your Engineering Candidates to Reduce Your False NegativesPrepping Your Engineering Candidates to Reduce Your False Negatives
Prepping Your Engineering Candidates to Reduce Your False Negatives
 
Hiring Great Product Managers
Hiring Great Product ManagersHiring Great Product Managers
Hiring Great Product Managers
 
Cracking the Product Manager Interview
Cracking the Product Manager InterviewCracking the Product Manager Interview
Cracking the Product Manager Interview
 
Cracking the Coding Interview
Cracking the Coding InterviewCracking the Coding Interview
Cracking the Coding Interview
 
Reverse Engineering Engineering Interviewing: How to Be a Great Interviewer
Reverse Engineering Engineering Interviewing: How to Be a Great InterviewerReverse Engineering Engineering Interviewing: How to Be a Great Interviewer
Reverse Engineering Engineering Interviewing: How to Be a Great Interviewer
 
Transitioning from Engineering to Product Management
Transitioning from Engineering to Product ManagementTransitioning from Engineering to Product Management
Transitioning from Engineering to Product Management
 
Interviewing Great Developers: Reverse Engineering Interview Coaching to Crea...
Interviewing Great Developers: Reverse Engineering Interview Coaching to Crea...Interviewing Great Developers: Reverse Engineering Interview Coaching to Crea...
Interviewing Great Developers: Reverse Engineering Interview Coaching to Crea...
 
Cracking the Coding & PM Interview (Jan 2014)
Cracking the Coding & PM Interview (Jan 2014)Cracking the Coding & PM Interview (Jan 2014)
Cracking the Coding & PM Interview (Jan 2014)
 

Recently uploaded

Andrea Kate Portfolio Presentation.pdf
Andrea Kate  Portfolio  Presentation.pdfAndrea Kate  Portfolio  Presentation.pdf
Andrea Kate Portfolio Presentation.pdf
andreakaterasco
 
Operating system. short answes and Interview questions .pdf
Operating system. short answes and Interview questions .pdfOperating system. short answes and Interview questions .pdf
Operating system. short answes and Interview questions .pdf
harikrishnahari6276
 
han han widi kembar tapi beda han han dan widi kembar tapi sama
han han widi kembar tapi beda han han dan widi kembar tapi samahan han widi kembar tapi beda han han dan widi kembar tapi sama
han han widi kembar tapi beda han han dan widi kembar tapi sama
IrlanMalik
 
欧洲杯投注网站-欧洲杯投注网站推荐-欧洲杯投注网站| 立即访问【ac123.net】
欧洲杯投注网站-欧洲杯投注网站推荐-欧洲杯投注网站| 立即访问【ac123.net】欧洲杯投注网站-欧洲杯投注网站推荐-欧洲杯投注网站| 立即访问【ac123.net】
欧洲杯投注网站-欧洲杯投注网站推荐-欧洲杯投注网站| 立即访问【ac123.net】
foismail170
 
Personal Brand Exploration Comedy Jxnelle.
Personal Brand Exploration Comedy Jxnelle.Personal Brand Exploration Comedy Jxnelle.
Personal Brand Exploration Comedy Jxnelle.
alexthomas971
 
太阳城娱乐-太阳城娱乐推荐-太阳城娱乐官方网站| 立即访问【ac123.net】
太阳城娱乐-太阳城娱乐推荐-太阳城娱乐官方网站| 立即访问【ac123.net】太阳城娱乐-太阳城娱乐推荐-太阳城娱乐官方网站| 立即访问【ac123.net】
太阳城娱乐-太阳城娱乐推荐-太阳城娱乐官方网站| 立即访问【ac123.net】
foismail170
 
皇冠体育- 皇冠体育官方网站- CROWN SPORTS| 立即访问【ac123.net】
皇冠体育- 皇冠体育官方网站- CROWN SPORTS| 立即访问【ac123.net】皇冠体育- 皇冠体育官方网站- CROWN SPORTS| 立即访问【ac123.net】
皇冠体育- 皇冠体育官方网站- CROWN SPORTS| 立即访问【ac123.net】
larisashrestha558
 
Heidi Livengood Resume Senior Technical Recruiter / HR Generalist
Heidi Livengood Resume Senior Technical Recruiter / HR GeneralistHeidi Livengood Resume Senior Technical Recruiter / HR Generalist
Heidi Livengood Resume Senior Technical Recruiter / HR Generalist
HeidiLivengood
 
RECOGNITION AWARD 13 - TO ALESSANDRO MARTINS.pdf
RECOGNITION AWARD 13 - TO ALESSANDRO MARTINS.pdfRECOGNITION AWARD 13 - TO ALESSANDRO MARTINS.pdf
RECOGNITION AWARD 13 - TO ALESSANDRO MARTINS.pdf
AlessandroMartins454470
 
一比一原版(UVic毕业证)维多利亚大学毕业证如何办理
一比一原版(UVic毕业证)维多利亚大学毕业证如何办理一比一原版(UVic毕业证)维多利亚大学毕业证如何办理
一比一原版(UVic毕业证)维多利亚大学毕业证如何办理
pxyhy
 
How to Master LinkedIn for Career and Business
How to Master LinkedIn for Career and BusinessHow to Master LinkedIn for Career and Business
How to Master LinkedIn for Career and Business
ideatoipo
 
一比一原版(YU毕业证)约克大学毕业证如何办理
一比一原版(YU毕业证)约克大学毕业证如何办理一比一原版(YU毕业证)约克大学毕业证如何办理
一比一原版(YU毕业证)约克大学毕业证如何办理
yuhofha
 
Chapters 3 Contracts.pptx Chapters 3 Contracts.pptx
Chapters 3  Contracts.pptx Chapters 3  Contracts.pptxChapters 3  Contracts.pptx Chapters 3  Contracts.pptx
Chapters 3 Contracts.pptx Chapters 3 Contracts.pptx
Sheldon Byron
 
Midterm Contract Law and Adminstration.pptx
Midterm Contract Law and Adminstration.pptxMidterm Contract Law and Adminstration.pptx
Midterm Contract Law and Adminstration.pptx
Sheldon Byron
 
一比一原版(TMU毕业证)多伦多都会大学毕业证如何办理
一比一原版(TMU毕业证)多伦多都会大学毕业证如何办理一比一原版(TMU毕业证)多伦多都会大学毕业证如何办理
一比一原版(TMU毕业证)多伦多都会大学毕业证如何办理
yuhofha
 
Exploring Career Paths in Cybersecurity for Technical Communicators
Exploring Career Paths in Cybersecurity for Technical CommunicatorsExploring Career Paths in Cybersecurity for Technical Communicators
Exploring Career Paths in Cybersecurity for Technical Communicators
Ben Woelk, CISSP, CPTC
 
The Impact of Artificial Intelligence on Modern Society.pdf
The Impact of Artificial Intelligence on Modern Society.pdfThe Impact of Artificial Intelligence on Modern Society.pdf
The Impact of Artificial Intelligence on Modern Society.pdf
ssuser3e63fc
 
原版制作(RMIT毕业证书)墨尔本皇家理工大学毕业证在读证明一模一样
原版制作(RMIT毕业证书)墨尔本皇家理工大学毕业证在读证明一模一样原版制作(RMIT毕业证书)墨尔本皇家理工大学毕业证在读证明一模一样
原版制作(RMIT毕业证书)墨尔本皇家理工大学毕业证在读证明一模一样
atwvhyhm
 
欧洲杯买球平台-欧洲杯买球平台推荐-欧洲杯买球平台| 立即访问【ac123.net】
欧洲杯买球平台-欧洲杯买球平台推荐-欧洲杯买球平台| 立即访问【ac123.net】欧洲杯买球平台-欧洲杯买球平台推荐-欧洲杯买球平台| 立即访问【ac123.net】
欧洲杯买球平台-欧洲杯买球平台推荐-欧洲杯买球平台| 立即访问【ac123.net】
foismail170
 
Interactive Dictionary AIDS-B.pptx aaaaaaaaaaaaaaaaaaaaaaaaaa
Interactive Dictionary AIDS-B.pptx aaaaaaaaaaaaaaaaaaaaaaaaaaInteractive Dictionary AIDS-B.pptx aaaaaaaaaaaaaaaaaaaaaaaaaa
Interactive Dictionary AIDS-B.pptx aaaaaaaaaaaaaaaaaaaaaaaaaa
23211a7274
 

Recently uploaded (20)

Andrea Kate Portfolio Presentation.pdf
Andrea Kate  Portfolio  Presentation.pdfAndrea Kate  Portfolio  Presentation.pdf
Andrea Kate Portfolio Presentation.pdf
 
Operating system. short answes and Interview questions .pdf
Operating system. short answes and Interview questions .pdfOperating system. short answes and Interview questions .pdf
Operating system. short answes and Interview questions .pdf
 
han han widi kembar tapi beda han han dan widi kembar tapi sama
han han widi kembar tapi beda han han dan widi kembar tapi samahan han widi kembar tapi beda han han dan widi kembar tapi sama
han han widi kembar tapi beda han han dan widi kembar tapi sama
 
欧洲杯投注网站-欧洲杯投注网站推荐-欧洲杯投注网站| 立即访问【ac123.net】
欧洲杯投注网站-欧洲杯投注网站推荐-欧洲杯投注网站| 立即访问【ac123.net】欧洲杯投注网站-欧洲杯投注网站推荐-欧洲杯投注网站| 立即访问【ac123.net】
欧洲杯投注网站-欧洲杯投注网站推荐-欧洲杯投注网站| 立即访问【ac123.net】
 
Personal Brand Exploration Comedy Jxnelle.
Personal Brand Exploration Comedy Jxnelle.Personal Brand Exploration Comedy Jxnelle.
Personal Brand Exploration Comedy Jxnelle.
 
太阳城娱乐-太阳城娱乐推荐-太阳城娱乐官方网站| 立即访问【ac123.net】
太阳城娱乐-太阳城娱乐推荐-太阳城娱乐官方网站| 立即访问【ac123.net】太阳城娱乐-太阳城娱乐推荐-太阳城娱乐官方网站| 立即访问【ac123.net】
太阳城娱乐-太阳城娱乐推荐-太阳城娱乐官方网站| 立即访问【ac123.net】
 
皇冠体育- 皇冠体育官方网站- CROWN SPORTS| 立即访问【ac123.net】
皇冠体育- 皇冠体育官方网站- CROWN SPORTS| 立即访问【ac123.net】皇冠体育- 皇冠体育官方网站- CROWN SPORTS| 立即访问【ac123.net】
皇冠体育- 皇冠体育官方网站- CROWN SPORTS| 立即访问【ac123.net】
 
Heidi Livengood Resume Senior Technical Recruiter / HR Generalist
Heidi Livengood Resume Senior Technical Recruiter / HR GeneralistHeidi Livengood Resume Senior Technical Recruiter / HR Generalist
Heidi Livengood Resume Senior Technical Recruiter / HR Generalist
 
RECOGNITION AWARD 13 - TO ALESSANDRO MARTINS.pdf
RECOGNITION AWARD 13 - TO ALESSANDRO MARTINS.pdfRECOGNITION AWARD 13 - TO ALESSANDRO MARTINS.pdf
RECOGNITION AWARD 13 - TO ALESSANDRO MARTINS.pdf
 
一比一原版(UVic毕业证)维多利亚大学毕业证如何办理
一比一原版(UVic毕业证)维多利亚大学毕业证如何办理一比一原版(UVic毕业证)维多利亚大学毕业证如何办理
一比一原版(UVic毕业证)维多利亚大学毕业证如何办理
 
How to Master LinkedIn for Career and Business
How to Master LinkedIn for Career and BusinessHow to Master LinkedIn for Career and Business
How to Master LinkedIn for Career and Business
 
一比一原版(YU毕业证)约克大学毕业证如何办理
一比一原版(YU毕业证)约克大学毕业证如何办理一比一原版(YU毕业证)约克大学毕业证如何办理
一比一原版(YU毕业证)约克大学毕业证如何办理
 
Chapters 3 Contracts.pptx Chapters 3 Contracts.pptx
Chapters 3  Contracts.pptx Chapters 3  Contracts.pptxChapters 3  Contracts.pptx Chapters 3  Contracts.pptx
Chapters 3 Contracts.pptx Chapters 3 Contracts.pptx
 
Midterm Contract Law and Adminstration.pptx
Midterm Contract Law and Adminstration.pptxMidterm Contract Law and Adminstration.pptx
Midterm Contract Law and Adminstration.pptx
 
一比一原版(TMU毕业证)多伦多都会大学毕业证如何办理
一比一原版(TMU毕业证)多伦多都会大学毕业证如何办理一比一原版(TMU毕业证)多伦多都会大学毕业证如何办理
一比一原版(TMU毕业证)多伦多都会大学毕业证如何办理
 
Exploring Career Paths in Cybersecurity for Technical Communicators
Exploring Career Paths in Cybersecurity for Technical CommunicatorsExploring Career Paths in Cybersecurity for Technical Communicators
Exploring Career Paths in Cybersecurity for Technical Communicators
 
The Impact of Artificial Intelligence on Modern Society.pdf
The Impact of Artificial Intelligence on Modern Society.pdfThe Impact of Artificial Intelligence on Modern Society.pdf
The Impact of Artificial Intelligence on Modern Society.pdf
 
原版制作(RMIT毕业证书)墨尔本皇家理工大学毕业证在读证明一模一样
原版制作(RMIT毕业证书)墨尔本皇家理工大学毕业证在读证明一模一样原版制作(RMIT毕业证书)墨尔本皇家理工大学毕业证在读证明一模一样
原版制作(RMIT毕业证书)墨尔本皇家理工大学毕业证在读证明一模一样
 
欧洲杯买球平台-欧洲杯买球平台推荐-欧洲杯买球平台| 立即访问【ac123.net】
欧洲杯买球平台-欧洲杯买球平台推荐-欧洲杯买球平台| 立即访问【ac123.net】欧洲杯买球平台-欧洲杯买球平台推荐-欧洲杯买球平台| 立即访问【ac123.net】
欧洲杯买球平台-欧洲杯买球平台推荐-欧洲杯买球平台| 立即访问【ac123.net】
 
Interactive Dictionary AIDS-B.pptx aaaaaaaaaaaaaaaaaaaaaaaaaa
Interactive Dictionary AIDS-B.pptx aaaaaaaaaaaaaaaaaaaaaaaaaaInteractive Dictionary AIDS-B.pptx aaaaaaaaaaaaaaaaaaaaaaaaaa
Interactive Dictionary AIDS-B.pptx aaaaaaaaaaaaaaaaaaaaaaaaaa
 

Cracking the Algorithm & Coding Interview

  • 1. GayleL.McDowell | Founder/ CEO gayle in/gaylemcdgayle Cracking the Algorithm & Coding Interview SVCC SiliconValleyCodeCamp
  • 2. gayle in/gaylemcdgayleGayle Laakmann McDowell 2 Hi! I’m Gayle LaakmannMcDowell Author Interview Coach Interview Consulting <dev> </dev> (CS) (MBA)
  • 3. Gayle Laakmann McDowell 3gayle in/gaylemcdgayle Yes! Slidesare online! Gayle.com  Click“Events”  Ctrl-F for “SiliconValley”
  • 4. But why? Why why why why why why meeeee 01
  • 5. gayle in/gaylemcdgayle 5 z Gayle Laakmann McDowell What Really Happens
  • 6. Gayle Laakmann McDowell 6gayle in/gaylemcdgayle Why? Strong CS fundamentals Analytical skills Make tradeoffs Push throughhard problems Communication How you think
  • 7. Preparation Why why why why why why meeeee 02
  • 8. gayle in/gaylemcdgayleGayle Laakmann McDowell 8 Essential Knowledge Data Structures Algorithms Concepts ArrayLists Merge Sort BigO Time Hash Tables QuickSort BigO Space Trees(+Tries) Breadth-FirstSearch Recursion Graphs Depth-FirstSearch Memoization/ Dynamic Programming Stacks/ Queues BinarySearch Heaps
  • 9. gayle in/gaylemcdgayleGayle Laakmann McDowell 9 Preparation ImplementDS/Algorithms MASTER BigO Practice with interviewquestions Code on paper/whiteboard Mock interviews PUSHYOURSELF!
  • 10. Expectations & Evaluation Why why why why why why meeeee 03
  • 11. gayle in/gaylemcdgayle 11 z Gayle Laakmann McDowell What is NOT expected To know the answers To solve immediately To code perfectly (It’snice.Itjustdoesn’t happen*.) *Okayfine.Ithappenedonce,in2000+hiringpackets.
  • 12. gayle in/gaylemcdgayle 12 z Gayle Laakmann McDowell What IS expected Be excitedabout hard problems More thanjust “correct” Drive! Keeptrying when stuck Write real code Showmehowyouthink!
  • 13. gayle in/gaylemcdgayle 13 z Gayle Laakmann McDowell How You’re Evaluated RELATIVE Not a “metric” / timer Nooneisperfect!
  • 14. Solving Why why why why why why meeeee 04
  • 15. gayle in/gaylemcdgayle 15 z Gayle Laakmann McDowell How To Approach CrackingTheCodingInterview.com“Resources”
  • 16. gayle in/gaylemcdgayle 16Gayle Laakmann McDowell step Listen (for clues)
  • 17. Gayle Laakmann McDowell 17gayle in/gaylemcdgayle What’sthe clue? Anagram server  Ex: rates ->aster, stare, taser, tears Clue:why is it ona server?
  • 18. gayle in/gaylemcdgayle 18Gayle Laakmann McDowell step Draw an Example Big Enough General Purpose +
  • 19. gayle in/gaylemcdgayleGayle Laakmann McDowell 19 Ex:Intersection ofTwo Sorted Arrays Most people draw somethinglike this: [1, 12, 15, 19] [2, 12, 13, 20]  Toosmall  Toospecial-case-y • same size, one common element, sameindex
  • 20. gayle in/gaylemcdgayleGayle Laakmann McDowell 20 Ex:Intersection ofTwo Sorted Arrays Better: [1, 12, 15, 19, 20, 21] [2, 15, 17, 19, 21, 25, 27]  Big  No specialcases
  • 21. gayle in/gaylemcdgayle 21Gayle Laakmann McDowell step Brute Force / Naive Stupid&terribleisokay!
  • 22. gayle in/gaylemcdgayle 22Gayle Laakmann McDowell step Optimize Walk through brute force Look for optimizations
  • 23. Gayle Laakmann McDowell 23gayle in/gaylemcdgayle Techniques to Develop Algorithms Optimize A. BUD B. Space/time C. Doityourself Solve D. Recursion E. Solve “incorrectly” F. Other data structures Pushyourself!
  • 24. Gayle Laakmann McDowell 24gayle in/gaylemcdgayle (A) Look for BUD Bottlenecks Unnecessary work Duplicated work
  • 25. Gayle Laakmann McDowell 25gayle in/gaylemcdgayle What’s the bottleneck?  Ex: countingthe intersection [1, 12, 15, 19, 20, 21] [2, 15, 17, 19, 21, 25, 27]  Bottleneck:searching B
  • 26. Gayle Laakmann McDowell 26gayle in/gaylemcdgayle What’s unnecessary?  Ex: a3 + b3 = c3 + d3 (1 <=a,b, c, d<= 1000  Unnecessary: looking for d U
  • 27. Gayle Laakmann McDowell 27gayle in/gaylemcdgayle What’s unnecessary?  Ex: a3 + b3 = c3 + d3 (1 <=a,b, c, d<= 1000  Unnecessary: looking for d U
  • 28. Gayle Laakmann McDowell 28gayle in/gaylemcdgayle What’s duplicated?  Ex: a3 + b3 = c3 + d3 (1 <=a,b, c, d<= 1000  Duplicated: c, d pairs D
  • 29. Gayle Laakmann McDowell 29gayle in/gaylemcdgayle What’s duplicated?  Ex: a3 + b3 = c3 + d3 (1 <=a,b, c, d<= 1000  Duplicated: c, d pairs D
  • 30. Gayle Laakmann McDowell 30gayle in/gaylemcdgayle What’s duplicated?  Ex: a3 + b3 = c3 + d3 (1 <=a,b, c, d<= 1000 D
  • 31. Gayle Laakmann McDowell 31gayle in/gaylemcdgayle What’s duplicated?  Ex: a3 + b3 = c3 + d3 (1 <=a,b, c, d<= 1000 D
  • 32. Gayle Laakmann McDowell 32gayle in/gaylemcdgayle (B)Space/TimeTradeoffs Hashtables & other datastructures Precomputing
  • 33. Gayle Laakmann McDowell 33gayle in/gaylemcdgayle Space/Time Tradeoffs Hashtables  Find # pairs withsum INPUT: array = [5, 15, 8, 9, 3, 2, -1, 4] sum = 7 OUTPUT: 3 pairs = (5, 2), (8, -1), (3, 4)  Putitemsinto hashtable
  • 34. Gayle Laakmann McDowell 34gayle in/gaylemcdgayle Space/Time Tradeoffs  Precomputing  Find rectangle at origin w biggest sum 6 5 -9 2 -2 -5 -2 7 3 -2 10 13 -8 -3 1 -2  Brute force: compute all rectanglesand sums
  • 35. Gayle Laakmann McDowell 35gayle in/gaylemcdgayle Space/Time Tradeoffs  Precomputing  Find rectangle with biggest sum 6 5 -9 2 -2 -5 -2 7 3 -2 10 13 -8 -3 1 -2 -+ + 10=
  • 36. Gayle Laakmann McDowell 36gayle in/gaylemcdgayle Space/Time Tradeoffs  Precomputing  Find rectangle with biggest sum 6 5 -9 2 -2 -5 -2 7 3 -2 10 13 -8 -3 1 -2 -+ + 13=
  • 37. Gayle Laakmann McDowell 37gayle in/gaylemcdgayle (C)Do it yourself Findpermutationsof swithinb  s = abbc  b = babcabbacaabcbabcacbb Findthem!  … now how didyou actuallydoit?
  • 38. Gayle Laakmann McDowell 38gayle in/gaylemcdgayle Techniques to Develop Algorithms Optimize A. BUD B. Space/time C. Doityourself Solve D. Recursion E. Solve “incorrectly” F. Other data structures Pushyourself!
  • 39. Gayle Laakmann McDowell 39gayle in/gaylemcdgayle (D) Recursion/ Base Case & Build Subsets of a set  {}  {}  {a}  {}, {a}  {a, b}  {}, {a}, {b}, {a, b}  {a, b, c}  … Subsets of {S1…Sn-1} + Sn to each
  • 40. Gayle Laakmann McDowell 40gayle in/gaylemcdgayle (E) Solve “incorrectly” ① Develop incorrectsolution ② Identifywhy preciselyit’s incorrect ③ Repair ④ (& Repeat)
  • 41. Gayle Laakmann McDowell 41gayle in/gaylemcdgayle (E)Solve “incorrectly” Random node in BST Try: flipcoin Coin=Heads  Branch Left Coin=Tails  Branch Right
  • 42. Gayle Laakmann McDowell 42gayle in/gaylemcdgayle (E)Solve “incorrectly” Random node in BST Try: random number in {0, 1, 2} R=0  Branch Left R=2  Branch Right R=1  Return root
  • 43. Gayle Laakmann McDowell 43gayle in/gaylemcdgayle (E)Solve “incorrectly” Random node in BST Try:  Return rootwith1/n probability  Then flipcoin(heads left,tails->right)
  • 44. Gayle Laakmann McDowell 44gayle in/gaylemcdgayle (E)Solve “incorrectly” Random node in BST Try: pick random # 0 throughn-1 R=0  Return root R>left.size  Branch right 1<=R<=left.size  Branch left
  • 45. Gayle Laakmann McDowell 45gayle in/gaylemcdgayle (F) Other Data Structures Giving outphone numbers  “I wantany availablenumber”  “I wantthisnumber” Try: sorted array?Sorted linkedlist?Hashtable? BST?
  • 46. gayle in/gaylemcdgayle 46Gayle Laakmann McDowell step Walk Through Know the variables andwhen they change
  • 47. gayle in/gaylemcdgayle 47Gayle Laakmann McDowell step Write Beautiful Code
  • 48. Gayle Laakmann McDowell 48gayle in/gaylemcdgayle How to Write WhiteboardCode Modularized Error cases / TODOs Good variables Write straight Top-leftcorner Use arrows if needed Languagechoiceisuptoyou!
  • 49. gayle in/gaylemcdgayleGayle Laakmann McDowell 49 Modularization
  • 50. gayle in/gaylemcdgayle 50Gayle Laakmann McDowell step Testing FIRST Analyze  What’sitdoing?Why?  Anythingthatlooksweird?  Errorhotspots THEN use test cases  Smalltestcases  Edgecases  Bigger testcases
  • 52. gayle in/gaylemcdgayle 52 z Gayle Laakmann McDowell It’s done for a reason! Be a great teammate. Be a great engineer.
  • 53. gayle in/gaylemcdgayleGayle Laakmann McDowell 53 Other Resources Gayle.com CareerCup.com CrackingThe CodingInterview.com Or, follow me online • facebook.com/gayle • twitter.com/gayle • gayle.com • gayle@gayle.com • quora.com