Skip to content

LRU Cache Visualization - #82

Open
karkir0003 wants to merge 12 commits into
csvistool:masterfrom
karkir0003:lru-visualizer
Open

karkir0003 wants to merge 12 commits into
csvistool:masterfrom
karkir0003:lru-visualizer

Conversation

@karkir0003

@karkir0003 karkir0003 commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

Context

Issue: #79 , Linear

Goal is to implement a visualization for a useful real world application of the concepts in CS 1332 called LRU Cache that gets asked in technical interviews.

To add some color: In a software application, a cache helps to store frequently accessed data and reduce server hits to the database within a backend system. When a cache reaches capacity in terms of number of entries, we need an algorithm to decide what entry is removed and LRU is a common algorithm.

Changes Made

  • Introduced a visualization file LRU.js using the existing animation framework to simulate how the LRU cache would behave in practice under the "DP & Extras" section
  • Added pseudocode to go along with the animation

Test Plan

Demo: Here

Added unit tests to verify functionality

@karkir0003

Copy link
Copy Markdown
Contributor Author

cc: @luciankt can you take a look? Thanks!

@karkir0003 karkir0003 mentioned this pull request Sep 27, 2026
@karkir0003
karkir0003 force-pushed the lru-visualizer branch 2 times, most recently from 6096c85 to 1038b3a Compare September 27, 2026 00:32
@luciankt

Copy link
Copy Markdown
Collaborator

This looks pretty cool and I agree with your points about this being a fundamental data structure that fits well on this site. CS 1332 (the college course that this site primarily serves) recently introduced a project where LRU is pretty much the solution that students are encouraged to develop themselves, so adding it to csvistool.com could interfere with that. I'll ask the current course staff to see what their thoughts are on adding an LRU page before we proceed.

@karkir0003

Copy link
Copy Markdown
Contributor Author

This looks pretty cool and I agree with your points about this being a fundamental data structure that fits well on this site. CS 1332 (the college course that this site primarily serves) recently introduced a project where LRU is pretty much the solution that students are encouraged to develop themselves, so adding it to csvistool.com could interfere with that. I'll ask the current course staff to see what their thoughts are on adding an LRU page before we proceed.

@luciankt thanks for your response. Please keep me in the loop when you have a response. I'm also open to making the update such that the pseudocode is not present if the intent is that the student needs to develop the code themselves. I was unaware that this is a project being introduced, so was wondering how we can find a balance between introducing this but also adhering to the goal of the course

@karkir0003

Copy link
Copy Markdown
Contributor Author

This looks pretty cool and I agree with your points about this being a fundamental data structure that fits well on this site. CS 1332 (the college course that this site primarily serves) recently introduced a project where LRU is pretty much the solution that students are encouraged to develop themselves, so adding it to csvistool.com could interfere with that. I'll ask the current course staff to see what their thoughts are on adding an LRU page before we proceed.

@luciankt thanks for your response. Please keep me in the loop when you have a response. I'm also open to making the update such that the pseudocode is not present if the intent is that the student needs to develop the code themselves. I was unaware that this is a project being introduced, so was wondering how we can find a balance between introducing this but also adhering to the goal of the course

Could you also take a look at my other PRs. I made some improvements to the automation to make the developer experience smoother

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants