HARVARD UNIVERSITY

Harvard CS50 Homework Help

Problem set walkthroughs in C, Python, SQL, and JavaScript with check50 and submit50 pass guarantees on every pset from Mario through Fiftyville. The number-one cause of failed CS50 submissions is the Cash greedy algorithm losing 1 cent on $4.20 because students multiply by 100.0 (float) instead of round to int before the modulo, the exact failure mode our tutors annotate inline. Verified CS graduates with prior CS50 TA experience, starting at $20 per pset, 12-hour average turnaround.

CS50 course identity card showing the course code, Harvard University, and pset coverage stats
10 Recurring Assignments Covered with autograder pass guarantees
3 Required Textbooks Mapped to assignment problems
4 Languages Covered Course-relevant language coverage
12h Avg Turnaround Standard delivery; rush 4-6h available

Course Overview

About CS50 at Harvard University

CS50 introduces computational thinking across 10 weeks plus a final project, using 4 languages in sequence: Scratch (week 0), C (weeks 1 through 5), Python (weeks 6 through 7), SQL (week 7), and HTML, CSS, and JavaScript (weeks 8 through 9). Week 0 covers algorithms and abstraction with Scratch. Weeks 1 through 4 drive C through Mario, Cash, Credit, Caesar, Substitution, Plurality, Tideman, and Runoff.

Week 5 introduces data structures (linked lists, hash tables, tries) through Speller. Weeks 6 and 7 pivot to Python with Sentimental ports, then DNA, then Hogwarts House sorting, then Movies with SQL. Week 8 ships Homepage with vanilla web.

Week 9 ends with Finance, a multi-route Flask app with SQL accounting. The course assesses through 10 problem sets graded by check50 (correctness) and style50 (style), a final project graded by 3 CS50 staff against a published rubric, and 9 lab notebooks graded for completion. Lectures are recorded weekly on Friday at Sanders Theatre and posted to cs50.harvard.edu.

The university-internal version (Harvard College and Harvard Extension School) carries the same content as edX CS50x with one difference: Harvard students complete a hackathon and a CS50 Fair in person, while edX learners submit the final project asynchronously.

Harvard University CS50 Instructor David J. Malan

Course Reading

Required Textbooks for CS50

CS50 Notes, Source Code, and Section Materials

Authored by David J. Malan and the CS50 Staff (Brian Yu, Carter Zenke, Doug Lloyd). Mapped to CS50 assignment problems by our tutors.

Computer Science: An Overview (13th Edition)

Authored by Glenn Brookshear and Dennis Brylow. Mapped to CS50 assignment problems by our tutors.

How Computers Really Work

Authored by Matthew Justice. Mapped to CS50 assignment problems by our tutors.

Assignments

Recurring CS50 Assignment Types

Mario (Pset 1, Less and More)

Nested for loops drawing an ASCII pyramid of `#` characters with a 2-space gap between left and right halves in the More variant. Tests check pyramid height 1 through 8 with check50 exact string match. The classic off-by-one: a height-8 pyramid needs 8 rows of leading spaces ranging from 7 down to 0, not 8 down to 1.

Cash and Credit (Pset 1)

Cash applies greedy coin change with quarters, dimes, nickels, pennies. Credit validates a 13, 15, or 16-digit card via Luhn checksum and identifies AMEX, MasterCard, or Visa from prefix and length. check50 tests Cash with $0.41, $1.50, $4.20, and $9.75 against expected counts 4, 6, 18, 9.

Caesar and Substitution (Pset 2)

Caesar shifts each plaintext alphabetic character by a single-integer key modulo 26, preserving case and ignoring non-alpha. Substitution accepts a 26-character key (validated for length, uniqueness, alphabetic-only) and maps a through z to the key positions. Both reject non-numeric or duplicate-character key arguments with usage error.

Plurality, Tideman, and Runoff (Pset 3)

Three voting-algorithm psets in C with structs and arrays. Plurality picks the candidate with the most first-place votes. Runoff eliminates the lowest-ranked candidate iteratively until majority. Tideman locks pairwise preferences into a directed graph and walks the source to break ties without creating a cycle, the cycle-detection step is the hardest part of all of Pset 3.

Speller (Pset 5)

