DEV Community

Cover image for ๐Ÿš€ Day 10 โ€” DSA x System Design Learning Log
I.K
I.K

Posted on

๐Ÿš€ Day 10 โ€” DSA x System Design Learning Log

"Small daily progress leads to massive long-term impact."

After 10 days of deliberate consistency (with one comeback arc), Iโ€™m starting to see deeper intuition forming โ€” both in coding logic and in understanding scalable systems.


๐Ÿงฉ DSA Problems [1 hr]

Problem: 3349. Adjacent Increasing Subarrays Detection I

This one was subtly challenging โ€” the logic feels simple at first glance, but optimizing for a single traversal takes thought.


๐Ÿ’ก Approach: One-Time Traversal

๐Ÿง  Intuition

If two adjacent strictly increasing subarrays of length k exist, they also exist for all lengths < k.
So the key is to find the largest valid kโ€ฒ and check if it satisfies the condition.

We track two variables:

  • cnt: length of the current increasing subarray
  • precnt: length of the previous one

At every point:

  • If nums[i] > nums[iโˆ’1], increment cnt.
  • Else, the increasing streak resets โ€” set precnt = cnt, cnt = 1.

Then compute:

  • min(precnt, cnt) โ†’ represents adjacent subarrays.
  • cnt // 2 โ†’ represents one long continuous increasing run.

๐Ÿ’ป Code

class Solution:
    def hasIncreasingSubarrays(self, nums: List[int], k: int) -> bool:
        n = len(nums)
        cnt, precnt, ans = 1, 0, 0
        for i in range(1, n):
            if nums[i] > nums[i - 1]:
                cnt += 1
            else:
                precnt, cnt = cnt, 1
            ans = max(ans, min(precnt, cnt))
            ans = max(ans, cnt // 2)
        return ans >= k
Enter fullscreen mode Exit fullscreen mode

โšก Takeaways

  • Built intuition around state tracking across traversals.
  • Reinforced understanding of adjacency logic and sequence continuity.
  • Learned to express a condition efficiently without nested loops.

๐Ÿ— System Design โ€” Roadmap.sh [1 hr]

๐ŸŽฏ Topic: Background Jobs

Background jobs handle work that doesnโ€™t need to block the main application flow. Think of them as quiet backstage workers keeping your system smooth.


๐Ÿง  Common Use Cases

โœ… Maintenance tasks: cleanups, report generation, backups
โœ… Heavy computation: ML training, analytics, or aggregation
โœ… Async communication: emails, notifications, webhooks
โœ… Batch data ops: imports/exports, ETL pipelines


โš™๏ธ Implementation Patterns

  • Job Queue + Workers: Tasks get queued (e.g., RabbitMQ, SQS, Redis Queue), then processed by worker nodes.
  • Schedulers (e.g., Cron): Trigger recurring background tasks.
  • Retry + Monitoring: Failed jobs should retry intelligently with backoff and be observable (via dashboards/logs).

๐Ÿงฉ Real-World Examples

  • Gmail: sending emails asynchronously after user hits โ€œSendโ€
  • Stripe: generating reports and invoices via background batch jobs
  • GitHub: background actions for CI/CD pipelines

๐Ÿ’ฌ Reflection

The โ€œbackground jobโ€ concept mirrors our own learning process:
the main thread is daily consistency, while the background jobs are reflection, documentation, and review โ€” silently compounding over time.


โœ… Key Takeaways

  • DSA sharpened my reasoning for adjacency-based problems.
  • System Design reinforced non-blocking execution and asynchronous scaling.
  • 10 Days in โ€” this rhythm is starting to feel automatic.

๐Ÿค Letโ€™s Connect

10 days in โ€” whatโ€™s your โ€œbackground jobโ€ for personal growth?
Something that runs quietly every day, but changes you over time?

Drop a โš™๏ธ if youโ€™ve got one.

Top comments (0)