w3resource

Daily Coding Challenges & Projects


Wednesday


Frontend Mini Project Challenge

Focus: Vue.js Components

Challenge :

Create a reusable Vue.js component named <UserBadge> that accepts props for username, avatarUrl, and isOnline. It should display:

Requirements :

  • The user's avatar.
  • The username.
  • A green dot if online, red if offline.

Try it Online: On Vue SFC Playground

Backend Challenge

Language Focus : Python & PHP

Python Challenge :

Task : Write a Python script that monitors a directory for file changes (add, remove, modify) in real-time without using third-party libraries.

Hint : Use os and time modules for polling.


PHP Challenge :

Task : Create a PHP script to validate and sanitize user-submitted emails, removing malicious characters and checking format.

Hint : Use filter_var() with FILTER_SANITIZE_EMAIL and FILTER_VALIDATE_EMAIL.


Database Query Challenge

Problems on SQL - HR Database :

  1. Find all employees who joined the company in the last 90 days.
  2. Find departments that have more than 5 employees.
Structure of HR database :

HR database



Data Structures & Algorithms Challenge

  • Easy:
    • Problem : Check if a string is a palindrome (ignore spaces and case).
    • Hint : Use two-pointer technique.
  • Medium:
    • Problem :Given an array of integers, return indices of the two numbers such that they add up to a specific target.
    • Hint : Use a hashmap to store seen values.
  • Hard:
    • Problem : Implement a Least Recently Used (LRU) cache with get/put in O(1) time.
    • Hint : Use OrderedDict in Python or combine hashmap + doubly linked list.

Bug of the Day

Language Focus: ( Python & PHP )

Python Bug :

    Buggy Code:

    
    $name = "John";
    echo 'Hello, $name!';
    
    
    

Fix : Provide default values for all required arguments or use argument checking.


PHP Bug :

    Buggy Code:

    
    val numbers = listOf(1, 2, 3, 4)
    println(numbers[4])
    

Fix : Use double quotes for variable interpolation:

echo "Hello, $name!";

📋 Daily Micro-Project

Backend Task :

Challenge :

Optimize a slow SQL query that joins employees, departments, and locations.

  • Add relevant indexes.
  • Rewrite query to avoid subqueries where possible.

Hint : Use EXPLAIN ANALYZE to evaluate query cost.


Trivia: 5 Fun Facts

  1. Python was named after Monty Python, not the snake.
  2. The first computer programmer was Ada Lovelace in the 1840s.
  3. PHP originally stood for "Personal Home Page."
  4. The first email was sent by Ray Tomlinson in 1971.
  5. JavaScript was created in just 10 days by Brendan Eich.

Tool & Resource of the Day

Tool : Postman

Use Postman for testing RESTful APIs with support for environments, tests, and mock servers.

Resource Roundup :

Interview Question of the Day

Daily Interview Questions

    Frontend ( Vue Focused ) :
    1. What are Vue.js computed properties used for?
    2. How does Vue.js handle reactivity?
    3. What’s the difference between v-show and v-if in Vue?
    4. Explain how slots work in Vue components.
    Backend ( Python & PHP ) :
    1. How is memory managed in Python?
    2. What’s the difference between include and require in PHP?
    3. How can you prevent SQL injection in PHP?
    4. What is the Global Interpreter Lock (GIL) in Python?
    Database :
    1. What is a database index and how does it work?
    2. What’s the difference between HAVING and WHERE in SQL?
    3. How would you normalize a database?
    Others :
    1. What is a daemon process in Linux?
    2. What is the difference between Docker image and container?

Daily Quiz Challenge

    Frontend ( Vue.js ) :

    1. What directive is used for conditional rendering in Vue?
      • v-if
      • v-show
      • v-render
      • Both a & b
    2. In Vue.js, what lifecycle hook is called after the component is mounted?
    3. What is the purpose of a key in a v-for loop?

    Backend ( Python & PHP ) :

    1. What does *args do in Python functions?
    2. How do you define a constant in PHP?
    3. Which PHP function is used to hash a password securely?

    Database ( SQL ) :

    1. Which SQL clause is used to group rows?

    Mixed Quiz :

    1. JS: What does typeof NaN return?
    2. SQL: What keyword is used to eliminate duplicates?
    3. Python: What’s the output of bool("")?

Weekly Cross-Domain Activities (Updated) ( May 16 to May 22, 2025 )

API of the Day:

Use the NASA Astronomy Picture of the Day (APOD) API

Challenge :

Build a mini web app that fetches and displays the daily astronomy picture from NASA's APOD API with its title and description.


Linux/DevOps Tip :

Monitor Disk Usage with du and ncdu

Commands :

  • Use du -sh * to get a summary of disk usage by folder.
  • Use ncdu (if installed) for a more interactive and visual exploration of what's eating up space in your directories.

Real-World Project of the Week (Updated) ( May 16 to May 22, 2025 )

Project of the Week:

    Build a Blog Platform with Markdown Support

    • Use a backend like Node.js, Flask, or Django.
    • Use a markdown parser (like marked in JS or markdown in Python) to render posts.
    • Add support for categories, tags, and featured images.

Bonus : Allow login functionality to create/edit/delete posts.


Collaborative Project:

Create a “Dev Tools Hub” Web App.

  • A multi-tool app offering features like:
    • JSON formatter
    • UUID generator
    • Base64 encoder/decoder
    • Regex tester
  • Organize collaboration via GitHub and assign different tools to team members.

Case Study:

How Trello Works — Kanban Task Boards.

  • Study how Trello organizes cards, lists, and boards.
  • Build a mini Kanban board with drag-and-drop functionality using Sortable.js or native drag-and-drop API.
  • Focus on data modeling and client-server sync logic.

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  07-05-2025  08-05-2025  09-05-2025  12-05-2025  13-05-2025  14-05-2025  15-05-2025  16-05-2025  19-05-2025  20-05-2025



Follow us on Facebook and Twitter for latest update.