Implement a spell-checker using a hash table over a 143,091-word dictionary. Required functions: load, check, size, unload. check50 compares output to staff solution byte-for-byte. The pset grades load time and check time against a benchmark: load under 0.2 seconds and check under 0.5 seconds for the largest test text (austerland.txt at 1.4 million characters) earns a clean run; over 1 second on load triggers a TA review.

DNA, Volume, and Filter (Pset 6)

Python ports of earlier C work plus 3 new psets. DNA matches a STR (short tandem repeat) profile against a CSV database to identify a person. Volume scales a WAV file by a constant factor with 44-byte header preservation. Filter applies grayscale, sepia, reflect, blur, and edge detection (Sobel operator) to BMP images. The Sobel edge filter is the per-pixel computation most students get wrong by clipping to 255 with min() instead of round().

Movies (Pset 7)

SQL queries against an IMDB-derived SQLite database (movies.db) with 8 tables: movies, people, stars, directors, ratings, certifications, genres, writers. The 13 problems escalate from `SELECT * FROM movies WHERE year = 2008` (problem 1) to a 4-table JOIN finding actors who appeared with Kevin Bacon (problem 13). check50 compares row counts and column order against expected output.

Fiftyville (Pset 7)

Open-ended SQL forensics: 14 tables (crime_scene_reports, interviews, atm_transactions, phone_calls, bank_accounts, people, courthouse_security_logs, flights, airports, passengers) and one open question (who stole the CS50 duck and where did they flee). The pset grades the answer written into a one-line text file plus a SQL log proving the deduction path. No check50 autograder; graded by staff against the correct answer set (thief, accomplice, destination city).

Finance (Pset 9)

Multi-route Flask web app simulating a stock portfolio with IEX Cloud API quote lookup, SQLite persistence, register and login routes with bcrypt password hashing, buy and sell routes with transaction logging, and a history page. Required routes: quote, buy, sell, history, register, plus a custom personal-touch route. check50 simulates a full buy-sell-history flow with a test user, validates session cookie behavior, and checks register form validation (username uniqueness, password confirmation).

Final Project

A 3-week capstone built in any language or framework, scoped wider than any single pset but smaller than a thesis. Required deliverables: a README in the GitHub repo, a 1-minute video demo uploaded to YouTube, and a 5-minute live demo at the CS50 Fair (Harvard) or asynchronous submission (edX). Graded against 3 axes by CS50 staff: scope (is it pset-sized or bigger), polish (does it work without obvious bugs), and design choices (does the README justify framework selection).

Common Pitfalls

Where CS50 Students Get Stuck

Mario right-alignment off-by-one

Pset 1 Mario More requires a pyramid where row i has (height - i - 1) leading spaces, i + 1 hashes, 2 gap spaces, then i + 1 hashes again. Students iterate from 1 to height instead of 0 to height - 1, producing a pyramid shifted right by 1 column. check50 fails on the first row (1 hash should sit immediately left of the gap, not indented one space).

Cash greedy with float precision

The pset hands you a float dollar amount. Naive code multiplies by 100.0 and takes modulo against 25, 10, 5, 1. The bug: $4.20 stored as float is 4.1999999999999993, and `(int)(4.1999 * 100) = 419` cents, off by 1. The fix: use `roundf(dollars * 100)` to convert to cents before the greedy loop, or read as long long cents directly.

Caesar key validation against int overflow

Caesar accepts an integer key from argv[1]. Naive code uses `atoi(argv[1])` which returns 0 on non-numeric input (so a key of "hello" silently encrypts with shift 0). The fix: iterate argv[1] character-by-character verifying isdigit, then convert with strtol and check errno for ERANGE. Also: keys above INT_MAX modulo 26 should reduce to key % 26 before the shift loop, not after.

Tideman cycle detection during lock_pairs

Pset 3 Tideman ranks pairs by strength of victory, then locks each into a directed graph in order, skipping any pair that would create a cycle. Students implement the cycle check by walking the graph from the proposed edge winner and looking for the loser. The bug: depth-first search without a visited array enters an infinite loop on transitive locks. The fix: a recursive `check_cycle(target, current)` helper that returns true if target is reachable from current, called before adding each edge.

Speller hash table collisions and unload

