w3resource

Daily Coding Challenges & Projects


Monday


Frontend Mini Project Challenge

JavaScript Logical Puzzle + Debugging

Challenge :

Puzzle: Write a function that counts how many times a number appears in a nested array of any depth.

Without using recursion.

// Input: [1, [2, 3, [4, 5, [1, 2]]], 1]
// Target: 1
// Output: 3
Debug This:
    
    const arr = [1, 2, 3];
    console.log(arr.map(parseInt)); // Why isn't this working as expected?
    

Try it online: JSFiddle / CodePen

Backend Challenge

Focus : C, C++, C#

C :

Task : Write a function in C to reverse the words in a string without using library functions.

Input: "hello world" → Output: "world hello"

C++ :

Task : Create a simple class BankAccount with deposit, withdraw, and balance check features. Demonstrate polymorphism with multiple account types.

C# :

Task : Create a console app that reads a JSON file with employee records and displays employees with salary > 50000.


Database Query Challenge

Problems on SQL - HR Database :

  1. Write a SQL query to list employees whose manager is in a different department.
  2. Write a query to display employees who were hired in the last 90 days

HR database



Data Structures & Algorithms Challenge

  • Easy:
    • Problem : Write a function to check if two strings are anagrams.
    • Hint : Use character frequency.
  • Medium:
    • Problem : Implement an LRU Cache (Least Recently Used).
    • Hint : Use a combination of HashMap and Doubly Linked List.
  • Hard:
    • Problem : Find the maximum subarray sum modulo m for a given array.
    • Hint : Prefix sums and TreeSet.

Bug of the Day

Language Focus : C, C++, C#

C Bug:

    Buggy Code:

    
    #include 
    int main() {
        int a = 10;
        if (a = 5)
            printf("True\n");
        else
            printf("False\n");
        return 0;
    }
    
    

What's wrong with the condition?


C++ Bug:

    Buggy Code:

    
    #include
    using namespace std;
    class Test {
        int x;
    public:
        void setX(int a) { x = a; }
        void print() { cout << x; }
    };
    int main() {
        Test t;
        t.print();
        return 0;
    }
    

Why does this print garbage or crash?


C# Bug:

    Buggy Code:

    
    string s = null;
    Console.WriteLine(s.ToString());
    
    

What's the runtime error here?

📋 Daily Micro-Project

Frontend

Challenge :

Create a CSS-only accordion component.

  • Show/hide content without JavaScript.
  • Use only HTML/CSS :checked trick or details/summary.

Try this on CodePen

Trivia: 5 Fun Facts

  1. The first computer programmer was Ada Lovelace, in the 1800s.
  2. The term “bug” in software was popularized after a real moth was found in a computer.
  3. Linux was created by Linus Torvalds in 1991.
  4. The first high-level programming language was Fortran, introduced in the 1950s.
  5. JavaScript was created in just 10 days by Brendan Eich.

Tool & Resource of the Day

Tool : Quokka.js

Live scratchpad for JavaScript/TypeScript with instant feedback. Great for logic debugging.

Resource Roundup:

  • JavaScript.info — Complete modern JS guide
  • CSS Tricks — CSS tips & tricks

Interview Question of the Day

Daily Interview Questions

    Frontend :
    1. What is the difference between null and undefined in JavaScript?
    2. How does event delegation work?
    3. What is the Virtual DOM in React and why is it efficient?
    4. How do Vue.js computed properties differ from watchers?
    Backend :
    1. Difference between synchronous and asynchronous code in C#?
    2. How does a process differ from a thread in C++?
    3. How is memory managed in C?
    4. What are the differences between POST and PUT HTTP methods?
    Database :
    1. Explain INNER JOIN vs LEFT JOIN.
    2. How does a database index improve performance?
    3. When would you choose a NoSQL DB over SQL?
    Others :
    1. What are system calls in operating systems?
    2. What is containerization, and how does Docker help in DevOps?

Daily Quiz Challenge

    Frontend Quiz ( JavaScript ) :

    1. What does typeof NaN return?
      • number
      • NaN
      • undefined
      • object
    2. What is the output of [1, 2] + [3, 4]?
      • [1, 2, 3, 4]
      • "1,23,4"
      • "1,23,4"
      • "1,23,4"
    3. Which keyword stops a loop in JavaScript?
      • skip
      • exit
      • break
      • stop

    Backend Quiz ( C, C++, C# ) :

    1. What is the default return type of main() in C?
      • void
      • int
      • char
      • float
    2. Which C++ feature supports function overloading?
      • Polymorphism
      • Inheritance
      • Encapsulation
      • None
    3. In C#, List<T> is part of which namespace?
      • System.Collections
      • System.Collections.Generic
      • System.Generic
      • System.Lists

    Database :

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

    Others :

    1. What does the chmod command do in Linux?
      • Change owner
      • Change permissions
      • Move file
      • Delete file

    Mixed Quiz :

    1. Frontend: What is the output of !!0?
    2. Backend: What's the difference between stack and heap?
    3. Database: What does SELECT COUNT(*) return?
    4. Other: What port does HTTP use?

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



Follow us on Facebook and Twitter for latest update.