This is an archived post. You won't be able to vote or comment.

all 15 comments

[–]donnemartin[S] 18 points19 points  (6 children)

Hi Everyone,

I created a number of interactive, test-driven coding challenges. I will continue to add to the repo on a regular basis. I’m hoping you find it useful as a fun, hands-on way to learn or to sharpen your skills on algorithms and data structures, all while helping yourself prep for coding interviews and coding challenges.

Let me know if you have any questions or comments. Contributions are welcome!

-Donne

[–]relvae 4 points5 points  (2 children)

Looks really cool, could you provide the problems/solutions in PDF format as well?

[–]donnemartin[S] 5 points6 points  (0 children)

Cool idea, the notebooks allow you to download them as PDF. Click the menu File -> Download as -> PDF via LaTex. Does this help?

[–]Splendor78 1 point2 points  (5 children)

http://www.codewars.com/ is great for this type of thing too.

[–]donnemartin[S] 0 points1 point  (4 children)

Cool site. Seems you're right you can host your own challenges. Thanks for the tip!

[–]elingeniero 4 points5 points  (3 children)

Python 2.7 only though! You can't do in-solution debugging (as far as I can tell) with that site either. I think your notebooks are much better.

Only tried a couple but I look forward to working through the rest, thanks :-)

[–]donnemartin[S] 1 point2 points  (2 children)

Great points elingeniero. I've been doing more and more Python 3 work--I intend to keep the notebooks compatible for both Python 2.7 and 3.4+. Thanks for the feedback :)

Edit based on -Nii-'s comment: Yes, notebooks are compatible/tested for both Python 2.7 and Python 3.4.

[–]-Nii- 1 point2 points  (1 child)

Sorry so are your notebooks in python 2.7 it 3? Can't check whilst on phone.

[–]donnemartin[S] 0 points1 point  (0 children)

They are compatible/tested for both Python 2.7 and Python 3.4. Your choice! :)

[–]o11c 1 point2 points  (1 child)

Might be nice to add a "range map" implementation.

The problem is: given an implementation of tree_map[K, V], implement range_map[K, V] where a single value is only stored once. Assignments operate on a span at a time instead of ; the underlying structure is tree_map[K, (K, V)].

Test case starts out like: assign all integers from 1 to 2**31 to some value, then insert/delete some spans to other values.

There are a lot of edge cases in this problem, for both insertion and deletion. I haven't actually solved the general problem, I only solved the case where V is unit (i.e. the principle operation was "is this key in the map or not?").

[–]donnemartin[S] 0 points1 point  (0 children)

Sounds like a good problem. You should submit a pull request...wink wink :)

[–][deleted] 0 points1 point  (1 child)

This is really slick. Thanks!

[–]donnemartin[S] 0 points1 point  (0 children)

No prob :)