w3resource

Daily Coding Challenges & Projects


Monday


Frontend Mini Project Challenge (Updated)

Focus : JavaScript Logical Puzzles & Debugging

Challenge :

Write a function flattenArray that flattens an arbitrarily nested array without using recursion.

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

Bonus Debug Task:

    What's wrong with this code?

    
    let nums = [1, 2, 3];
    let squared = nums.forEach(num => num * num);
    console.log(squared); // Fix the issue
    

Backend Challenge

Language Focus : C, C++, C#

C :

Task : Write a function to reverse a singly linked list using pointers.


C++ :

Task : Create a class BankAccount with deposit, withdraw, and balance check methods. Use proper encapsulation.


C# :

Task : Implement a simple console app that reads a CSV file of students and prints names of students with grades above 85.

Database Query Challenge

Problems on SQL - HR Database :

  1. Write a SQL query to find employees who joined within the last 90 days.
  2. Write a query to list employees who haven't received any salary increment in the past 2 years.
Structure of HR database :

HR database



Data Structures & Algorithms Challenge

  • Easy:
    • Problem : Check if a string has balanced parentheses:
    • Hint : Use Stack
    • 			Example input: "{[()]}" → true, "{[(])}" → false
      			
  • Medium:
    • Problem : Given a sorted array and a number target, find if two elements sum up to target.
    • Hint : Two-pointer approach
  • Hard:
    • Problem : Given a list of words, implement an autocomplete system that returns words starting with a given prefix.
    • Hint : Use Trie or Prefix Tree

Bug of the Day

Language Focus : C, C++, C#

C Bug:

    Buggy Code:

    
    int arr[3] = {1, 2, 3};
    printf("%d", arr[3]); // What's wrong?
    

C++ Bug:

    Buggy Code:

    
    std::vector v = {1, 2, 3};
    for (int i = 0; i <= v.size(); i++) {
        std::cout << v[i] << std::endl;
    }
    

C# Bug:

    Buggy Code:

    
    int[] numbers = new int[5];
    Console.WriteLine(numbers[5]); // Fix it
    

📋 Daily Micro-Project

Frontend Task : ( JS/CSS ):

Project :

Create a CSS-only animated loader that spins and pulsates using @keyframes.


Trivia: 5 Fun Facts

  1. The first computer bug was an actual moth found in a computer in 1947.
  2. Java was initially called “Oak”.
  3. The first website is still online: info.cern.ch
  4. Linux was created by Linus Torvalds in 1991.
  5. Git was also created by Linus Torvalds for Linux kernel development.

Tool & Resource of the Day

Tool : Polypane

    Description :A powerful browser for responsive web development and testing.

    Features :Preview multiple screen sizes simultaneously, accessibility checks, and synchronized scrolling.

    Link :https://polypane.app

Interview Question of the Day

Daily Interview Questions

    Frontend :
    1. What is the event loop in JavaScript?
    2. How do arrow functions differ from regular functions in JS?
    3. What are refs in React?
    4. Explain Vue.js lifecycle hooks.
    Backend :
    1. Explain memory allocation in C.
    2. What is the difference between stack and heap in C++?
    3. What is garbage collection in C#?
    4. How does multi-threading work in C#?
    Database :
    1. What is a foreign key in SQL?
    2. Explain the purpose of the HAVING clause.
    3. What are transactions in SQL?
    Others :
    1. What is a kernel in an operating system?
    2. Compare containers vs virtual machines.

Daily Quiz Challenge

    Frontend ( JavaScript ) :

    1. What does typeof NaN return?
      • 'undefined'
      • 'number'
      • 'NaN'>/
      • 'object'
    2. What will console.log(0.1 + 0.2 == 0.3) output?
      • true
      • false
    3. Which of the following is a valid way to declare a variable?
      • let x = 10;
      • var x = 10;
      • const x = 10;
      • All of the above

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

    1. What does sizeof(char) return in C?
      • 1
      • 2
      • 4
      • Compiler dependent
    2. In C++, which feature allows function overloading?
      • Inheritance
      • Polymorphism
      • Encapsulation
      • All of the above
    3. In C#, what keyword is used to inherit a class?
      • inherits
      • extends
      • base
      • :

    Database ( SQL ) :

    1. Which keyword is used to sort the result set?
      • ORDER
      • ORDERED
      • ORDER BY
      • SORT BY

    Others :

    1. What is the default port for HTTP?
      • 443
      • 21
      • 80
      • 25

    Mixed Quiz :

    1. Which of the following is not a primitive data type in JavaScript?
      • string
      • number
      • boolean
      • function

Weekly Cross-Domain Activities (Updated) ( May 16 to May 22, 2025 )

API of the Day:

Use the NASA Astronomy Picture of the Day (APOD) API

Challenge :

Build a mini web app that fetches and displays the daily astronomy picture from NASA's APOD API with its title and description.


Linux/DevOps Tip :

Monitor Disk Usage with du and ncdu

Commands :

  • Use du -sh * to get a summary of disk usage by folder.
  • Use ncdu (if installed) for a more interactive and visual exploration of what's eating up space in your directories.

Real-World Project of the Week (Updated) ( May 16 to May 22, 2025 )

Project of the Week:

    Build a Blog Platform with Markdown Support

    • Use a backend like Node.js, Flask, or Django.
    • Use a markdown parser (like marked in JS or markdown in Python) to render posts.
    • Add support for categories, tags, and featured images.

Bonus : Allow login functionality to create/edit/delete posts.


Collaborative Project:

Create a “Dev Tools Hub” Web App.

  • A multi-tool app offering features like:
    • JSON formatter
    • UUID generator
    • Base64 encoder/decoder
    • Regex tester
  • Organize collaboration via GitHub and assign different tools to team members.

Case Study:

How Trello Works — Kanban Task Boards.

  • Study how Trello organizes cards, lists, and boards.
  • Build a mini Kanban board with drag-and-drop functionality using Sortable.js or native drag-and-drop API.
  • Focus on data modeling and client-server sync logic.

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



Follow us on Facebook and Twitter for latest update.