w3resource

Daily Coding Challenges & Projects


Wednesday


Frontend Mini Project Challenge

Vue.js Components

Challenge :

Build a Reusable Alert Component in Vue.js

Requirements :

  • Component should accept type, message, and dismissible props
  • Types include success, error, warning, etc.
  • Implement slots for dynamic content and conditionally render close button.

Bonus : Animate the alert entry/exit using transition.

Backend Challenge

Python, PHP

Challenge : Create a File Upload API

Python : Use Flask or FastAPI

PHP : Use Laravel or raw PHP

Requirements:

  • Accept file uploads (image/pdf).
  • Validate file type and size.
  • Save uploaded file to a local directory and return URL path.

Bonus: Add a route to list all uploaded files.

Database Query Challenge

Problems on SQL - HR Database :

  1. Write a SQL query to find departments where the average salary is above $10,000.
  2. Write a SQL query to display the second highest-paid employee from each department.

HR database



Data Structures & Algorithms Challenge

  • Easy:
    • Problem : Given a string, check if it is a palindrome (ignoring case and non-alphanumeric characters).
    • Hint : Use two-pointer technique after cleaning the string.
  • Medium:
    • Problem : Implement an LRU (Least Recently Used) Cache with get and put operations.
    • Hint : Combine a hashmap with a doubly linked list for O(1) operations.
  • Hard:
    • Problem : Given an array of integers, return the length of the longest increasing subsequence.
    • Hint : Use dynamic programming or binary search optimization.

Bug of the Day

Python, PHP

Language : Python Bug

    Buggy Code:

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

Challenge : What’s the bug here? Fix the function so that multiply(3) does not retain state from the previous call


📋 Daily Micro-Project

Database Focus :

Task :

Analyze Employee Retention using SQL

  • Calculate average tenure of employees in each department.
  • Identify departments with the highest attrition rate (left vs. total employees).

Bonus : Visualize results using a simple report layout.

Trivia: 5 Fun Facts

  1. Python was created by Guido van Rossum in 1989.
  2. PHP originally stood for Personal Home Page.
  3. Vue.js was created by Evan You, a former Google engineer.
  4. PostgreSQL started in 1986 under the name POSTGRES.
  5. Python's name comes from Monty Python, not the snake.

Tool & Resource of the Day

Tool : DBDiagram.io

Design and visualize ER diagrams quickly online.

https://dbdiagram.io

Resource Roundup

  • Python Data Structures – Real Python
  • Vue Mastery - Free Vue Courses

Interview Question of the Day

Daily Interview Questions

    Frontend :
    1. What are props in Vue.js and how do they differ from data()?
    2. Explain the lifecycle hooks in Vue.js.
    3. What is the virtual DOM in Vue.js and how does it help performance?
    4. How does Vue handle two-way binding?
    Backend ( Python/PHP ) :
    1. How does Python handle memory management?
    2. Explain the difference between @staticmethod and @classmethod in Python.
    3. What is Composer in PHP and why is it used?
    4. How do you handle errors in PHP securely?
    Database ( SQL ) :
    1. What is normalization and why is it important?
    2. What is a foreign key constraint and how does it affect deletes/updates?
    3. What is a CTE (Common Table Expression) and when is it useful?
    Others :
    1. What is a deadlock in a database transaction system?
    2. What is the difference between virtual memory and RAM?

Daily Quiz Challenge

    Frontend Quiz ( Vue.js ) :

    1. What does v-model do in Vue.js?
      • One-way binding
      • Two-way binding
      • Event handling
      • Routing
    2. What lifecycle hook is called after the component is mounted?
      • created
      • mounted
      • updated
      • beforeMount
    3. Which directive is used for conditional rendering in Vue?
      • v-for
      • v-if
      • v-bind
      • v-on

    Backend Quiz ( Python, PHP ) :

    1. What does __init__ do in Python?
      • It's a loop
      • It initializes the class
      • It's a destructor
      • It’s unused
    2. What does isset($var) do in PHP?
      • Deletes a variable
      • Returns variable length
      • Checks if a variable is set
      • Declares a variable
    3. What is the output of print(2 ** 3) in Python?
      • 6
      • 8
      • 9
      • Error

    Database :

    1. Which SQL keyword is used to remove duplicate rows?
      • UNIQUE
      • PRIMARY
      • DISTINCT
      • HAVING

    Mixed Quiz :

    1. Which of these is not a backend framework?
      • Flask
      • Laravel
      • React
      • Express

Weekly Cross-Domain Activities ( June 13 to June 19, 2025 )

API of the Day:

OpenWeatherMap API :

Use the REST Countries API

Task : Build a React app that lets users search a country and shows its flag, capital, and region.


Linux/DevOps Tip :

Top 5 Linux commands for server monitoring:

  • top
  • htop
  • vmstat
  • iotop
  • netstat -tulpn

Real-World Project of the Week ( June 13 to June 19, 2025 )

Project of the Week:

Build a Task Manager App (Frontend + Backend + DB)

  • Use React for UI
  • Node.js + Express for API
  • PostgreSQL for data persistence

Collaborative Project:

Contribute to the open-source Habit Tracker project on GitHub: github.com/codecrafters-io/habit-tracker.

Case Study:

How Notion Manages Real-Time Collaboration:

  • WebSockets, Operational Transform (OT), and React for UI syncing.
  • Try replicating a collaborative notes editor using Firebase Realtime DB


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  11-06-2025  12-06-2025  13-06-2025  16-06-2025  17-06-2025



Follow us on Facebook and Twitter for latest update.