w3resource

Daily Coding Challenges & Projects


Wednesday


Frontend Mini Project Challenge

Vue.js

Challenge :

Build a Reusable Vue.js Alert Component

  • Create a <CustomAlert> component with type prop (success, error, info).
  • Slot-based content for alert message.
  • Auto-dismiss after 5 seconds or manual close button.

Bonus : Use transition effects when alert appears/disappears

Backend Challenge

Python & PHP

Python Challenge :

Problem : Chunked File Processing

Write a Python script to read a massive log file in chunks and count the number of lines that contain the word "ERROR".


PHP :

Problem : Dynamic Image Thumbnail Generator

Create a PHP script that takes an image file and generates a thumbnail while maintaining the aspect ratio.


Database Query Challenge

Problems on SQL - HR Database :

  1. Find employees whose salary is below the department average.
  2. List departments that have more than 5 employees hired in the last year.

HR database



Data Structures & Algorithms Challenge

  • Easy:
    • Problem : Reverse a string using a stack.
    • Hint : Use list operations or a manual stack implementation.
  • Medium:
    • Problem : Find the majority element in an array (appears > n/2 times).
    • Hint : Try Moore’s Voting Algorithm.
  • Hard:
    • Problem : Given a matrix, find the longest increasing path.
    • Hint : Think DFS + memoization.

Bug of the Day

Language Focus : Python & PHP

Python Bug :

    Buggy Code:

    
    def multiply(a, b=2):
        return a * b
    
    print(multiply())  # Bug here
    
    

Challenge : Fix the issue and explain why it occurs.


PHP Bug :

    Buggy Code:

    
    <?php
    function greet($name = "Guest") {
        echo "Hello, $Name!";
    }
    greet("Alice");
    ?>
    
    
    

Challenge : Identify and fix the variable name bug.

📋 Daily Micro-Project

Database

Task :

Optimize a Slow SQL Query

You're given this query :


SELECT * FROM employees WHERE department_id IN (SELECT department_id FROM departments WHERE location_id = 1700);	

Timebox: 30 minutes

Micro-Project: Rewrite and optimize using JOIN and ensure EXPLAIN shows better performance.

Trivia: 5 Fun Facts

  1. PHP originally stood for “Personal Home Page.”
  2. Python was named after Monty Python’s Flying Circus.
  3. The first computer programmer is considered to be Ada Lovelace.
  4. SQL was originally developed at IBM in the early 1970s.
  5. The "GIL" (Global Interpreter Lock) is a notable feature of CPython.

Tool & Resource of the Day

Tool : Postman

Use Postman to test and document your API endpoints quickly.

Resource Roundup :

  • Free Vue.js Crash Course on Scrimba: https://scrimba.com/learn/vue
  • Vue.js Cheat Sheet by Vue Mastery
  • Free eBook: “Fullstack Vue” (sample chapters on GitHub)

Interview Question of the Day

Daily Interview Questions

    Frontend ( Vue.js Focus ) :
    1. What is the difference between v-if and v-show in Vue.js?
    2. How does Vue.js handle reactivity internally?
    3. Explain the Vue component lifecycle hooks.
    4. How do you pass data from parent to child in Vue.js?
    Backend ( Python & PHP ) :
    1. In Python, what are generators and when should you use them?
    2. How does memory management differ in Python vs. PHP?
    3. What are associative arrays in PHP?
    4. How do you handle file uploads securely in PHP?
    Database :
    1. What is a correlated subquery?
    2. How does the EXISTS clause work in SQL?
    3. When would you use denormalization in a relational database?
    Others :
    1. What is a context switch in operating systems?
    2. What’s the difference between Docker image and Docker container?

Daily Quiz Challenge

    Frontend Quiz ( Vue.js Focus ) :

    1. What directive is used to bind input in Vue.js?
      • v-model
      • v-bind
      • v-for
      • v-show
    2. In Vue.js, which of the following is NOT a lifecycle hook?
      • created
      • mounted
      • updated
      • initialized
    3. What is the correct way to pass a prop in Vue?
      • :propName="value"
      • v-prop="value"
      • prop-name:value
      • bind:prop=value

    Backend Quiz ( Python/PHP ) :

    1. What is the output of list("123") in Python?
    2. Which of these is not a valid Python data structure?
      • List
      • Stack
      • Dictionary
      • Set
    3. In PHP, which superglobal is used to retrieve form data sent via POST?
      • $_GET
      • $_POST
      • $_FORM
      • $_REQUEST

    Database :

    1. Which SQL command is used to change existing data in a table?
      • SELECT
      • UPDATE
      • INSERT
      • ALTER

    Mixed Quiz :

    1. What is the output of 2 + '2' in JavaScript?
      • 4
      • 22
      • NaN
      • Error

Weekly Cross-Domain Activities ( June 06 to June 12, 2025 )

API of the Day:

OpenWeatherMap API :

Challenge : Create a TypeScript + React component that fetches and displays current temperature and condition for a searched city.


Linux/DevOps Tip :

5 Handy Disk & Memory Commands

  • df -h: disk usage
  • du -sh *: directory sizes
  • free -m: memory usage
  • top: process monitoring
  • vmstat: system performance

Real-World Project of the Week ( June 06 to June 12, 2025 )

Project of the Week:

Build a Job Listing Board with search, filter by tech stack, and posting forms. Stack: React + Node.js + PostgreSQL

Collaborative Project:

Contribute to dev.to open-source. It’s the engine behind dev.to—built with Ruby on Rails.

Case Study:

Notion Clone UI – Study how Notion handles blocks and dynamic layouts using React.

Instagram Stories Feature

  • Built using horizontally swipable carousels
  • Preloading, caching, and state transitions
  • Challenge: Recreate it using React + CSS Transitions.


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  29-05-2025  30-05-2025  02-06-2025  03-06-2025  04-06-2025  05-06-2025  06-06-2025  09-06-2025  10-06-2025



Follow us on Facebook and Twitter for latest update.