w3resource

Daily Coding Challenges & Projects


Wednesday


Frontend Mini Project Challenge

Vue.js :

  • Challenge: Build a Vue.js Dynamic Todo List
  • Difficulty Level: Moderate
  • Requirements:
    • Users should be able to add, edit, and delete tasks.
    • Use Vue 3 and the Composition API.
    • Style it with Tailwind or Bootstrap.
    • Bonus: Implement local storage to persist tasks.

Backend Challenge

Python & PHP :

  • Python Challenge:
    • Write a Python function to generate a Fibonacci series using generators instead of recursion or loops.
  • PHP Challenge:
    • Create a PHP function to hash and verify passwords securely using password_hash() and password_verify().

Database Query Challenge

Problems on SQL - HR Database :

  1. Find the top 3 highest-paid employees in each department.
  2. Write a query to fetch employees who have not taken leave in the last 6 months.
Sample table: employees
+-------------+-------------+-------------+----------+--------------------+------------+------------+----------+----------------+------------+---------------+
| EMPLOYEE_ID | FIRST_NAME  | LAST_NAME   | EMAIL    | PHONE_NUMBER       | HIRE_DATE  | JOB_ID     | SALARY   | COMMISSION_PCT | MANAGER_ID | DEPARTMENT_ID |
+-------------+-------------+-------------+----------+--------------------+------------+------------+----------+----------------+------------+---------------+
|         100 | Steven      | King        | SKING    | 515.123.4567       | 2003-06-17 | AD_PRES    | 24000.00 |           0.00 |          0 |            90 |
|         101 | Neena       | Kochhar     | NKOCHHAR | 515.123.4568       | 2005-09-21 | AD_VP      | 17000.00 |           0.00 |        100 |            90 |
|         102 | Lex         | De Haan     | LDEHAAN  | 515.123.4569       | 2001-01-13 | AD_VP      | 17000.00 |           0.00 |        100 |            90 |
|         103 | Alexander   | Hunold      | AHUNOLD  | 590.423.4567       | 2006-01-03 | IT_PROG    |  9000.00 |           0.00 |        102 |            60 |
|         104 | Bruce       | Ernst       | BERNST   | 590.423.4568       | 2007-05-21 | IT_PROG    |  6000.00 |           0.00 |        103 |            60 |
|         105 | David       | Austin      | DAUSTIN  | 590.423.4569       | 2005-06-25 | IT_PROG    |  4800.00 |           0.00 |        103 |            60 |
|         106 | Valli       | Pataballa   | VPATABAL | 590.423.4560       | 2006-02-05 | IT_PROG    |  4800.00 |           0.00 |        103 |            60 |
|         107 | Diana       | Lorentz     | DLORENTZ | 590.423.5567       | 2007-02-07 | IT_PROG    |  4200.00 |           0.00 |        103 |            60 |
|         108 | Nancy       | Greenberg   | NGREENBE | 515.124.4569       | 2002-08-17 | FI_MGR     | 12008.00 |           0.00 |        101 |           100 |
|         109 | Daniel      | Faviet      | DFAVIET  | 515.124.4169       | 2002-08-16 | FI_ACCOUNT |  9000.00 |           0.00 |        108 |           100 |
.......

View the table



Data Structures & Algorithms Challenge

  • Easy: Reverse a string without using built-in functions.
  • Medium: Implement a circular queue using an array.
  • Hard: Given a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes.

Bug of the Day

Python & PHP Debugging Challenge :

Python Bug:


def multiply_list(nums):
    result = 1
    for num in nums:
        result *= num
    return result

print(multiply_list([]))  # What’s wrong here?

Find and fix the issue!

PHP Bug:


function divide($a, $b) {
    return $a / $b;
}
echo divide(10, 0); // What's the issue?

Find and fix the issue!

📋 Daily Micro-Project

Database Focus

    Optimize a slow SQL query by adding appropriate indexes and restructuring the query for better performance.

Trivia: 5 Fun Facts

  1. Who invented SQL and in which year?
  2. What was the first database management system?
  3. What does ACID stand for in databases?
  4. Which company developed MySQL before it was acquired by Oracle?
  5. What’s the difference between OLAP and OLTP databases?

Tool of the Day

Tool: DBeaver – A powerful database management tool for SQL databases.

Why use it? Supports multiple databases (PostgreSQL, MySQL, SQLite, etc.), provides visual query building, and is open-source.

Interview Question of the Day

Daily Interview Questions

    Frontend (Vue.js): (4 Questions)
    1. What is the difference between computed properties and methods in Vue.js?
    2. Explain how Vue.js reactivity works.
    3. What are Vue directives, and name three commonly used ones?
    4. How does Vue handle two-way data binding?
    Backend (Python & PHP): (4 Questions)
    1. What are Python decorators, and how do they work?
    2. How does PHP handle sessions and cookies?
    3. Explain the difference between deep copy and shallow copy in Python.
    4. What are named arguments in PHP, and why are they useful?
    Database (3 Questions)
    1. How does sharding work in databases?
    2. What is the difference between clustered and non-clustered indexes?
    3. Explain the concept of stored procedures and their advantages.
    Others ( OS & DevOps ): (2 Questions)
    1. What are system calls, and why are they important?
    2. What is container orchestration, and how does Kubernetes help?

Daily Quiz Challenge

Frontend Quiz Vue.js (3 Questions)

  1. What is the main advantage of Vue 3’s Composition API?
  2. How does Vue Router handle dynamic routing?
  3. What is the purpose of the v-if directive?

Backend Quiz Python & PHP (3 Questions)

  1. What is the difference between == and is in Python?
  2. How does PHP handle error reporting?
  3. What does yield do in Python?

Others Quiz (2 Questions)

  1. Which SQL keyword is used to remove duplicate records?
  2. What is a daemon process in operating systems?

Weekly Cross-Domain Activities ( April 4 to 10, 2025 )

Task: Hints for Building a Simple Weather App using OpenWeatherMap API

  1. Get an API Key
    • Sign up at OpenWeatherMap and get a free API key.
  1. Choose an HTTP Request Method
    • Use fetch() in JavaScript or requests in Python to get weather data.
  1. API Endpoint Example
  1. Use this URL:
    • https://api.openweathermap.org/data/2.5/weather?q=London&appid=YOUR_API_KEY&units=metric
    • Replace London with the city name and YOUR_API_KEY with your actual API key
  1. Extract Important Data
    • Parse the JSON response to extract key details like temperature, humidity, and weather description.
  1. Display the Data
    • Show weather details in a simple UI using HTML, CSS, and JavaScript.
    • Example: Display city name, temperature, and weather conditions.
  1. Handle Errors Gracefully
    • Show an error message if the city is not found or the API call fails.
  1. Enhancements (Optional)
    • Allow users to enter any city name.
    • Show weather icons based on conditions.
    • Use geolocation to fetch the user’s current weather.

orgopenweathermap.org

Current weather and forecast - OpenWeatherMap

OpenWeather provides comprehensive weather data services, including current, forecast, and historical weather information. Explore a wide range of APIs for solar radiation, road risk assessment, solar energy prediction, and more, with global coverage and user-friendly access. Ideal for developers and businesses seeking accurate and reliable weather insights.

Real-World Project of the Week ( April 4 to 10, 2025 )

Project: Build a Personal Portfolio Website

Tech Stack: HTML, CSS, JavaScript (Optional: React, TailwindCSS)


Previous Daily Coding Challenges & Projects : 04-04-2025   07-04-2025  08-04-2025



Follow us on Facebook and Twitter for latest update.