Philosophically, the concepts of Design Sprint and Hackathon are relatively close: Both describe ways of finding creative solutions to a given problem with a limited space and time.
In reality, Hackathons became mainstream events where the main goal is not really to solve a problem but rather to network. Many large companies are organizing Hackathons primarily for promotional or talent acquisition purposes.
Private vs Public
The Design Sprint consists of a small team of 5 to 7 people. A Sprint will typically have 4 experts of the subject and 3 outsiders discovering the issues and contributing new perspectives. While the number of people at a Sprint is limited, there can be thousands of people participating in Hackathons.
Hackathons invite people from the public to participate. The Sprint, on the other hand, is carried out by people of your company. This private setting allows you to tackle real problems in depth without risking a breach of confidentiality. The theme of a Design Sprint will never be vague or without clear purpose like: “How can we reinvent the City of tomorrow?”. A Design Sprint works on a tangible and defined challenge like: “How to regain the 1500 customers who left for the competition in the last quarter?”.