w3resource

Daily Coding Challenges & Projects


Wednesday


Frontend Mini Project Challenge

Vue.js Components

Challenge :

Build a Dynamic List Component in Vue.js

    Create a Vue.js component where users can:

  • Add new items
  • Delete items
  • Edit items inline

Requirements :

  • Use v-model for binding input
  • Use v-for and v-on for dynamic rendering and events

Try it on CodeSandbox (example playground suggestion)

Backend Challenge

Python & PHP

Python :

    Write a Python script that :

    • Monitors a folder for any new files
    • Automatically logs the filename and timestamp when a file is added

Hint : Use the watchdog library for filesystem monitoring.


PHP :

    Create a simple login API in PHP that :

    • Accepts username & password via POST
    • Validates against hardcoded credentials
    • Returns a JSON response with status and message

Database Query Challenge

Problems on SQL - HR Database :

  1. Write a SQL query to list all departments that have more than 5 employees.
  2. Find employees whose salary is below the average salary of their department.

HR database



Data Structures & Algorithms Challenge

  • Easy:
    • Problem : Reverse a string without using built-in functions.
    • Hint : Use a loop to build the string backward.
  • Medium:
    • Problem : Find the longest substring without repeating characters.
    • Hint : Use sliding window technique.
  • Hard:
    • Problem : Implement an LRU (Least Recently Used) Cache using a hash map and a doubly linked list.
    • Hint : Use OrderedDict in Python or create a custom structure.

Bug of the Day

Python & PHP

Python Bug :

    Buggy Code:

    
    def divide(a, b):
        try:
            return a / b
        except:
            return "Error!"
    
    print(divide(10, 0))
    
    

Challenge : Identify the flaw in the exception handling. How can it be improved?


PHP Bug :

    Buggy Code:

    
    <?php
    $number = "10";
    if ($number === 10) {
        echo "Equal";
    } else {
        echo "Not Equal";
    }
    ?>
    
    

Challenge : Fix the comparison logic


📋 Daily Micro-Project

Database Focus :

Micro-Project :

Optimize a slow SQL query that selects employee details with salary, department, and manager name.

Add appropriate indexes and rewrite the query using JOINs efficiently


Trivia: 5 Fun Facts

  1. Who created PHP?
  2. What does SQL stand for?
  3. Which company developed Vue.js?
  4. Which programming language was originally called Oak?
  5. What is the mascot of Python?

Tool & Resource of the Day

Tool : Postman

Use Postman to test and debug APIs quickly with a user-friendly interface.

Resource Roundup :

  • Postman Learning Center
  • Postman API Testing Tutorial (YouTube)
  • Free API Collections to Practice: public APIs

Interview Question of the Day

Daily Interview Questions

    Frontend ( Vue.js, JavaScript ) :
    1. What is a Vue.js directive? Provide an example.
    2. How does Vue’s reactivity system work?
    3. Explain the difference between v-if and v-show.
    4. How does watch differ from computed in Vue.js?
    Backend ( Python, PHP ) :
    1. What are Python decorators? Give a use case.
    2. How does PHP handle sessions?
    3. What is the Global Interpreter Lock (GIL) in Python?
    4. What are magic methods in PHP? Name a few examples.
    Database :
    1. What is a subquery and how is it used?
    2. Explain the difference between GROUP BY and ORDER BY.
    3. What is a foreign key constraint?
    Others :
    1. What is a race condition in concurrent programming?
    2. Explain what CI/CD is and how it helps in DevOps.

Daily Quiz Challenge

    Frontend Quiz ( Vue, JavaScript ) :

    1. What is the output of: typeof null?
      • "object"
      • "null"
      • "undefined"
      • "boolean"
    2. In Vue, which directive is used to bind a property?
      • v-model
      • v-bind
      • v-on
      • v-for
    3. What does v-if do?
      • Iterates over an array
      • Conditionally renders an element
      • Binds input data
      • None of the above

    Backend Quiz ( Python, PHP ) :

    1. Which keyword is used to handle exceptions in Python?
      • try
      • catch
      • except
      • handle
    2. What is the default superglobal used to retrieve POST data in PHP?
      • $_GET
      • $_POST
      • $_DATA
      • $_SERVER
    3. In Python, what is the output of bool([ ])?
      • True
      • False
      • None
      • Error

    Database :

    1. Which SQL clause is used to filter grouped rows?
      • WHERE
      • GROUP BY
      • HAVING
      • FILTER

    Others :

    1. Which command lists all running Docker containers?
      • docker start
      • docker list
      • docker ps
      • docker show

Weekly Cross-Domain Activities ( May 23 to May 29, 2025 )

API of the Day:

Project: Build a news feed using the NewsAPI.

  • Endpoint: https://newsapi.org/v2/top-headlines?country=us
  • Display the title, image, and description of each article.

Linux/DevOps Tip :

10 Useful Commands for Monitoring Server Health:

  • top, htop, iotop, vmstat, netstat, free -m, df -h, uptime, iostat, dstat

Real-World Project of the Week ( May 23 to May 29, 2025 )

Project of the Week:

    Build a "Remote Job Board" with React (Frontend), Node.js (Backend), PostgreSQL (Database).


Collaborative Project:

Contribute to Public APIs GitHub Repo – Add new APIs with proper documentation.

Case Study:

  • Analyze how Trello uses drag-and-drop + real-time sync.
  • Rebuild a Trello-style kanban board with Vue.js or React + Firebase.

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  21-05-2025  22-05-2025  23-05-2025  26-05-2025  27-05-2025



Follow us on Facebook and Twitter for latest update.