Daily Programming Challenges from Reddit
$9.99
Minimum price
$15.99
Suggested price

Daily Programming Challenges from Reddit

About the Book

So many books exist already that teach you a programming language or subjects such as algorithms, but few books on programming challenges. Puzzles that teach you insights into computer science and applying the right algorithm at the right time, or challenges that help you compare programming paradigms. The Reddit DailyProgrammer community has been an active forum for many years, and the author of this book is one of the moderators of that forum. Using challenges he's written, you can find something to help you grow in your skills.

Originally conceived of as a way to compare programing languages and paradigms, this collection of nearly 200 programming challenges grouped into easy, medium, and hard categories covers a wide variety of topics:

  • graph theory
  • math and number theory
  • algorithms on strings
  • encryption
  • the HTTP protocol
  • bioinformatics
  • computational geometry
  • puzzles
  • and more

This book isn’t meant to be read end to end, but instead picked from here and there. While challenges get harder through the book - progressing from easy to intermediate to hard - they don’t follow a strict set of requirements for categorizing. Don’t be discouraged, sometimes you can come back to a harder one after some thought and practice. 

  • Share this book

  • Categories

    • Computers and Programming
    • Computer Science
    • Graph Theory
    • Data Science
  • Feedback

    Email the Author(s)

About the Author

jose nazario
jose nazario

Jose Nazario is a computer security product engineering executive. He also works with the Honeynet Project and a variety of open source initiatives.

