Daily Coding Challenges & Projects
Wednesday
Frontend Mini Project Challenge
Vue.js Components
Challenge:
Build a reusable <AlertBanner> Vue component that:
- Accepts props: type (success|error|info), message, and optional dismissible (boolean).
- Automatically hides after 5 seconds if dismissible is true.
- Emits a closed event when dismissed.
Hint :Use the Composition API (defineProps, ref, onMounted) and v-if for conditional rendering.
Try it Online: Vue SFC Playground
Backend Challenge
Python & PHP
Challenge Python
Problem:
Write a script that reads a large CSV file in chunks (e.g. 10,000 lines at a time) and counts how many rows contain the word "error" in any column.
Hint: Use pandas.read_csv(..., chunksize=10000) or itertools.islice.
Challenge PHP
Problem:
- __construct($name, $email)
- validate() — returns true if email is valid (use filter_var), otherwise throws an exception.
- toJson() — outputs user data as a JSON string.
Create a User class supporting:
Database Query Challenge
Problems on SQL - HR Database :
- Find employees who joined exactly on their manager’s hire date.
- List employees who never received a salary increase in the last 3 years.
Data Structures & Algorithms Challenge
- Easy:
- Problem: Reverse a string in-place.
- Hint: Convert to array, swap characters from ends.
- Medium:
- Problem: Given a rotated sorted array, find the minimum element.
- Hint: Use modified binary search comparing mid to end.
- Hard:
- Problem: Implement Dijkstra’s shortest path algorithm using a priority queue.
- Hint: Use a min-heap (e.g., Python’s heapq or PHP’s SplPriorityQueue).
Bug of the Day
Python Bug
Code:
def append_item(item, lst=[]):
lst.append(item)
return lst
print(append_item(1))
print(append_item(2)) # Unexpected behavior?
Challenge: Explain and fix the default-mutable-argument issue.
PHP Bug
Code:
<?php
function divide($a, $b) {
if ($b == 0) {
return "Cannot divide by zero";
}
return $a / $b;
}
echo divide(10, "0"); // What's wrong?
?>
Challenge: Spot the type-check flaw and correct it.
📋 Daily Micro-Project
Database Focus:
Challenge :
Identify a slow-performing query on your HR database and optimize it by:
- Adding indexes.
- Rewriting any correlated subqueries into joins.
- Comparing execution time before vs. after (EXPLAIN PLAN).
Trivia: 5 Fun Facts
- The first version of PHP stood for "Personal Home Page."
- PostgreSQL began development in 1986 as "Ingres."
- Ada Lovelace wrote the first algorithm intended for a machine (1843).
- Guido van Rossum named Python after Monty Python, not the snake.
- Vue.js was created in 2014 by ex-Google engineer Evan You.
Tool of the Day
Tool: DBeaver
- Download DBeaver
- Quickstart Guide
- SQL Performance Tuning : Use The Index, Luke!
- Python Chunked File Reading: Pandas IO API
- PHP Best Practices : PHP The Right Way
A free, universal database GUI supporting MySQL, PostgreSQL, Oracle, and more—great for visual query building and ER diagrams.
Resource Roundup:
Interview Question of the Day
Daily Interview Questions
- How do you pass data from parent to child components?
- What's the difference between v-show and v-if?
- Explain the purpose of the <slot> element.
- How does Vue's reactivity detect changes in objects?
- What is the GIL in Python and how does it affect concurrency?
- How do you handle exceptions and errors in PHP?
- Explain Python's with statement (context managers).
- What are PHP traits and when would you use them?
- What's the difference between clustered and non-clustered indexes?
- Explain the use of window functions (e.g., ROW_NUMBER()).
- What is a materialized view?
- What is CI/CD and why is it important?
- Explain the concept of "Infrastructure as Code."
Daily Quiz Challenge
- Which Vue directive binds HTML attributes?
- v-bind
- v-model
- v-for
- v-if
- What lifecycle hook runs after the component is mounted?
- created
- mounted
- beforeMount
- destroyed
- How do you conditionally render an element?
- v-if
- v-for
- v-bind
- v-show
Frontend :
- What does pandas.read_csv(chunksize=...) return?
- DataFrame
- Iterator of DataFrames
- List of rows
- None
- Which PHP function sanitizes email addresses?
- filter_var(..., FILTER_SANITIZE_STRING)
- filter_var(..., FILTER_SANITIZE_EMAIL)
- htmlspecialchars()
- trim()
- In SQL, which clause filters after aggregation?
- WHERE
- HAVING
- GROUP BY
- ORDER BY
Backend :
- What's a container orchestration tool? (e.g., Kubernetes)
- What is a shell pipeline (e.g., grep … | awk …)?
Others :
- What does EXPLAIN ANALYZE do in PostgreSQL?
Mixed Quiz :
Weekly Cross-Domain Activities ( April 25 to May 01, 2025 )
API of the Day:
Challenge:
Use the Bored API to create a simple app that suggests fun activities when you're bored.
Linux/DevOps Tip:
Useful Commands for File & Directory Management and Troubleshooting
- stat filename – View detailed metadata about a file (last access, inode, etc.)
- ls -lhS – List files by size in human-readable format
- tree -L 2 – Display a directory structure up to 2 levels deep
- find /path -type f -size +100M – Find files larger than 100MB
- ncdu – A disk usage analyzer with a simple interactive UI (install required)
- lsof +D /path/to/dir – List open files in a directory
- inotifywait -m /some/dir – Watch for real-time file changes in a directory (from inotify-tools)
- file filename – Determine file type and encoding
- tail -F /var/log/syslog – Live-follow system logs with file rotation support
- watch -n 1 'df -h / && free -h' – Watch disk and memory stats refresh every second
Here are 10 powerful and often underused commands for managing files and debugging issues in Linux systems:
Real-World Project of the Week ( April 25 to May 01, 2025 )
Project of the Week:
- Tech Stack Options:
- TypeScript + Express + PostgreSQL + React
Build a Personal Expense Tracker App
Collaborative Project:
- Contribute to EddieHub Open Source Projects
- Join issues tagged good first issue on GitHub!
Case Study:
- Uses React + TypeScript frontend
- Backend with C++/Rust hybrid for performance
- Offline-first architecture
How is Notion Built?
Challenge: Try replicating a basic note-taking component!
Previous Daily Coding Challenges & Projects : 04-04-2025 07-04-2025 08-04-2025 09-04-2025 10-04-2025 11-04-2025 14-04-2025 15-04-2025 16-04-2025 17-04-2025 18-04-2025 21-04-2025 22-04-2025 23-04-2025 24-04-2025 25-04-2025 28-04-2025 29-04-2025