Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Cracking the Coding Interview
Advice and Strategies for Software
Engineering Interviews
McDowell | CareerCup.com
July 2013...
TechnicalSkillsBehavioralApplyingProcess
My Background
• Software Engineer @ Google, Microsoft
& Apple
– 3 Years on Google...
TechnicalSkillsBehavioralApplyingProcess
What to Expect
McDowell | CareerCup.com
• 5 - 10 min – Qs about resume
• 40 min –...
TechnicalSkillsBehavioralApplyingProcess Big Company Evaluation (Devs)
Intelligence
Coding
Skills
Personality
Experience
M...
TechnicalSkillsBehavioralApplyingProcess
Start-Ups
• Coding + Intelligence
• “Hit the ground running”
– Do you know “their...
TechnicalSkillsBehavioralApplyingProcess
PM Roles
• Communication Skills
• User-Focused Thinking
• Passion for Technology
...
TechnicalSkillsBehavioralApplyingProcess
How You Are Judged
McDowell | CareerCup.com
How did you do RELATIVE
to other cand...
Resumes & Application Process
McDowell | CareerCup.com
TechnicalSkillsBehavioralApplyingProcess
How to Get an Interview
• Your “Pedigree”
– Education
– Work Experience
– Project...
TechnicalSkillsBehavioralApplyingProcess
How We Review Resumes
1. Pull resume out of giant stack
2. Spot-check: company
na...
How CS Resume
Should Look
Short (1 – 2 line bullets)
3 – 4 Projects
Courses & independent
Finished or unfinished
List of T...
TechnicalSkillsBehavioralApplyingProcess
Talking to Recruiters
• Show:
– What you’ve done (mobile app? Show it!)
– What yo...
Soft Questions
McDowell | CareerCup.com
TechnicalSkillsBehavioralApplyingProcess
Goals of Your Answer
• Answer the question.
• Deliver a good answer.
• Communicat...
TechnicalSkillsBehavioralApplyingProcess
Preparing for Behavioral Qs
• Create Preparation Grid for Projects
McDowell | Car...
TechnicalSkillsBehavioralApplyingProcess
Structure 1: Nugget First
• Lead with your “thesis” / nugget
– Grabs the listener...
TechnicalSkillsBehavioralApplyingProcess
Structure 2: S.A.R.
ituation
ction
esult
McDowell | CareerCup.com
S
A
R
What was ...
TechnicalSkillsBehavioralApplyingProcess Good Questions for Interviewer
McDowell | CareerCup.com
• Qs you want to get answ...
Technical Skills
Interview Prep
McDowell | CareerCup.com
TechnicalSkillsBehavioralApplyingProcess
How to study
• Study the basics
– Complex algorithms generally unnecessary.
• Pra...
TechnicalSkillsBehavioralApplyingProcess
Data Structures
• How to implement
• When to use (pros / cons)
McDowell | CareerC...
TechnicalSkillsBehavioralApplyingProcess
Algorithms
• Implementation
• Space vs. Time
Complexity
McDowell | CareerCup.com
...
TechnicalSkillsBehavioralApplyingProcess
Concepts
• Not just a concept – know how to code!
McDowell | CareerCup.com
Thread...
TechnicalSkillsBehavioralApplyingProcess How to Learn CS Fundamentals?
• Necessary for “elite” tech companies
– Not necess...
Technical Skills
Mastering the Interview
McDowell | CareerCup.com
TechnicalSkillsBehavioralApplyingProcess
Types of “Serious” Questions
1. Product Design Questions
2. Estimation Questions
...
TechnicalSkillsBehavioralApplyingProcess
Product Design Questions
How would you design an
calculator for the blind?
Design...
TechnicalSkillsBehavioralApplyingProcess Product Design Questions: Why?
• Communication & Structured Thinking
• Ability to...
TechnicalSkillsBehavioralApplyingProcess
Product Design Qs: Approach
1. Ask questions to resolve ambiguity
2. Understand t...
TechnicalSkillsBehavioralApplyingProcess
Product Design Qs: Example
Step 1: Ask Questions
• Adults? Children? Professional...
TechnicalSkillsBehavioralApplyingProcess
Product Design Qs: Example
Step 2: Understand the User
• What’s important to a bl...
TechnicalSkillsBehavioralApplyingProcess
Product Design Qs: Example
Step 3: Structure
• Find a structure
– Otherwise, you’...
TechnicalSkillsBehavioralApplyingProcess
Product Design Qs: Example
Step 4: Solve!
How would you design a calculator for t...
TechnicalSkillsBehavioralApplyingProcess
Estimation Questions
How many tennis balls
can fit in an SUV?
How much money does...
TechnicalSkillsBehavioralApplyingProcess
Estimation Qs: Why?
• Problem Solving
• Basic Quantitative Skills
TechnicalSkillsBehavioralApplyingProcess Estimation Qs: How to Approach
1. Ask questions to resolve ambiguity
– Don’t make...
TechnicalSkillsBehavioralApplyingProcess
Estimation Qs: Example
Step 1: Ambiguous Information
• Profit or revenue?
• Past ...
TechnicalSkillsBehavioralApplyingProcess
Estimation Qs: Example
Step 2: Outline Your Approach
(# of users)
x
(# clicks / y...
TechnicalSkillsBehavioralApplyingProcess
Estimation Qs: Example
Step 3: Break down components
Estimate # of Gmail users in...
TechnicalSkillsBehavioralApplyingProcess
Estimation Qs: Example
Step 4: Validate Numbers
• Could revenue be $5 billion?
• ...
TechnicalEstimationProductDesign
CS Questions
• Knowledge Questions
• Coding & Algorithms
• Object Oriented Design
• Scala...
TechnicalEstimationProductDesign
Knowledge & Trivia Questions
• Not key focus at “elite” tech companies.
– If asked, tends...
TechnicalEstimationProductDesign
Coding & Algorithm Questions
1. Ask Questions!
– Questions are more ambiguous than they a...
TechnicalEstimationProductDesign
What does a “good coder” do?
• Be methodical. Don’t try to rush.
• Reasonably Bug Free
– ...
TechnicalEstimationProductDesign
Whiteboard Coding Tips
• Code in the FAR top left corner
• Write small & straight
• Pseud...
TechnicalEstimationProductDesign
“Breath-First” Coding
• Divide problems into sub-components
– Modularize & Structure
• Ex...
TechnicalEstimationProductDesign
Ex: Ransom Note:
“Depth-First” Coding
McDowell | CareerCup.com
TechnicalEstimationProductDesign
Ex: Ransom Note:
“Breadth-First” Coding
McDowell | CareerCup.com
TechnicalEstimationProductDesign
Ex: Ransom Note:
“Breadth-First” Coding
McDowell | CareerCup.com
TechnicalEstimationProductDesign
Ex: Ransom Note:
“Breadth-First” Coding
McDowell | CareerCup.com
TechnicalEstimationProductDesign
Ex: Ransom Note:
“Breadth-First” Coding
McDowell | CareerCup.com
TechnicalEstimationProductDesign
“Breath-First” Coding
• “Depth-First” Coding (One big function)
– Messy
– Time consuming
...
TechnicalEstimationProductDesign
Common Mistakes
• Ignoring information given
• Not using examples
– To design algorithms
...
TechnicalEstimationProductDesign Types of Interview Questions
McDowell | CareerCup.com
Coding & Algorithms Object Oriented...
TechnicalEstimationProductDesign Types of Interview Questions
McDowell | CareerCup.com
Coding & Algorithms
Pattern Matchin...
TechnicalEstimationProductDesign Algorithm Qs: Pattern Matching
McDowell | CareerCup.com
Q: Write code to reverse the orde...
TechnicalEstimationProductDesign Algorithm Qs: Simplify & Generalize
McDowell | CareerCup.com
Coding & Algorithms
Pattern ...
TechnicalEstimationProductDesign Algorithm Qs: Base Case & Build
McDowell | CareerCup.com
Coding & Algorithms
Pattern Matc...
TechnicalEstimationProductDesign Algorithm Qs: Data Structure Brainstorm
McDowell | CareerCup.com
Coding & Algorithms
Patt...
TechnicalEstimationProductDesign
Coding & Algorithms
Pattern Matching
Simplify & Generalize
Base Case & Build
Data Structu...
TechnicalEstimationProductDesign Object Oriented Design
McDowell | CareerCup.com
Handle Ambiguity
What about the question ...
TechnicalEstimationProductDesign
Coding & Algorithms Object Oriented Design System Design
Object Oriented Design
McDowell ...
TechnicalEstimationProductDesign System Design
McDowell | CareerCup.com
Handle Ambiguity
What about the question is ambigu...
TechnicalEstimationProductDesign System Design
McDowell | CareerCup.com
Handle Ambiguity
Do the words need to be in a spec...
TechnicalEstimationProductDesign Whew! All Done!
McDowell | CareerCup.com
<Gulp> This is a lot of
stuff. Do I need to get
...
TechnicalSkillsBehavioralApplyingProcess
<Gulp> This is a lot of
stuff. Do I need to get
everything right?
</Gulp>
McDowel...
TechnicalSkillsBehavioralApplyingProcess
So RELAX!
Interviews are supposed to be hard!
Everyone makes mistakes.
Everyone!
...
TechnicalSkillsBehavioralApplyingProcess
After Your Interview
• Follow-up with your recruiter
– No response != rejection
•...
TechnicalSkillsBehavioralApplyingProcess
Other Resources
McDowell | CareerCup.com
CareerCup.com
• Interview Videos
• iPhon...
Upcoming SlideShare
Loading in …5
×

Cracking the Coding Interview (Oct 2012)

10,368 views

Published on

Cracking the Coding Interview (http://www.amazon.com/dp/098478280X) is the #1 best selling interview book on Amazon.

Cracking the Coding Interview gives you the interview preparation you need to get the top software developer jobs. This is a deeply technical book and focuses on the software engineering skills to ace your interview. The book is over 500 pages and includes 150 programming interview questions and answers, as well as other advice.

Published in: Technology, Business
  • Be the first to comment

Cracking the Coding Interview (Oct 2012)

  1. 1. Cracking the Coding Interview Advice and Strategies for Software Engineering Interviews McDowell | CareerCup.com July 2013 Gayle Laakmann McDowell Founder / CEO, CareerCup.com Author of The Google Resume and Cracking the Coding Interview
  2. 2. TechnicalSkillsBehavioralApplyingProcess My Background • Software Engineer @ Google, Microsoft & Apple – 3 Years on Google Hiring Committee – Interviewed 150+ candidates • Founder of CareerCup.com • Author – Cracking the Coding Interview – The Google Resume McDowell | CareerCup.com
  3. 3. TechnicalSkillsBehavioralApplyingProcess What to Expect McDowell | CareerCup.com • 5 - 10 min – Qs about resume • 40 min – technical Qs – Coding and algorithms • 5 – 10 min – let you ask Qs, general wrap up, etc
  4. 4. TechnicalSkillsBehavioralApplyingProcess Big Company Evaluation (Devs) Intelligence Coding Skills Personality Experience McDowell | CareerCup.com Testing aptitude, not knowledge
  5. 5. TechnicalSkillsBehavioralApplyingProcess Start-Ups • Coding + Intelligence • “Hit the ground running” – Do you know “their” technologies? • Entrepreneurial – Have you started things? – How much direction do you need? • Personality – Will you fit with the team? McDowell | CareerCup.com but… it varies!
  6. 6. TechnicalSkillsBehavioralApplyingProcess PM Roles • Communication Skills • User-Focused Thinking • Passion for Technology • Analytical Skills • Technical Skills (position dependent) McDowell | CareerCup.com
  7. 7. TechnicalSkillsBehavioralApplyingProcess How You Are Judged McDowell | CareerCup.com How did you do RELATIVE to other candidates on the SAME question? … it’s about how quickly you solved it relative to other candidates. It’s not about how quickly you solved the problem…
  8. 8. Resumes & Application Process McDowell | CareerCup.com
  9. 9. TechnicalSkillsBehavioralApplyingProcess How to Get an Interview • Your “Pedigree” – Education – Work Experience – Projects – Github / Online Profile • Make a kick-ass resume McDowell | CareerCup.com
  10. 10. TechnicalSkillsBehavioralApplyingProcess How We Review Resumes 1. Pull resume out of giant stack 2. Spot-check: company names, positions, projects, schoo ls. 3. Skim bullets to see if you’ve written real code. McDowell | CareerCup.com InterviewReject 4. Go to next resume & whine about how many more you have left. “Glanced at,” not read. 15 – 30 seconds
  11. 11. How CS Resume Should Look Short (1 – 2 line bullets) 3 – 4 Projects Courses & independent Finished or unfinished List of Technical Skills Short! Cut the “fluff.” GPA if at least 3.0 max (in-major, overall) One Page Only! Unless > 10 years exp. A Real Resume Format with organized columns Focus on Accomplishments not responsibilities Observe: No Objective! Objectives / summaries are almost always useless.
  12. 12. TechnicalSkillsBehavioralApplyingProcess Talking to Recruiters • Show: – What you’ve done (mobile app? Show it!) – What you’re excited about • Have a “pitch” ready • Weird is okay – (arrogant is not) McDowell | CareerCup.com
  13. 13. Soft Questions McDowell | CareerCup.com
  14. 14. TechnicalSkillsBehavioralApplyingProcess Goals of Your Answer • Answer the question. • Deliver a good answer. • Communicate well. – Nugget First – S.A.R.: Situation, Action, Result McDowell | CareerCup.com
  15. 15. TechnicalSkillsBehavioralApplyingProcess Preparing for Behavioral Qs • Create Preparation Grid for Projects McDowell | CareerCup.com OS Project Amazon Intern. Enjoyed Hated Most Challenging Hardest Bug + Behavioral Grid [for PM & less tech. roles]
  16. 16. TechnicalSkillsBehavioralApplyingProcess Structure 1: Nugget First • Lead with your “thesis” / nugget – Grabs the listener’s attention – Gives them context for where you’re going. McDowell | CareerCup.com A: I’m most proud of the way I re-architected the … Q: What accomplishment are you most proud of?
  17. 17. TechnicalSkillsBehavioralApplyingProcess Structure 2: S.A.R. ituation ction esult McDowell | CareerCup.com S A R What was the issue? What did you do about it? What was the impact?
  18. 18. TechnicalSkillsBehavioralApplyingProcess Good Questions for Interviewer McDowell | CareerCup.com • Qs you want to get answered – How decisions get made – Interaction betw devs, PMs, testers • Qs that show interest / passion – What’s the architecture like? • Qs that show knowledge / aptitude – How did you solve problem with ___? Don’t worry too much about this stuff
  19. 19. Technical Skills Interview Prep McDowell | CareerCup.com
  20. 20. TechnicalSkillsBehavioralApplyingProcess How to study • Study the basics – Complex algorithms generally unnecessary. • Practice solving questions – Don’t memorize! – See: CtCI & CareerCup.com • Push yourself! • Write code on paper McDowell | CareerCup.com
  21. 21. TechnicalSkillsBehavioralApplyingProcess Data Structures • How to implement • When to use (pros / cons) McDowell | CareerCup.com Linked Lists Stacks Queues Trees Tries Graphs Vectors Heaps Hashtables
  22. 22. TechnicalSkillsBehavioralApplyingProcess Algorithms • Implementation • Space vs. Time Complexity McDowell | CareerCup.com Quick Sort Merge Sort Tree Insert / Find Binary Search Breadth-First Search Depth-First Search
  23. 23. TechnicalSkillsBehavioralApplyingProcess Concepts • Not just a concept – know how to code! McDowell | CareerCup.com Threading Big-O Time / Space Memory Management Recursion Probability + Combinatorics Bit Manipulation
  24. 24. TechnicalSkillsBehavioralApplyingProcess How to Learn CS Fundamentals? • Necessary for “elite” tech companies – Not necessarily otherwise (check interview questions) • MIT Open Courseware – Freshman / sophomore level DS & Algo courses • Books – CLRS (Algorithms) • Online tutorials • Practice implementing and using McDowell | CareerCup.com
  25. 25. Technical Skills Mastering the Interview McDowell | CareerCup.com
  26. 26. TechnicalSkillsBehavioralApplyingProcess Types of “Serious” Questions 1. Product Design Questions 2. Estimation Questions 3. Software Engineering Questions – Coding & Algorithms – Object Oriented Design – Scalability – Factual / Trivia / Language-Based McDowell | CareerCup.com
  27. 27. TechnicalSkillsBehavioralApplyingProcess Product Design Questions How would you design an calculator for the blind? Design an elevator for a building. Pick a Google product. How would you improve it?
  28. 28. TechnicalSkillsBehavioralApplyingProcess Product Design Questions: Why? • Communication & Structured Thinking • Ability to understand the user • Creativity • Business instincts / skills
  29. 29. TechnicalSkillsBehavioralApplyingProcess Product Design Qs: Approach 1. Ask questions to resolve ambiguity 2. Understand the user 3. Structure the problem 4. Solve piece by piece
  30. 30. TechnicalSkillsBehavioralApplyingProcess Product Design Qs: Example Step 1: Ask Questions • Adults? Children? Professionals? • Where are they using it? – School, work, etc. How would you design a calculator for the blind?
  31. 31. TechnicalSkillsBehavioralApplyingProcess Product Design Qs: Example Step 2: Understand the User • What’s important to a blind child? – Keeping up with the rest of the class – Not feeling “different” – Efficient input / output • What about teachers, parents, classmates, etc.? How would you design a calculator for the blind?
  32. 32. TechnicalSkillsBehavioralApplyingProcess Product Design Qs: Example Step 3: Structure • Find a structure – Otherwise, you’re just blabbering • One approach: 1. Make list of functions necessary 2. Discuss how to do input / output 3. Usability for non-blind 4. Summary How would you design a calculator for the blind?
  33. 33. TechnicalSkillsBehavioralApplyingProcess Product Design Qs: Example Step 4: Solve! How would you design a calculator for the blind?
  34. 34. TechnicalSkillsBehavioralApplyingProcess Estimation Questions How many tennis balls can fit in an SUV? How much money does Gmail make from ads every year? How much do New Yorkers spend on electricity each year?
  35. 35. TechnicalSkillsBehavioralApplyingProcess Estimation Qs: Why? • Problem Solving • Basic Quantitative Skills
  36. 36. TechnicalSkillsBehavioralApplyingProcess Estimation Qs: How to Approach 1. Ask questions to resolve ambiguity – Don’t make assumptions (yet) 2. Outline / Structure Your Approach 3. Break down the components – Assume numbers when necessary – State assumptions explicitly – Round numbers to make your math easier 4. Sanity Check – Do your numbers make sense?
  37. 37. TechnicalSkillsBehavioralApplyingProcess Estimation Qs: Example Step 1: Ambiguous Information • Profit or revenue? • Past year? Or average over history? • Gmail only? Or include Google Apps? How much money does Gmail make from ads every year?
  38. 38. TechnicalSkillsBehavioralApplyingProcess Estimation Qs: Example Step 2: Outline Your Approach (# of users) x (# clicks / year) x ( $ / click ) How much money does Gmail make from ads every year?
  39. 39. TechnicalSkillsBehavioralApplyingProcess Estimation Qs: Example Step 3: Break down components Estimate # of Gmail users in the US 1. Assume 300 million people in the US. – Exclude 0 - 12 years old and 65 - 75 years old –  ~ 200 million 2. Assume 80% of people use email 3. 80% of those have non-work account … and so on … How much money does Gmail make from ads every year?
  40. 40. TechnicalSkillsBehavioralApplyingProcess Estimation Qs: Example Step 4: Validate Numbers • Could revenue be $5 billion? • No, because… – Google’s annual revenue is ~$40 billion – $16 / US citizen (not just Gmail users) How much money does Gmail make from ads every year?
  41. 41. TechnicalEstimationProductDesign CS Questions • Knowledge Questions • Coding & Algorithms • Object Oriented Design • Scalability McDowell | CareerCup.com
  42. 42. TechnicalEstimationProductDesign Knowledge & Trivia Questions • Not key focus at “elite” tech companies. – If asked, tends to focus more on DS knowledge than language knowledge • If you don’t know, try to deduce the answer – How would language designer do it? etc McDowell | CareerCup.com
  43. 43. TechnicalEstimationProductDesign Coding & Algorithm Questions 1. Ask Questions! – Questions are more ambiguous than they appear 2. Talk out loud – Show us how you think 3. Think critically – Does your algorithm really work? What’s the space and time complexity? 4. Code slowly and methodically – It’s not a race 5. Test your code – And make CAREFUL fixes. McDowell | CareerCup.com If you’ve heard a question before, admit it.
  44. 44. TechnicalEstimationProductDesign What does a “good coder” do? • Be methodical. Don’t try to rush. • Reasonably Bug Free – Thorough testing (and careful fixing) – Check for error conditions • Clean coding – Use other functions – Good use of data structures (define own if useful) – Concise and readable McDowell | CareerCup.com
  45. 45. TechnicalEstimationProductDesign Whiteboard Coding Tips • Code in the FAR top left corner • Write small & straight • Pseudocode if you’d like • Use arrows to insert new code snippets – Erasing wastes time • Use “good” variable names, then abbreviate • “Breadth-First” Coding McDowell | CareerCup.com
  46. 46. TechnicalEstimationProductDesign “Breath-First” Coding • Divide problems into sub-components – Modularize & Structure • Ex: Ransom Note – Write as one big function? – OR… modularize! McDowell | CareerCup.com
  47. 47. TechnicalEstimationProductDesign Ex: Ransom Note: “Depth-First” Coding McDowell | CareerCup.com
  48. 48. TechnicalEstimationProductDesign Ex: Ransom Note: “Breadth-First” Coding McDowell | CareerCup.com
  49. 49. TechnicalEstimationProductDesign Ex: Ransom Note: “Breadth-First” Coding McDowell | CareerCup.com
  50. 50. TechnicalEstimationProductDesign Ex: Ransom Note: “Breadth-First” Coding McDowell | CareerCup.com
  51. 51. TechnicalEstimationProductDesign Ex: Ransom Note: “Breadth-First” Coding McDowell | CareerCup.com
  52. 52. TechnicalEstimationProductDesign “Breath-First” Coding • “Depth-First” Coding (One big function) – Messy – Time consuming – Poor coding style • “Breadth-First” Coding (Modularized) – “Finishes” algorithm immediately – Often allows you to skip details – Easier to test & fix issues – Demonstrates good coding style – Keeps YOU organized McDowell | CareerCup.com
  53. 53. TechnicalEstimationProductDesign Common Mistakes • Ignoring information given • Not using examples – To design algorithms – While writing code • “Pushing through” code when confused – Incoherent thoughts -> incoherent code • Diving into code too quickly • The details: – Off-by-one, < vs <=, division (and any math) McDowell | CareerCup.com
  54. 54. TechnicalEstimationProductDesign Types of Interview Questions McDowell | CareerCup.com Coding & Algorithms Object Oriented Design System Design “Reverse a Linked List” “Design a Parking Lot” “Design a Web Crawler”
  55. 55. TechnicalEstimationProductDesign Types of Interview Questions McDowell | CareerCup.com Coding & Algorithms Pattern Matching Simplify & Generalize Base Case & Build Data Structure Brainstorm Object Oriented Design System Design
  56. 56. TechnicalEstimationProductDesign Algorithm Qs: Pattern Matching McDowell | CareerCup.com Q: Write code to reverse the order of words in a sentence. “dogs are cute” “cute are dogs” Similar to: reverse characters in a string. “dogs are cute” “etuc era sgod” A: Reverse full string, then reverse each word. Coding & Algorithms Pattern Matching Simplify & Generalize Base Case & Build Data Structure Brainstorm Object Oriented Design System Design
  57. 57. TechnicalEstimationProductDesign Algorithm Qs: Simplify & Generalize McDowell | CareerCup.com Coding & Algorithms Pattern Matching Simplify & Generalize Base Case & Build Data Structure Brainstorm Object Oriented Design System Design Q: Design algorithm to figure out if you can build a ransom note (array of strings) from a magazine (array of strings). Simplify: what if we used characters instead of strings?  Build array of character frequencies. Generalize: how we can extend answer to words? A: Build hashtable from word to frequency.
  58. 58. TechnicalEstimationProductDesign Algorithm Qs: Base Case & Build McDowell | CareerCup.com Coding & Algorithms Pattern Matching Simplify & Generalize Base Case & Build Data Structure Brainstorm Object Oriented Design System Design Q: Design algorithm to print subsets of set. {a, b, c}  {}, {a}, {b}, {c}, {a, b}, {a, c}, {b, c}, {a, b, c} S({})  {} S({a})  {}, {a} S({a, b})  {}, {a}, {b}, {a, b} S({a, b, c})  ? A: Build S(n) by cloning S(n-1) and adding n to the cloned sets.
  59. 59. TechnicalEstimationProductDesign Algorithm Qs: Data Structure Brainstorm McDowell | CareerCup.com Coding & Algorithms Pattern Matching Simplify & Generalize Base Case & Build Data Structure Brainstorm Object Oriented Design System Design Q: There are 10^10 possible phone #s. Explain how you could efficiently implement assignSpecificNum(num) and assignAnyAvailableNum(). Array (sorted)? Too slow to remove num. Linked list? Too slow to find specific num. Hash table? Can’t iterate through free nums. Tree? Ah-ha! A: Store free #s in BST. Remove when taken.
  60. 60. TechnicalEstimationProductDesign Coding & Algorithms Pattern Matching Simplify & Generalize Base Case & Build Data Structure Brainstorm Object Oriented Design System Design How To Solve Algorithm Questions McDowell | CareerCup.com Compare to similar problems. Solve first for a simplified / tweaked problem. Solve for n = 1, and build solution for n = 2. Try to apply data structure to solve problem.
  61. 61. TechnicalEstimationProductDesign Object Oriented Design McDowell | CareerCup.com Handle Ambiguity What about the question is ambiguous? Design the Core Objects What are the main objects in the system? Analyze Relationships How are the objects related to each other? Investigate Actions What are the main operations? Coding & Algorithms Object Oriented Design System Design
  62. 62. TechnicalEstimationProductDesign Coding & Algorithms Object Oriented Design System Design Object Oriented Design McDowell | CareerCup.com Handle Ambiguity Is it a single restaurant, or part of a chain? Design the Core Objects Guest, Party, Table, Server, Host, … Analyze Relationships Server and Host are both Employees… Investigate Actions A Party is seated at a Table by a Host… How would you design the data structures and objects for a restaurant?
  63. 63. TechnicalEstimationProductDesign System Design McDowell | CareerCup.com Handle Ambiguity What about the question is ambiguous? Make Believe Pretend there wasn’t so much data & solve Get Real Go back to the real problem. What breaks? Solve Problems Solve the issues you just found. Coding & Algorithms Object Oriented Design System Design
  64. 64. TechnicalEstimationProductDesign System Design McDowell | CareerCup.com Handle Ambiguity Do the words need to be in a specific order? Make Believe Assume everything can fit on one machine. Get Real Must split up data across machines. Solve Problems Divide hash table by file or by keyword? Given millions of documents, find all documents which contain a list of words. Coding & Algorithms Object Oriented Design System Design
  65. 65. TechnicalEstimationProductDesign Whew! All Done! McDowell | CareerCup.com <Gulp> This is a lot of stuff. Do I need to get everything right? Coding & Algorithms Pattern Matching Simplify & Generalize Base Case & Build Data Structure Brainstorm Object Oriented Design System Design
  66. 66. TechnicalSkillsBehavioralApplyingProcess <Gulp> This is a lot of stuff. Do I need to get everything right? </Gulp> McDowell | CareerCup.com Evaluation is RELATIVE, not absolute. … it’s about how quickly you solved it relative to other candidates. It’s not about how quickly you solved the problem…
  67. 67. TechnicalSkillsBehavioralApplyingProcess So RELAX! Interviews are supposed to be hard! Everyone makes mistakes. Everyone! McDowell | CareerCup.com
  68. 68. TechnicalSkillsBehavioralApplyingProcess After Your Interview • Follow-up with your recruiter – No response != rejection • You have no idea how well/poorly you did. – Seriously. I know you think you do. But you don’t. • Lots of randomness. – So if you fail, get up and try again. McDowell | CareerCup.com
  69. 69. TechnicalSkillsBehavioralApplyingProcess Other Resources McDowell | CareerCup.com CareerCup.com • Interview Videos • iPhone App • Resume Review • Mock Interviews Or, follow me online at… • twitter.com/gayle • facebook.com/gayle • technologywoman.com • gayle@careercup.com

×