590 likes | 725 Views
Cracking the Coding Interview. Advice and Strategies for Software Engineering Interviews. Gayle Laakmann McDowell Founder / CEO, CareerCup.com Author of The Google Resume and Cracking the Coding Interview. My Background. BSE & MSE in Comp Sci from UPenn
E N D
Cracking the Coding Interview Advice and Strategies for Software Engineering Interviews Gayle Laakmann McDowell Founder / CEO, CareerCup.com Author of The Google Resume and Cracking the Coding Interview McDowell | CareerCup.com
My Background • BSE & MSE in Comp Sci from UPenn • Dev at Google, Microsoft and Apple • plus offers from Amazon, IBM and others • 3 Years on Google Hiring Committee • Interviewed 150+ candidates • Founder of CareerCup.com • Author of Cracking the Coding Interview and The Google Resume McDowell | CareerCup.com
Slides Posted Online posted at: www.technologywoman.com Click “Speaking Engagements” McDowell | CareerCup.com
Interview Process McDowell | CareerCup.com
Big Company Evaluation Testing aptitude, not knowledge McDowell | CareerCup.com
Start-Ups • “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? but… it varies! McDowell | CareerCup.com
Resumes & Application Process McDowell | CareerCup.com
The Career Path Freshmen Sophomores Build a web or mobile app Get a start-up internship Juniors Seniors Join a big company … or a start-up Get a big company job McDowell | CareerCup.com
The Key is to Build Something • Build something! • Course work • Open source • Part-time job • Build web / mobile apps Skills Passion Work Ethic Creativity Initiative Don’t waste your summers! McDowell | CareerCup.com
But… Unless this is on your resume, it doesn’t really matter. So what makes a good resume? McDowell | CareerCup.com
How We Review Resumes • Pull resume out of giant stack • Spot-check: company names, positions, projects, schools. • Skim bullets to see if you’ve written real code. “Glanced at,” not read. 15 – 30 seconds Reject Interview • Go to next resume & whine about how many more you have left. McDowell | CareerCup.com
How CS Resume Should Look Observe: No Objective! Objectives / summaries are almost always useless. One Page Only! Unless > 10 years exp. A Real Resume Format with organized columns Short (1 – 2 line bullets) Focus on Accomplishments not responsibilities GPAif at least 3.0 max (in-major, overall) 3 – 4 Projects Courses & independent Finished or unfinished List of Technical Skills Short! Cut the “fluff.”
“Soft Skills” Interview Prep McDowell | CareerCup.com
Soft Skills Prep • Research the company / team • Prepare ~10 questions to ask your interviewer. • Prepare for questions about yourself But how? McDowell | CareerCup.com
Questions about Your Experience • Create Preparation Grid for Projects + Behavioral Grid [for PM & less tech. roles] McDowell | CareerCup.com
“Soft Skills”Mastering the Interview McDowell | CareerCup.com
Communication Tips • Be concise and structured • Nugget First • S.A.R.: Situation, Action, Result McDowell | CareerCup.com
Structure 1: Nugget First • Lead with your “thesis” / nugget • Grabs the listener’s attention • Gives them context for where you’re going. Q: What accomplishment are you most proud of? A: I’m most proud of search indexer I built for iChat. It required redesigning the file format while also maintaining backwards compatibility. You see, ... McDowell | CareerCup.com
Structure 2: S.A.R. ituation ction esult S What was the issue? A What did you do about it? R What was the impact? McDowell | CareerCup.com
Technical SkillsInterview Prep McDowell | CareerCup.com
How to study • Study the basics • Complex algorithms generally not needed. • Re-learn just the topics you’re struggling with. • Practice solving questions • Don’t memorize problems – too many out there. • See: Cracking the Coding Interview & CareerCup.com • Push yourself! • Really, really try to solve questions on your own. • Write code on paper • Use compiler ONLY when code is written & tested McDowell | CareerCup.com
Data Structures • How to implement • When to use (pros / cons) McDowell | CareerCup.com
Algorithms • Implementation • Space vs. Time Complexity McDowell | CareerCup.com
Concepts • Not just a concept – know how to code! McDowell | CareerCup.com
Technical SkillsMastering the Interview McDowell | CareerCup.com
Types of Questions • Behavioral Questions • Product Design Questions • Estimation Questions • Technical Questions • Coding & Algorithms • Object Oriented Design • Scalability McDowell | CareerCup.com
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?
Product Design Questions • Evaluates: • Communication & Structured Thinking • Ability to understand the user • Creativity • Business instincts / skills
Product Design Qs: Approach • Ask questions to resolve ambiguity • Understand the user • Who is your target user? • What are their problems? • Know your market! • Structure the problem • Solve piece by piece
Product Design Qs: Example How would you design a calculator for the blind? Step 1: Ask Questions • Adults? Children? Professionals? • Where are they using it? • School, work, etc.
Product Design Qs: Example How would you design a calculator for the blind? 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.?
Product Design Qs: Example How would you design a calculator for the blind? Step 3: Structure • List of priorities / needs / essential features • Per user • Discuss ways to address each issue • Pull together into cohesive design
Product Design Qs: Example How would you design a calculator for the blind? Step 4: Structure Step (1): Priorities • Blind child • Usable input / output • Non-disruptive in class • Minimizes “feeling different” • Parent • Both seeing and blind
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?
Estimation Qs: How to Approach • Ask questions to resolve ambiguity • Don’t make assumptions (yet) • Outline / Structure Your Approach • Break down the components • Assume numbers when necessary • State assumptions explicitly • Round numbers to make your math easier • Sanity Check • Do your numbers make sense?
Estimation Qs: Example How much money does Gmail make from ads every year? Step 1: Ambiguous Information • Just in the US? Or Worldwide? • Profit or revenue? • Past year? Or average over history? • Gmail only? Or include Google Apps?
Estimation Qs: Example How much money does Gmail make from ads every year? Step 2: Outline Your Approach • Estimate # of Gmail users • Estimate annual clicks • Top clicks • Side clicks • Estimate $ per click • Top clicks • Side clicks
Estimation Qs: Example How much money does Gmail make from ads every year? Step 3: Break down components Estimate # of Gmail users in the US • Assume 300 million people in the US. • Exclude 0 - 12 years old and 65 - 75 years old • ~ 200 million • Assume 80% of people use email • But 50% only use their work email acct • Assume 80% use a “major” email provider • Gmail, Yahoo, Hotmail, AOL, etc. … and so on …
Estimation Qs: Example How much money does Gmail make from ads every year? Step 4: Validate Numbers • Suppose you get US rev. = $5 billion. • No, because… • Google’s annual revenue is ~$30 billion • $16 / US citizen (not just gmail users)
Technical Questions • Ask Questions! • Questions are more ambiguous than they appear • Talk out loud • Show us how you think • Think critically • Does your algorithm really work? What’s the space and time complexity? • Code slowly and methodically • It’s not a race • Test your code • And make CAREFUL fixes. McDowell | CareerCup.com
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 (defines own if useful) • Concise and readable McDowell | CareerCup.com
Types of Interview Questions “Design a Parking Lot” “Reverse a Linked List” “Design a Web Crawler” McDowell | CareerCup.com
Types of Interview Questions McDowell | CareerCup.com
Algorithm Qs: Pattern Matching 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. McDowell | CareerCup.com
Algorithm Qs: Simplify & Generalize 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. McDowell | CareerCup.com
Algorithm Qs: Base Case & Build 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. McDowell | CareerCup.com
Algorithm Qs: Data Structure Brainstorm 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. McDowell | CareerCup.com
How To Solve Algorithm Questions 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. McDowell | CareerCup.com
Object Oriented Design 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? McDowell | CareerCup.com