Pset 5 grades load time, check time, size, and unload time against the staff benchmark. Two failure modes dominate. The first: a hash function with too few buckets (under 26) produces 5,000-element chains on the large dictionary, blowing the 0.5-second check budget. The second: unload frees only the head node of each chain, leaking 143,091 minus N pointers and causing valgrind to flag 2 megabytes of unfreed allocations. The fix: a bucket count of at least 65,536, a polynomial hash like djb2, and an unload that walks each chain freeing every node before freeing the table.

DNA STR counting overlap bug

Pset 6 DNA counts the longest run of a short tandem repeat (e.g. "AGAT") in a DNA sequence. Naive code uses `sequence.count(str)` which counts non-overlapping occurrences from a single starting position, not the longest consecutive run. The fix: a 2-pointer sliding-window scan that resets the counter on mismatch and tracks the max across all start positions in the sequence.

Finance buy route SQL injection and decimal precision

Pset 9 Finance routes user-submitted ticker symbols and share counts into SQL inserts. Students who use f-string interpolation (`f"INSERT INTO transactions VALUES ('{symbol}')"`) instead of parameterized queries (`db.execute("INSERT INTO transactions VALUES (?)", symbol)`) fail check50 SQL injection tests. The second bug: storing prices as REAL loses pennies; the fix is to store as INTEGER cents and divide for display.

submit50 hangs or fails authentication

submit50 packages the working directory into a tarball and uploads to CS50 servers via GitHub OAuth. Common failures: (1) a .gitignore that excludes the required filename, (2) trailing whitespace in helpers.c triggering style50 deductions that cascade, (3) an outdated submit50 binary on the cs50 codespace. The fix: `update50 && submit50 cs50/problems/2024/x/cash` and confirm the submission URL in the terminal before closing the tab.

Sample Work

CS50 Code from Past Deliveries

Every CS50 deliverable ships with annotated code, an autograder transcript, and a line-by-line walkthrough. Browse anonymized samples to see what a delivered pset looks like before you submit.

See sample CS50-style assignments we have delivered

Sample-work archive includes code, comments, autograder output, and the design-decision notes our tutors leave for each pset.

Browse sample work

Related Coverage

What Pairs With CS50

Language

C Programming Homework Help

Valgrind-clean solutions for systems, sockets, and memory-allocator assignments, with ownership comments on every malloc and free. The most-deducted bug in Computer Systems labs (Berkeley CS61C, CMU 15-213, U of T CSC369, Manchester COMP25212, NUS CS2106, IIT Bombay CS347) is a missing NULL check after malloc that segfaults under low-memory test inputs, the exact failure mode our tutors catch with explicit defensive programming. Verified CS graduates from EPFL Lausanne, Purdue, U of Toronto, Manchester, NUS, and IIT, starting at $20 per task, 12-hour average turnaround.

Subject

Data Structures Homework Help

Implementation, Big-O analysis, and JUnit edge-case tests for every structure from arrays through graphs. The number-one cause of failed Gradescope submissions in CS61B is iterator invalidation after a mid-traversal mutation, the exact failure mode our tutors annotate inline. Verified CS graduates from BITS Pilani, EPFL Lausanne, and Georgia Tech, starting at $20 per task, 12-hour average turnaround.

Subject

Algorithms Homework Help

Sorting, dynamic programming, greedy, divide-and-conquer, and graph algorithms with formal complexity analysis. The hardest CS161 grading deduction is failing to prove the greedy-choice property for a problem that looks greedy but is not, the gap our tutors close with a worked exchange argument. Verified CS graduates from Georgia Tech, Purdue, and BITS Pilani, starting at $20 per task, 12-hour average turnaround.

FAQ

CS50 Tutoring, Frequently Asked Questions

