Skip to content

freephys/crackingthecodinginterview

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

70 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

crackingthecodinginterview

Build Status Coverage Status

This repository contains solutions to the interview problems from "Cracking the Coding Interview" by Gayle Laakmann McDowell. The book comes with solutions and Java code, but I thought it would be a good exercise to code up my own solutions in Python. The book contains more than the actual interview problems: resume preparation and interview tips, and inside info about how some of the major companies do their hiring. I thoroughly recommend it.

Running the Solutions

Each module corresponds to a chapter of the book. Within each module, files named problemX.py contain solutions to problem X. Some files contain main functions, so you can run them, for example:

cd chapter1
python problem1.py

Files named testX.py contain unit tests for problem X. To run the unit tests, you need first need to install nosetests and mock:

pip install nose mock

To run the tests for a particular chapter:

cd chapter1
nosetests test1.py

You can also run all the tests by:

nosetests

Found a Bug?

If you've found a bug or a test case that I'm not covering, please submit a pull request.

Debugging

If one of the test cases is failing or tripping over an error, you can drop into pdb by re-running nose:

nosetests --pdb

If you'd like to step through a test case from the beginning, add the following line to the test case:

import pdb; pdb.set_trace()

and re-run nose:

nosetests --nocapture

About

My solutions to "Cracking the Coding Interview"

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%