Giter Site home page Giter Site logo

robchambers / coding_interview_ref_algos Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 15 KB

Reference implementations of key algorithms, suitable for coding interviews and easy to extend/adapt for specific problems..

License: MIT License

Python 100.00%

coding_interview_ref_algos's Introduction

coding_interview_ref_algos

Reference implementations of key algorithms, suitable for coding interviews and easy to extend/adapt for specific problems.

I adapted these from various sources while preparing for coding interviews during a job search (successful!).

Here's the idea:

  • I found that almost all coding questions used one of several basic algos.
  • But, even though I knew those algos, I was spending too much time re-writing them during interviews, and I was making too many mistakes.
  • So, I created these reference algorithms.
  • I practiced them until I could type them out, from memory, quickly and without errors, and I used them in all of my interview prep.

Here's how I recommend practicing them:

  • Pick an algorithm (ref_*.py). Make sure you understand it via whatever class/bootcamp/book you're using (see below for suggestions).
  • Copy it into practice.py.
  • In practice.py, delete part or all of the code above def test():.
  • If you try to run the file now, it will fail, of course.
  • Now, try to re-write the algorithm, exactly, from memory.
    • If you get stuck, look at the original copy, and read ahead to try to re-memorize it.
    • Just try to minimize how often you have to look at it.
  • Once you've re-written it, try to run the file, and make sure the 'tests' pass.
  • If you had to 'cheat' and look at the original copy, then once it runs, just start over with that same algo.
  • Keep starting over with that same file until you can write it quickly, without errors, so that practice.py is exactly the same as the source file.
  • Each day, do this with one or more algorithms. Each time, it should go faster, until you can basically write them out at the speed you type.
  • As you practice your coding interview questions (e.g., at leetcode), try your best to adapt these reference algos to the problem at hand.

I found this to be incredibly effective. Interviewers are really impressed when you can type out an algorithm like BFS or DFS very quickly, cleanly, and without errors. Then, you have the mental bandwidth to engage with the details of the actual interview problem.

Other resources

  • I strongly recommend the course at Interview Camp ( https://interviewcamp.io/ ). These algos are adapted quite closely to that course, and you'll get the most mileage out of them if you use the two together.
  • Practice tons of questions at Leetcode ( https://leetcode.com/ ). Just buy the premium membership; it's such a small cost compared to the benefits of acing these interviews.
  • Practice a few live interviews at Pramp ( https://www.pramp.com/ ), a free peer-to-peer platform for practicing coding questions. It will help you practice your pacing, get over your nerves, and see what if feels like to be on the other side of the table.

coding_interview_ref_algos's People

Contributors

robchambers avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.