w3resource

Daily Coding Challenges & Projects


Monday


Frontend Mini Project Challenge

JavaScript Logical Puzzle & Debugging

Challenge 1: JavaScript Logical Puzzle

Write a function flattenArray that flattens a nested array of arbitrary depth without using recursion.

Code:

    
    // Input: [1, [2, [3, [4]], 5]]
    // Output: [1, 2, 3, 4, 5]
    

Hint: Use a stack or a queue to iteratively flatten the array.

Challenge 2: JavaScript Debugging

Write a function flattenArray that flattens a nested array of arbitrary depth without using recursion.

Code:

    
    let x = 10;
    function check() {
      if (x = 5) {
        console.log("X is 5");
      }
    }
    check();
    
    

Task : Find and fix the bug.

Backend Challenge

C, C++, C#

    Challenge 1: C

    Problem:

    Write a function to reverse a linked list.

    Challenge 2: C++

    Problem:

    Implement a thread-safe singleton class using C++11.

    Challenge 3: C#

    Problem:

    Build a simple console app that reads a JSON file and displays its content using Newtonsoft.Json.

Database Query Challenge

Problems on SQL - HR Database :

  1. Write a SQL query to find employees who joined in the last 3 months.
  2. Write a SQL query to list employees whose salary is above the department average.
Structure of HR database :

HR database



Data Structures & Algorithms Challenge

  • Easy:
    • Problem: Check if a given string is a palindrome.
    • Hint: Use two-pointer technique.
  • Medium:
    • Problem: Implement LRU (Least Recently Used) Cache.
    • Hint: Use a hash map and a doubly linked list.
  • Hard:
    • Problem: Solve the "Word Ladder" problem (Shortest path from beginWord to endWord using dictionary transformation).
    • Hint: BFS + queue.

Bug of the Day

Language Focus :

C, C++, C#

Language: C

    Buggy Code:

    
    #include 
    int main() {
        int arr[5] = {1, 2, 3};
        for (int i = 0; i <= 5; i++) {
            printf("%d ", arr[i]);
        }
        return 0;
    }
    
    

    Challenge : Find and fix the logical error.

📋 Daily Micro-Project

Frontend

Project:

Build a CSS-only animated loading spinner using @keyframes.

Trivia: 5 Fun Facts

  1. JavaScript was created in just 10 days by Brendan Eich in 1995.
  2. The C programming language was developed in 1972 at Bell Labs.
  3. Git was created by Linus Torvalds, the creator of Linux.
  4. The first computer programmer is considered to be Ada Lovelace.
  5. CSS stands for Cascading Style Sheets and was first proposed in 1994.

Tool of the Day (Updated)

Tool: CodePen

    CodePen is a popular online code editor and social development environment for front-end designers and developers. It’s great for writing HTML, CSS, and JavaScript directly in the browser and seeing results instantly.

      Resource Roundup:

      • CodePen Learn
      • CodePen Collections

Interview Question of the Day

Daily Interview Questions

    Frontend : :
    1. What is the difference between null and undefined in JavaScript?
    2. Explain how event delegation works in JavaScript.
    3. How does the virtual DOM work in React?
    4. What is the difference between v-if and v-show in Vue.js?
    Backend :
    1. What's the difference between a thread and a process?
    2. How does memory allocation work in C?
    3. What is the difference between stack and heap memory?
    4. Explain the use of pointers in C and why they matter.
    Database :
    1. Explain normalization in SQL.
    2. What is a foreign key?
    3. What is the difference between clustered and non-clustered indexes?
    Others :
    1. What is a kernel in an operating system?
    2. What is the difference between Docker and a virtual machine?

Daily Quiz Challenge

    Frontend :

    1. What will typeof NaN return?
      • "number"
      • "NaN"
      • "undefined"
      • "object"
    2. What does document.querySelectorAll(".item") return?
      • Node
      • Array
      • NodeList
      • HTMLCollection
    3. Which CSS property is used to control stacking order?
      • float
      • z-index
      • stack-order
      • position

    Backend :

    1. Which operator is used to access members of a structure in C?
      • .
      • ->
      • ::
      • both a and b
    2. In C++, what is RAII?
      • A type of loop
      • Memory leak pattern
      • Resource Acquisition Is Initialization
      • Class inheritance
    3. In C#, what keyword is used to make a method asynchronous?
      • await
      • async
      • defer
      • thread

    Database :

    1. What SQL keyword is used to sort result sets?
      • ORDER
      • SORT
      • ORDER BY
      • GROUP BY

    Other Tech :

    1. What command is used to list files in a Linux directory?
      • ls
      • cd
      • list
      • mv

    Mixed Quiz :

    1. Which language uses indentation as syntax?
      • JavaScript
      • Python
      • C++
      • Java

Weekly Cross-Domain Activities ( Updated ) ( May 02 to May 08, 2025 )

API of the Day:

Challenge : Cat Facts API

Build a fun web app that displays random cat facts. Add a "New Fact" button to fetch and display a new fact with each click.

API: https://catfact.ninja/fact

Linux/DevOps Tip:

Automate Backups with cron

    Use crontab -e to schedule a daily backup of a directory:

    0 2 * * * tar -czf /backup/$(date +\%F).tar.gz /your/data/folder
    

    This runs at 2:00 AM daily and compresses your target folder into a date-stamped .tar.gz archive.

Real-World Project of the Week ( Updated ) ( May 02 to May 08, 2025 )

Project of the Week:

    Build a Markdown Blog Engine using Node.js + Express or Flask.

    • Users should be able to create blog posts using Markdown files. Convert them to HTML for rendering.

Collaborative Project:

    Contribute to Public APIs GitHub repo — help by submitting useful APIs or improving documentation for developers worldwide.

Case Study:

    Study "Trello" clone functionality

    Focus on drag-and-drop lists, card management, and task labels using React + Redux or Vue + Pinia.


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



Follow us on Facebook and Twitter for latest update.