Table of Contents

  • 1 Introduction
  • Introduction
  • 1.1.1 How to Use This Book
  • 1.1.2 A Note on Solutions
  • 2 Easy
  • Introduction
  • 2.2 3SUM
  • 2.3 Abundant and Deficient Numbers
  • 2.4 Detecting Alliteration
  • 2.5 Anagram Detector
  • 2.6 Approximate PI
  • 2.7 Atbash Cipher
  • 2.8 Balancing Words
  • 2.9 Baum-Sweet Sequence
  • 2.10 Gold and Treasure: The Beale Cipher
  • 2.11 Broken Keyboard
  • 2.12 Cellular Automata: Rule 90
  • 2.13 Concatenated Integers
  • 2.14 Condensing Sentences
  • 2.15 Garland Words
  • 2.16 Basic Graph Statistics: Node Degrees
  • 2.17 Jolly Jumper
  • 2.18 Kaprekar Numbers
  • 2.19 L33tspeak Translator
  • 2.20 Letters in Alphabetical Order
  • 2.21 In what year were most presidents alive?
  • 2.22 Making numbers palindromic
  • 2.23 Pandigital Roman Numbers
  • 2.24 Pronouncing Hexadecimal
  • 2.25 Reverse Factorial
  • 2.26 Roller Coaster Words
  • 2.27 Ruth-Aaron Pairs
  • 2.28 Calculating Shannon Entropy of a String
  • 2.29 Shuffling a List
  • 2.30 Spelling with Chemistry
  • 2.31 Playing the Stock Market
  • 2.32 Thue-Morse Sequence Generator
  • 2.33 Vampire Numbers
  • 2.34 XOR Multiplication
  • 2.35 Finding Amicable Numbers
  • 2.36 Making Imgur-style Links
  • 2.37 Capitalize The First Letter of Every Word
  • 2.38 Closest String
  • 2.39 Collatz Conjecture
  • 2.40 Double (or More) Knots
  • 2.41 Emirp Numbers
  • 2.42 Evil Numbers
  • 2.43 Extravagant Numbers
  • 2.44 Finding the Freshest Eggs
  • 2.45 Harshad Number
  • 2.46 Integer Sequence Search Part 
  • 2.47 Isomorphic Words
  • 2.48 Kolakoski Sequence Generator
  • 2.49 Lipogram Detector
  • 2.50 Longest Palindromic Substring
  • 2.51 Longest Repeated Substring
  • 2.52 Narcissistic numbers
  • 2.53 Regular Paperfold Sequence Generator
  • 2.54 Pell Numbers
  • 2.55 Perfect Numbers
  • 2.56 Primes in Grids
  • 2.57 Summing Across the Rudin-Shapiro Sequence
  • 2.58 Safe Prime Numbers
  • 2.59 Typo Maker
  • 2.60 Wedderburn-Etherington Sequence 
  • 3 Intermediate
  • Introduction 
  • 3.2 Anagram Maker 
  • 3.3 ASCII85 Encoding and Decoding 
  • 3.4 ASCII Histogram Maker: Part 1 - The Simple Bar Chart
  • 3.5 Where Should Grandma’s House Go? 
  • 3.6 Connect Four
  • 3.7 Calculating De Bruijn sequences
  • 3.8 Detecting Four Sided Figures 
  • 3.9 Bioinformatics 2: DNA Restriction Enzymes 
  • 3.10 Elggob - Make a Boggle Layout 
  • 3.11 Balancing My Spending 
  • 3.12 Maximizing Crop Irrigation 
  • 3.13 Graph Radius and Diameter 
  • 3.14 Gray Code 
  • 3.15 IPv4 Subnet Calculator
  • 3.16 Comparing Rotated Words
  • 3.17 Linear Feedback Shift Register
  • 3.18 Training for Summiting Everest 
  • 3.19 Generating Text with Markov Processes
  • 3.20 Packing a Sentence in a Box 
  • 3.21 Packing Stacks of Boxes
  • 3.22 Parsing Postal Addresses
  • 3.23 Generating Polyominoes 
  • 3.24 Punch Card Creator 
  • 3.25 Scrabble in Reverse 
  • 3.26 Finding Legal Reversi Moves
  • 3.27 Set Game Solver 
  • 3.28 Write a Web Client
  • 3.29 Listening for Incoming Aircraft
  • 3.30 Red Squiggles 
  • 3.31 Simple Stream Cipher 
  • 3.32 Use a Web Service to Find Bitcoin Prices
  • 3.33 Word Squares Part 1 
  • 3.34 Worm Wars 1 - Basic Epidemiology
  • 3.35 Zeckendorf Representations of Positive Integers
  • 3.36 Finding Ancestors 
  • 3.37 Encoding with the Beale Cipher 
  • 3.38 Bifid Cipher
  • 3.39 Sturdy Brick Walls 
  • 3.40 Calkin-Wilf Tree 
  • 3.41 Change Ringing 
  • 3.42 Counting Maximal Length Palindromes 
  • 3.43 Fencing In the Birds 
  • 3.44 Constructing Cyclic Numbers 
  • 3.45 Cyclic Words 
  • 3.46 Sorting Dienes Tiles 
  • 3.47 Tallest Tower from a List of Digits 
  • 3.48 The Ducci Sequence 
  • 3.49 The Ehrenfeucht-Mycielski sequence (0,1-version) 
  • 3.50 Math Snake 
  • 3.51 Calculating the Farey Sequence 
  • 3.52 Fibonacci Word Fractals 
  • 3.53 Friedman numbers 
  • 3.54 Goldbach’s Weak Conjecture 
  • 3.55 Hitori Solver 
  • 3.56 Laser in a Box 
  • 3.57 Longest Alternating Subsequence 
  • 3.58 Needles in Haystacks
  • 3.59 Magic Squares 
  • 3.60 Mathagrams 
  • 3.61 Picture Spot 
  • 3.62 Finding Numbers with Manners 
  • 3.63 Polydivisble Numbers 
  • 3.64 Primes in Several Bases 
  • 3.65 Singles 
  • 3.66 Slitherlink 
  • 3.67 Spinning Gears 
  • 3.68 Spoonerism 
  • 3.69 English Word Syllbalizer 
  • 3.70 Tile Shuffling 
  • 3.71 Trees in the Park 
  • 3.72 Two for One 
  • 3.73 Calculating Ulam Numbers 
  • 3.74 Unique County Names 
  • 3.75 Unwrap Some Text
  • 3.76 Vaki Puzzle Solver 
  • 3.77 Well, Well, Well
  • 3.78 Longest Word in a Box 
  • 3.79 XOR Decoding 
  • 3.80 Zombies Invaded my Village
  • 4 Hard
  • Introduction 
  • 8 Puzzle 
  • 4.3 ASCII Histogram Maker: Part 2 - The Proper Histogram 
  • 4.4 Coiled sentence 
  • 4.5 Calculating Costas Arrays 
  • 4.6 Customer Unit Delivery Scheduling 
  • 4.7 DNA Shotgun Sequencing 
  • 4.8 Elevator Scheduling 
  • 4.9 Finding Friends in the Social Graph 
  • 4.10 Generate Strings to Match a Regular Expression 
  • 4.11 Golomb Rulers 
  • 4.12 Gophers and Robot Dogs 
  • 4.13 The Guards and the Mansion 
  • 4.14 Guarding the Coast
  • 4.15 Hue Drops Puzzle 
  • 4.16 Kakuro Solver 
  • 4.17 Kanoodle Solver 
  • 4.18 KenKen Solver 
  • 4.19 Severing the Power Grid 
  • 4.20 Museum Cameras 
  • 4.21 Nonogram Solver
  • 4.22 Finding Point Nemo 
  • 4.23 Procedural Dungeon Generation 
  • 4.24 Bioinformatics 3: Predicting Protein Secondary Structures
  • 4.25 Rush Hour Solver
  • 4.26 DNA and Protein Sequence Alignment 
  • 4.27 Redistricting Voting Blocks 
  • 4.28 Snake in a Box 
  • 4.29 Eight Husbands for Eight Sisters 
  • 4.30 Static HTTP Server 
  • 4.31 New York Street Sweeper Paths
  • 4.32 Subset Sum Automata
  • 4.33 Implementing a Templating Engine 
  • 4.34 Text Summarizer
  • 4.35 Longest Uncrossed Knight’s Path 
  • 4.36 Van der Waerden numbers
  • 4.37 Write a Web Crawler
  • 4.38 Word Squares Part 2 
  • 4.39 Worm Wars 2 - Network Epidemiology 
  • 4.40 Mission Impossible: Fooling the Anomaly Detector and Exfiltrating Data 
  • 4.41 Chess Solitaire 
  • 4.42 Calculate Graph Chromatic Number
  • 4.43 Congruent Numbers 
  • 4.44 Glass Cutting Optimization 
  • 4.45 Drainage Ditches
  • 4.46 Comparing Graphs 
  • 4.47 Buying Groceries 
  • 4.48 Integer Sequence Search Part 2 
  • 4.49 Number Grid Puzzles
  • 4.50 Nurikabe Puzzle Solver
  • 4.51 Implement Basic RSA Public Key Encryption 

The Leanpub 60 Day 100% Happiness Guarantee

Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

Now, this is technically risky for us, since you'll have the book or course files either way. But we're so confident in our products and services, and in our authors and readers, that we're happy to offer a full money back guarantee for everything we sell.

You can only find out how good something is by trying it, and because of our 100% money back guarantee there's literally no risk to do so!

So, there's no reason not to click the Add to Cart button, is there?

See full terms...

80% Royalties. Earn $16 on a $20 book.

We pay 80% royalties. That's not a typo: you earn $16 on a $20 sale. If we sell 5000 non-refunded copies of your book or course for $20, you'll earn $80,000.

(Yes, some authors have already earned much more than that on Leanpub.)

In fact, authors have earnedover $13 millionwriting, publishing and selling on Leanpub.

Learn more about writing on Leanpub

Free Updates. DRM Free.

If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).

Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.

Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.

Learn more about Leanpub's ebook formats and where to read them

Write and Publish on Leanpub

You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!

Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.

Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF and/or EPUB files and then publish with one click!) It really is that easy.

Learn more about writing on Leanpub