github.com/endingwithali/tailgate-2025-interview

An animated time-lapse of how endingwithali/tailgate-2025-interview was built, commit by commit.

Open this visualization on its own page →

Contributors

1

Lines of Code

9

From

2025-06-23

To

2025-06-23

About endingwithali/tailgate-2025-interview

This project is a memory management system written in Python that implements allocation and deallocation functionality similar to what you might find in lower-level languages. The author created a MemoryManager class that simulates a memory buffer using a Python list containing chunks of various sizes, allowing exploration of memory fragmentation without relying on Python's built-in memory handling. The implementation uses a compaction strategy to consolidate fragmented free space, making it easier to reuse available memory, though the author acknowledges this approach is inefficient at scale due to frequent list manipulation.

The project includes comprehensive testing with pytest to validate the memory allocation and deallocation operations. The author provides thoughtful analysis of the implementation, noting that compaction is not ideal for production systems and that industry-standard approaches like first-fit allocation would require significant architectural changes, particularly in handling non-contiguous memory blocks. The author also highlights that this implementation would struggle with multithreading due to the frequent modifications needed to the memory buffer and the extensive locking that would be required.

This appears to be an interview project completed as a learning exercise on memory management concepts. The author explicitly recommends against using this approach in Python for real-world scenarios, suggesting that languages like Go, Rust, or C++ would be far more appropriate for applications requiring manual memory management. The project serves as an educational exploration of memory fragmentation algorithms rather than a production-ready solution.

Share this video