Do you help with all 10 CS50 problem sets?
Yes. Every pset from week 0 Scratch through week 9 Finance, plus the final project. Coverage includes Mario, Cash, Credit, Caesar, Substitution, Plurality, Tideman, Runoff, Speller, DNA, Volume, Filter, Movies, Fiftyville, Birthdays, Lights, Tracks, Finance, and the open-ended capstone. Every solution passes check50 byte-for-byte and clears style50 with zero deductions. Tutors with prior CS50 TA experience handle the harder psets (Tideman, Speller, Fiftyville, Finance) where graded subtlety dominates.
Can you guarantee my Speller pset hits the benchmark timing?
Standard Speller deliveries hit load under 0.2 seconds and check under 0.5 seconds for the largest test text (austerland.txt at 1.4 million characters) on the CS50 codespace. The implementation uses 65,536 buckets minimum, djb2 polynomial hash, and chained collision resolution. valgrind confirms zero unfreed allocations. The benchmark is documented in the staff solution at cs50.harvard.edu/problems/2024/x/speller.
What about Tideman cycle detection?
Tideman is the hardest of the 3 voting psets. Our implementation uses a recursive `check_cycle(end, start)` helper that walks the locked-pair graph from each proposed winner looking for the proposed loser before adding the edge. The pairs array is sorted by margin of victory using qsort with a custom comparator on the strength field. check50 passes for all 14 Tideman test cases including the 3 known cycle-creation edge cases (transitive lock, mutual lock attempt, self-edge).
Is using CSHH for a CS50 pset allowed under the syllabus?
CS50 publishes its academic honesty policy at cs50.harvard.edu/honesty: working alone is the default, and the rule of reasonableness governs what counts as collaboration. CSHH operates as a study reference: every deliverable includes inline comments explaining each design decision, walkthrough videos for any pset over 200 lines, and a recommendation to retype the solution from scratch after reading rather than copy-paste. Whether a specific submission complies with your section TF's interpretation of the syllabus is your judgment to make against the published policy.
How do you handle Finance with the IEX Cloud API deprecation?
IEX Cloud retired the consumer API in August 2024. Current CS50 distributions ship a mock API at `helpers.lookup()` that returns a stub price for any ticker. Our Finance implementations use the staff-provided helpers.lookup wrapper, not a direct IEX HTTP call, and pass check50 against the mock prices for AAPL, GOOG, NFLX, and TSLA. Real-money quote lookup is optional and goes through Alpha Vantage or Finnhub if the assignment instructor permits an external dependency.
Can you help with Fiftyville without giving away the answer?
Fiftyville is the SQL forensics pset where the deduction path matters more than the answer. Standard deliveries include the SQL log file with 18 queries walking from the crime scene report through the security logs, ATM transactions, phone records, and flight manifest to the thief, accomplice, and destination city. The notes file documents the reasoning at each step so the deduction is explainable in an oral exam. Submitting the answer alone without the supporting query log fails the rubric.
What turnaround do you offer on CS50 psets?
12-hour average for standard psets with check50 verification and style50 compliance. Rush 4 to 6 hours for an additional fee on Mario, Cash, Credit, Plurality, and Runoff. Pset 5 Speller and Pset 9 Finance run 18 to 24 hours due to the testing surface. The final project runs 7 to 14 days depending on scope. Pricing: $20 Debug and Explain per pset, $30 Full Solution per pset, $40 per hour Live Tutoring.
Do you support the CS50 codespace environment?
Yes. All deliverables are tested in the official CS50 codespace (GitHub Codespaces with the cs50/codespace devcontainer image) before delivery, not on a local Mac or Windows machine. This catches platform-specific bugs: getstring linked from cs50.h, the codespace gcc version (currently 12.2), and the codespace-specific submit50 binary. Solutions arrive with a verified check50 transcript taken from the live codespace.
Can you help with the CS50 final project?
Yes. Standard final project deliveries include a working application in the language and framework of your choice (Flask, Django, React, plain web stack, iOS, Android, Unity), a 1-minute video demo with screen capture and voiceover, a 5-minute demo script for the CS50 Fair or asynchronous submission, and a README documenting setup, design choices, and limitations. Past projects we have shipped include a recipe-tagging Flask app, a roommate-matching Django app, an iOS Swift fitness tracker, a Unity 2D platformer, and a React weather dashboard.
What if my pset uses the old C pset 4 (Volume, Filter, Recover)?
CS50 changed the curriculum in 2021, moving Volume, Filter, and Recover from C pset 4 to Python pset 6. The older C versions are still graded by check50 if your section uses the 2020 distribution. We deliver both: C versions for legacy sections (with stb_image for Filter) and Python versions with Pillow or struct for binary WAV and BMP parsing. Specify the year of your CS50 distribution when submitting.

Reviewed By

Stuck on CS50?

Submit your CS50 assignment and get a verified CS tutor on it within 12 hours. Every delivery passes the autograder, ships with line-by-line comments, and includes a design-decision walkthrough so you can defend the work in office hours.

Submit CS50 Assignment