w3resource

Daily Coding Challenges & Projects


Monday


Frontend Mini Project Challenge

JavaScript Logic Puzzle:

Challenge:

  • Write a function deepSum(arr) that takes a deeply nested array of numbers and returns the total sum without using recursion or flat(Infinity).
  • // Example Input: [1, [2, [3, [4]], 5]]
  • // Output: 15

Debug It:

    
    const nums = [10, 20, 30];
    const doubled = nums.map(n => {
      n * 2;
    });
    console.log(doubled); // What's wrong here?
    

Try it online: Use JSFiddle/CodePen/Replit for users to test.

Backend Challenge

C, C++, C#

C Challenge:

Problem:

    Write a C program that reverses a singly linked list and prints the result.

C++ Challenge:

Problem:

    Create a simple command-line password manager using std::map and file storage (basic file I/O).

Swift (Vapor)

Problem:

    Create a simple POST API to accept contact form submissions and store in memory.

C# Challenge:

Problem:

    Build a minimal console app to simulate a simple bank system with deposit/withdraw features and balance checking.

Database Query Challenge

Problems on SQL - HR Database :

  1. Write a SQL query to find employees who are earning more than the average salary of their department.
  2. Write a SQL query to find departments where no employee has been hired in the last 12 months.
Structure of HR database :

HR database



Data Structures & Algorithms Challenge

  • Easy:
    • Problem: Given an array, check if it contains duplicates.
    • Hint: Use a Set.
  • Medium:
    • Problem: Rotate an array of n elements to the right by k steps.
    • Hint: Use reverse-based approach.
  • Hard:
    • Problem: Implement a min stack (support push, pop, top, and retrieving the minimum element in constant time).
    • Hint: Use two stacks.

Bug of the Day

C

Bug ( C ):

    Code:

    
    #include 
    
    int main() {
        int x = 10;
        if(x = 5)
            printf("X is five\n");
        return 0;
    }
    
    

    Challenge: Find and fix the bug.

📋 Daily Micro-Project

Frontend

Challenge: Build a responsive "Progress Bar" that visually fills based on a number input (0–100%).

  • Use only HTML, CSS, and JavaScript
  • Bonus: Add a color gradient animation as the bar fills.

Trivia: 5 Fun Facts

  1. Linus Torvalds created Git after a dispute with BitKeeper in 2005.
  2. The first computer bug was a real moth.
  3. JavaScript was created in just 10 days by Brendan Eich.
  4. Grace Hopper popularized the term “debugging.”
  5. The term "stack overflow" comes from an actual memory error.

Tool of the Day

Tool : Ray.so

  • Turn your code into beautiful images for sharing online — great for portfolios or social media.
    • Resource Roundup:

      • JavaScript30 by Wes Bos
      • C++ Fundamentals on freeCodeCamp
      • C# Tutorial Series on Microsoft Learn

    Interview Question of the Day

    Daily Interview Questions

      Frontend (JavaScript) :
      1. What is the difference between null and undefined?
      2. What is event bubbling and how do you stop it?
      3. What is the difference between == and ===?
      4. How does lexical scoping work in JavaScript?
      Backend (C, C++, C#) :
      1. What is a segmentation fault and how can you avoid it in C?
      2. Explain how memory management works in C++.
      3. What is the difference between a pointer and a reference?
      4. What are async/await keywords used for in C#?
      Database :
      1. What is the difference between INNER JOIN and OUTER JOIN?
      2. How does a composite index work?
      3. What is a foreign key constraint?
      Others :
      1. What is a system call in operating systems?
      2. What is the purpose of a Makefile in C/C++ projects?

    Daily Quiz Challenge

      Frontend (JavaScript) :

      1. What does typeof null return?
        • null
        • "null"
        • "object"
        • "undefined"
      2. What is the output?
      3. 
        #include 
        console.log([1, 2] + [3, 4]);
        
        • [1,2,3,4]
        • "1,23,4"
        • "1,23,4"
        • "1,23,4"
      4. Which event is fired when an input loses focus?
        • change
        • blur
        • focus
        • input

      Backend (C/C++/C#) :

      1. Which data structure uses LIFO?
        • Queue
        • Stack
        • Linked List
        • Heap
      2. What does malloc return on failure?
        • 0
        • -1
        • NULL
        • Segfault
      3. What keyword is used to inherit a class in C++?
        • class
        • this
        • public
        • base

      Database :

      1. Which clause filters after GROUP BY?
        • WHERE
        • SELECT
        • HAVING
        • ORDER BY

      Others :

      1. Which of these is NOT a containerization tool?
        • Docker
        • Kubernetes
        • VirtualBox
        • Podman

    Weekly Cross-Domain Activities ( April 25 to May 01, 2025 )

    API of the Day:

    Challenge:

    Use the Bored API to create a simple app that suggests fun activities when you're bored.


    Linux/DevOps Tip:

    Useful Commands for File & Directory Management and Troubleshooting

      Here are 10 powerful and often underused commands for managing files and debugging issues in Linux systems:

      1. stat filename – View detailed metadata about a file (last access, inode, etc.)
      2. ls -lhS – List files by size in human-readable format
      3. tree -L 2 – Display a directory structure up to 2 levels deep
      4. find /path -type f -size +100M – Find files larger than 100MB
      5. ncdu – A disk usage analyzer with a simple interactive UI (install required)
      6. lsof +D /path/to/dir – List open files in a directory
      7. inotifywait -m /some/dir – Watch for real-time file changes in a directory (from inotify-tools)
      8. file filename – Determine file type and encoding
      9. tail -F /var/log/syslog – Live-follow system logs with file rotation support
      10. watch -n 1 'df -h / && free -h' – Watch disk and memory stats refresh every second

    Real-World Project of the Week ( April 25 to May 01, 2025 )

    Project of the Week:

      Build a Personal Expense Tracker App

    • Tech Stack Options:
      • TypeScript + Express + PostgreSQL + React

    Collaborative Project:

    Case Study:

      How is Notion Built?

    • Uses React + TypeScript frontend
    • Backend with C++/Rust hybrid for performance
    • Offline-first architecture

    Challenge: Try replicating a basic note-taking component!


    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

    

    Follow us on Facebook and Twitter for latest update.