Daily Coding Challenges & Projects
Wednesday
Frontend Mini Project Challenge
Vue.js Components
Challenge :
Create a Vue.js component <UserCard> that:
- Accepts a user prop with name, email, and avatar
- Displays user details.
- Emits a select-user event when clicked.
Bonus : Style it with scoped CSS so it looks like a card.
Try Online : Use Vue SFC Playground to test your solution.
Backend Challenge
Language Focus: Python & PHP
Python Problem :
Write a Python function to compress a string using Run-Length Encoding (e.g., "aaabbc" → "a3b2c1"), but without using any built-in groupby or external libraries.
PHP Task :
- Accepts a GET request with a user_id.
- Returns user data in JSON from a mock associative array.
Create a REST API in pure PHP (no framework) that:
Database Query Challenge
Problems on SQL - HR Database :
- Write a SQL query to find employees who earn more than the highest-paid employee in department 90.
- Find employees who have been hired in the same month (regardless of year) as their manager.
Data Structures & Algorithms Challenge
- Easy:
- Problem: Given a list of integers, find the first element that appears exactly twice.
Example: [1, 3, 5, 3, 1, 5, 3] → 3
- Problem: Write a function to solve a Word Search in a 2D board: Given a grid of letters and a word, return true if the word exists in the grid (can move up/down/left/right).
- Hint: DFS & backtracking
- Problem: You are given an array of integers. Implement a data structure that can:
- Update an element.
- Return the sum of elements between two indices.
- Hint: Binary Indexed Tree or Segment Tree
Bug of the Day
Node.js / Go
Node.js Bug :
Buggy Code:
app.get('/user/:id', (req, res) => {
const userId = req.params.id;
const user = users.find(u => u.id === req.param.id);
res.send(user);
});
Challenge :
It should multiply, but it’s doing something else. Fix it.
PHP Bug:
Buggy Code:
<?php
function greet($name) {
return "Hello, $name";
}
echo greet();
?>
Challenge :
What's wrong here? Fix the bug and make it default to "Guest" if no name is passed.
📋 Daily Micro-Project
Database Focus
Challenge :
Optimize the following SQL query for performance on large HR datasets:
SELECT * FROM employees WHERE department_id IN (SELECT department_id FROM departments WHERE location_id = 1700);
Hint :
Consider JOINs, indexes, and EXPLAIN.
Trivia: 5 Fun Facts
- PHP originally stood for "Personal Home Page."
- The first computer bug was a real moth found in a Harvard Mark II computer.
- Vue.js was created by Evan You, who previously worked at Google.
- Python’s name comes from Monty Python, not the snake.
- The world's first high-level programming language was Fortran, developed in the 1950s.
Tool of the Day (Updated)
Tool : Postwoman/Hoppscotch
An open-source API request builder like Postman but lightweight and faster.
Resource Roundup:
- Vue.js Docs
- Vue Mastery Free Courses
- Vue 3 Cheat Sheet: vue-cheatsheet.netlify.app
Top Vue.js Learning Resources
Interview Question of the Day
Daily Interview Questions
- What are Vue.js lifecycle hooks? Name at least 3.
- How does v-model work in Vue?
- How are slots different from props in Vue.js?
- What’s the purpose of the key attribute in a v-for loop?
- How does error handling work in Python using try/except/finally?
- What are the main differences between PHP 7 and PHP 8?
- Explain the concept of closures in PHP..
- What are Python generators, and why are they memory-efficient?
- What’s the difference between HAVING and WHERE?
- How does normalization improve database design?
- What is the purpose of a composite key?
- What is a monolith vs microservices architecture?
- Explain the difference between CI and CD in DevOps.
Daily Quiz Challenge
- What directive binds data to input in Vue.js?
- v-bind
- v-model
- v-if
- v-text
- Which of the following is a lifecycle hook in Vue.js?
- onRender
- created
- initialize
- preMount
- In Vue, which syntax is correct for dynamic class binding?
- :class="className"
- v-bind-class="className"
- bind:class="className"
- class:bind="className"
Frontend :
- What’s the correct way to define a lambda function in Python?
- lambda x: x+1
- function(x) => x+1
- def lambda(x): return x+1
- fn x => x + 1
- What is the output of print(2 ** 3 ** 2) in Python?
- 64
- 512
- 256
- Error
- In PHP, which superglobal is used for form data from GET?
- $_POST
- $_GET
- $_FORM
- $_REQUEST
Backend :
- Which SQL command is used to remove duplicates?
- UNIQUE
- REMOVE DUPLICATES
- DISTINCT
- NO DUPLICATE
Database :
- Which of the following is NOT a frontend technology?
- Vue.js
- CSS
- React
- Flask
Mixed Quiz :
Weekly Cross-Domain Activities ( Updated ) ( May 02 to May 08, 2025 )
API of the Day:
Challenge : Cat Facts API
Build a fun web app that displays random cat facts. Add a "New Fact" button to fetch and display a new fact with each click.
API: https://catfact.ninja/fact
Linux/DevOps Tip:
Automate Backups with cron
Use crontab -e to schedule a daily backup of a directory:
0 2 * * * tar -czf /backup/$(date +\%F).tar.gz /your/data/folder
This runs at 2:00 AM daily and compresses your target folder into a date-stamped .tar.gz archive.
Real-World Project of the Week ( Updated ) ( May 02 to May 08, 2025 )
Project of the Week:
- Users should be able to create blog posts using Markdown files. Convert them to HTML for rendering.
Build a Markdown Blog Engine using Node.js + Express or Flask.
Collaborative Project:
Contribute to Public APIs GitHub repo — help by submitting useful APIs or improving documentation for developers worldwide.
Case Study:
Study "Trello" clone functionality
Focus on drag-and-drop lists, card management, and task labels using React + Redux or Vue + Pinia.
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 30-04-2025 01-05-2025 02-05-2025 05-05-2025 06-05-2025