Software DevelopmentIntermediate 2 to 3 hours

Implement Redis Caching

Speed up a slow 3rd-party API response using an in-memory cache.

The Scenario

Your app displays live stock prices fetched from an external API. The external API takes 2 seconds to respond and limits you to 100 requests per minute. Your app receives 500 requests per minute.

The Brief

Implement a caching layer using Redis. If a stock price was fetched in the last 15 seconds, serve it from Redis. Otherwise, fetch it from the external API, save it to Redis with an expiration (TTL), and return it.

Deliverables

  • The caching middleware/service code using a Redis client
  • An explanation of how TTL (Time To Live) prevents stale data
  • What happens if the Redis server crashes? Explain your fallback strategy.

Submission Guidance

A good cache implementation should be invisible to the end user (except that it is much faster). Make sure you handle cache misses correctly.

Submit Your Work

Your submission is graded against the rubric on the right. If you pass, you get a public Badge URL you can share on LinkedIn. There is no draft save, so work offline first and paste your finished response here.

This appears on your public Badge.

0/20000 charactersMarkdown supported

One per line or comma separated. Up to 5 links.

By submitting, you agree your submission text, name, and evaluation will appear on a public Badge URL.