1 / 57

CRACKING THE CODING INTERVIEW Nitish Upreti

CRACKING THE CODING INTERVIEW Nitish Upreti. Nitish Upreti @nitish http:// niti.sh /. Feedback Please ! ( I am a Data Junkie… ) www.meet.ps. Why this Talk? Why should you care ?. For the love of Computer Science …. Building Amazing Products. Working with the best of People….

nelia
Download Presentation

CRACKING THE CODING INTERVIEW Nitish Upreti

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CRACKING THE CODING INTERVIEWNitish Upreti

  2. Nitish Upreti@nitishhttp://niti.sh/

  3. Feedback Please !( I am a Data Junkie… )www.meet.ps

  4. Why this Talk?Why should you care ?

  5. For the love of Computer Science …

  6. Building Amazing Products

  7. Working with the best of People…

  8. Have an Impact !

  9. Head start in Building your career …

  10. Money & Free Food ?

  11. Start Your own Company ?

  12. Working for the Top Technology Companies.(Computer Science-Engineering majors are most pampered and well paid…)

  13. Easy : Just clear the coding interview ?

  14. Or Not ?

  15. Some of us are scared !How does the interview work?What do they judge me on?Do’s / Don’ts

  16. Are these interviews fair?Can you judge someone in few hours or a day?

  17. Think of Interviews as acing SATs / GREs …(Whether they are any good is debatable!)

  18. GAME PLAN : 1. Study all my subjects well.2. Finish all Assignments/Projects.3. Get an awesome GPA.

  19. There is more to it …

  20. Would you practice for a Sprint by running marathons each day?

  21. Preparations Matter!“Sweat now so you don't bleed later.” Take Away….

  22. Lets get cracking!

  23. Before the Interview…

  24. How to get interviews at the first place? • Career fairs. • Referrals from friends and seniors. (Almost guarantees an interview) • Be active on LinkedIn. • Visit Hackathons. • Start competing on HackerRank / TopCoder. • Email cto_first_name / ceo_first_name @startup

  25. Quick Preliminaries • Perfect your resume (No spelling mistakes / grammar errors) ACM provides help! • Prepare Behavioral Questions

  26. So I got the call 

  27. How does the Interview Process work ?( At least for the Popular Ones …. )

  28. Interview Process • Starts with an Email Conversation. • Scheduling day/time for Phone or Campus screening • Internships : Usually 2 telephonic rounds. • Full time : 5-7 interviews • PSU Microsoft experience is an exception when it comes to interviews. (Why?) • You are notified in a couple of weeks. • Details are in the Book!

  29. How should I prepare ?

  30. White Board Coding….(Without the cozy compiler : Marathon and Sprint metaphor again!)

  31. Whatshould I prepare?

  32. Almost Comprehensive List … • Elementary DS : • Arrays, Stacks & Queues • Linked Lists • Trees ( Binary Trees, Binary Search Trees) • Hash Tables • Asymptotic Analysis • Sorting with their Runtimes. • Recursion ! • String Problems • Good to know : TRIE and Priority Queue ( BinaryHeap)

  33. Advanced • Divide and Conquer Algorithms. • Greedy Algorithms • Dynamic Programming • Graph Algorithms • Some Design Problems

  34. During the Interview …

  35. Key things to keep in mind • All questions are language independent. • Start Talking ( Interviewers nudge you towards the right direction ) • Think before you start / Don’t rush. • Propose a variety of solutions idea before settling on coding a particular idea. • Sound Enthusiastic ! • Ask questions in the end : How do you work? What do you work on?

  36. Make Or Break it ! • Think about Corner cases. • Test your code once your done. • Be Space / Time Efficient. ( Distinguishes a Good Vs Bad Interview)

  37. Lets dissect a real interview question !

  38. Given a set of integers, is there a subset of size k whose sum is zero?Array = { 3, 9, 1 , 6 , 0, 2 }Sum = 8

  39. I am STUMPED !

  40. Let us start talking ….

  41. Brute Force Anyone ? Find all the possible sums and if the given sum is one of them, we have a solution! Brute Force could be a good start. Don’t code it yet !

  42. Runtime Analysis ? O ( N2 )

  43. Can we do better?At Google’s scale there will be Billion Numbers !

  44. Sorting + Binary Search ? O (N log N) + O (log N)

  45. Can we do Even Better?

  46. How about a Hash Table Solution?First Passes :Create a Map (HashMap)Array = { 3, 9, 1 , 6 , 0, 2 }Hash = { (3,T) (9,T) (1,T) (6,T) (0,T)(2,T) }Scan through the keys & look for remainder.

  47. Corner Case : Duplicate Elements ! Array = { 3, 9, 1 , 6 , 0, 4 }Hash = { (3,T) (9,T) (1,T) (6,T) (0,T)(4,T) } Solution : Store Count !

  48. Complexity ? Time : O ( N ) Space : O ( N )

More Related