"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]
, incrementcnt
. - 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
โก 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)