w3resource

Daily Coding Challenges & Projects


Wednesday


Frontend Mini Project Challenge

Vue.js:

Challenge:

  • Build a Vue.js reusable alert component that supports different types like success, warning, and error.

Requirements:

  • Use props to accept type, message, and dismissible.
  • Conditionally style based on the alert type.
  • Add close button if dismissible is true.

Try it here: Play with Vue online

Backend Challenge

Python & PHP

    Python Challenge:

    • Task: Write a script that monitors a directory and logs whenever a new file is created.
    • Hint: Use watchdog or os module to observe directory events.

    PHP:

    • Task: Create a PHP script to validate and sanitize user inputs (name, email, phone).
    • Hint: Use filter_var() and htmlspecialchars().

Database Query Challenge

Problems on SQL - HR Database :

  1. Write a query to find employees who have not been assigned to any department.
  2. List departments that have fewer than 5 employees.
Structure of HR database :

HR database



Data Structures & Algorithms Challenge

  • Easy:
    • Problem: Write a function to check if a string is a palindrome.
    • Hint: Use two-pointer technique.
  • Medium:
    • Problem: Find the first non-repeating character in a string.
    • Hint: Use hash map to count frequencies.
  • Hard:
    • Problem: Implement an LRU Cache.
    • Hint: Combine a hash map with a doubly linked list for O(1) get/put.

Bug of the Day

Python & PHP

    Python Bug:

      Code:

      
      def multiply(a, b=[]):
          b.append(a)
          return b
      
      print(multiply(2))
      print(multiply(3))
      

      Challenge: What's wrong? Fix the function to avoid unexpected behavior.

    PHP Bug:

      Code:

      
      <?php
      $number = "10";
      if ($number === 10) {
          echo "It's ten!";
      } else {
          echo "Not ten.";
      }
      ?>
      

      Challenge: Why is it printing "Not ten."? Fix the issue.

📋 Daily Micro-Project

Database Focus

Task: Optimize this slow query on a large employees table:


SELECT * FROM employees WHERE email LIKE '%@company.com';
  • Hint:
  • Avoid LIKE '%...'
  • Add FULLTEXT index or refactor query.

Trivia: 5 Fun Facts

  1. The first computer bug was an actual moth stuck in a relay.
  2. Python is named after Monty Python, not the snake.
  3. PHP originally stood for "Personal Home Page."
  4. Linus Torvalds created Git in just 2 weeks.
  5. JavaScript was developed in just 10 days by Brendan Eich.

Tool of the Day

Tool : Postman

  • What it does: Easily test, monitor, and document RESTful APIs.
    • Resource Roundup:

      • Learn Vue.js - vuejs.org
      • Free Vue Course by VueMastery
      • Free REST API course (Postman + Express)

    Interview Question of the Day

    Daily Interview Questions

      Frontend : Vue.js Focused
      1. What's the difference between props and state in Vue?
      2. How do you emit an event from a child to a parent in Vue.js?
      3. What is Vue’s reactivity system and how does it work?
      4. How does Vue.js handle two-way data binding?
      Backend :
      1. What is Python's GIL and why does it matter?
      2. How does PHP handle session management?
      3. What is a Python generator and when would you use one?
      4. Explain RESTful principles and HTTP methods.
      Database :
      1. What is a foreign key constraint in SQL?
      2. What are ACID properties in databases?
      3. How does a clustered index work?
      Others :
      1. What is a shell in operating systems?
      2. Explain what DevOps pipelines are used for.

    Daily Quiz Challenge

    Frontend : Vue, JS

    1. What is the default value of v-model bound to a checkbox in Vue?
      • true
      • false
      • null
      • undefined
    2. What does v-if do in Vue?
      • Loops elements
      • Binds class
      • Conditionally renders DOM
      • None
    3. Which method is used to prevent the default event behavior in JavaScript?
      • stopPropagation()
      • preventDefault()
      • stopDefault()
      • blockDefault()

    Backend : Python, PHP

    1. What will print(bool("False")) return in Python?
      • True
      • False
    2. What does isset($var) do in PHP?
      • Declares a variable
      • Checks if variable is set
      • Initializes the value
      • None of the above
    3. What is the output of 2 ** 3 in Python?
      • 6
      • 8
      • 9
      • 5

    Others :

    1. Which clause is used to filter rows after grouping?
      • WHERE
      • HAVING
      • GROUP BY
      • SELECT
    2. What does HTTP stand for?
      • Hyper Transfer Text Protocol
      • Hyper Text Transfer Protocol
      • High Text Transfer Protocol
      • Hyper Terminal Transfer Protocol

    Mixed :

    1. Which of these is not a frontend framework?
      • Vue.js
      • Flask
      • React
      • Angular

    Weekly Cross-Domain Activities ( April 18 to 24, 2025 )

    API of the Day:

    Build a currency converter using the ExchangeRate API

    • Fetch live exchange rates
    • User selects currency pair and amount
    • Displays converted amount instantly

    Linux/DevOps Tip:

    10 Commands to Monitor Server Health:

  • top, htop, free -m, df -h, uptime, vmstat, iostat, netstat, dstat, sar.
  • Real-World Project of the Week ( April 18 to 24, 2025 )

    Project of the Week:

      Build a Task Manager App with login, add/edit/delete tasks, and due date reminders

    • Tech Stack Options:
      • React + Node.js + PostgreSQL

    Collaborative Project:

      Open-source GitHub Project: Habit Tracker App** ← let users add habits, track streaks, share progress. Invite community collaboration!

    Case Study:

      How Trello Works Under the Hood

    • Real-time updates using WebSockets
    • Kanban board layout
    • Offline support via IndexedDB
  • Encourage users to clone Trello features in a simplified clone!

  • 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

    

    Follow us on Facebook and Twitter for latest update.