w3resource

Daily Coding Challenges & Projects


Monday


Frontend Mini Project Challenge

JavaScript Logical Puzzles & Debugging

Challenge :

Write a function that returns all combinations of elements from a given array of characters.

Input Example :

generateCombinations(['a', 'b', 'c']);

Expected Output (order doesn't matter):

["a", "b", "c", "ab", "ac", "bc", "abc"]

Bonus :

Can you do it without recursion and without using built-in combination generators?

Buggy Starter Code :

 
function generateCombinations(arr) {
  let result = [];
  for (let i = 0; i < arr.length; i++) {
    for (let j = i; j < arr.length; j++) {
      result.push(arr[i] + arr[j]);
    }
  }
  return result;
}

What's Wrong?

  • It misses many valid combinations.
  • Debug and rewrite it to work for all cases.

Try it online : JSFiddle / CodePen

Backend Challenge

C, C++, C#

Language Focus : C

Challenge : Write a program in C to reverse a singly linked list.

 
struct Node {
    int data;
    struct Node* next;
};
struct Node* reverseList(struct Node* head) {
    // Implement logic to reverse the linked list
}

Bonus : Make sure your solution handles edge cases like an empty list or a single node.


Database Query Challenge

Problems on SQL - HR Database :

  1. Write a query to find employees who joined in the last 3 months.
  2. Write a SQL query to list departments where the average salary is below the overall company average.
Structure of HR database :

HR database



Data Structures & Algorithms Challenge

  • Easy:
    • Problem : Find the second largest number in an array.
    • Hint : Keep track of the largest and second largest while iterating once.
  • Medium:
    • Problem : Implement a Min Stack with push, pop, top, and getMin in O(1) time.
    • Hint : Use an auxiliary stack to track minimums.
  • Hard:
    • Problem : Given an array of intervals, merge all overlapping intervals.
    • Hint : Sort intervals and compare ends.

Bug of the Day

C

Bug – C :

    Buggy Code:

    
    #include 
    int main() {
        int a = 5, b = 0;
        int result = a / b;
        printf("%d", result);
        return 0;
    }
    

Challenge : What’s wrong with this code? Fix it to avoid runtime errors and add proper error handling.


📋 Daily Micro-Project

Frontend Focus :

Micro-Project :

Build a JavaScript digital clock that updates every second. Display hours, minutes, and seconds in real-time.

Bonus : Add AM/PM and support for dark/light mode toggle.


Trivia: 5 Fun Facts

  1. Dennis Ritchie created the C programming language in 1972.
  2. JavaScript was developed in just 10 days by Brendan Eich.
  3. Git was originally created by Linus Torvalds in 2005.
  4. The first computer bug was an actual moth.
  5. Python is named after Monty Python, not the snake.

Tool & Resource of the Day

Tool : Liveblocks

Link : Liveblocks

Build real-time collaborative experiences (e.g., live cursors, multiplayer editing) with ease in any frontend app (React, Vue, etc). Great for building Google Docs-like UIs without managing WebSockets manually.

Resource Roundup :

  • Frontend Mastery Handbook – A comprehensive guide for frontend developers with the latest trends, tools, and best practices.
  • SmolCSS.dev – Minimal, modern CSS snippets for layout, UI patterns, and accessibility.

Interview Question of the Day

Daily Interview Questions

    Frontend :
    1. What is the difference between null and undefined in JavaScript?
    2. Explain how the event delegation pattern works in JavaScript.
    3. How does the Virtual DOM work in React, and why is it useful?
    4. What are the key differences between Vue.js computed properties and watchers?
    Backend :
    1. Explain the difference between synchronous and asynchronous programming in Node.js.
    2. What is the difference between a thread and a process?
    3. How does memory management work in Python?
    4. Explain how a RESTful API differs from GraphQL.
    Database :
    1. What is the difference between inner join and left join in SQL?
    2. How does indexing improve query performance in databases?
    3. What is the difference between NoSQL and SQL databases?
    Others :
    1. What are system calls in an operating system? Provide an example.
    2. What is containerization, and how does Docker help in deployment?

Daily Quiz Challenge

    Frontend Quiz ( JavaScript ) :

    1. What is the output of this code?
      • console.log(typeof NaN);
        
      • "number"
      • "NaN"
      • "undefined"
      • "object"
    2. Which method can be used to convert a string to an integer in JavaScript?
      • parseInt()
      • toFixed()
      • slice()
      • split()
    3. What does === do in JavaScript?
      • Compares only values
      • Compares values and types
      • Converts then compares
      • None of the above

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

    1. Which header is used to allocate memory dynamically in C?
      • <stdlib.h>
      • <stdio.h>
      • <conio.h>
      • <string.h>
    2. What is the output of this C code?
      • console.log(typeof null);
        
      • 1
      • 2
      • 4
      • Platform dependent
    3. Which of these is not a valid loop in C++?
      • while
      • do-while
      • foreach
      • for

    Database :

    1. Which SQL clause is used to filter grouped rows?
      • WHERE
      • HAVING
      • GROUP
      • FILTER

    Others :

    1. What is the command to view running processes in Linux?
      • ps
      • run
      • proc
      • ls -proc

    Mixed Quiz :

    1. What is the correct way to declare a function in JavaScript?
      • function myFunc = () {}
      • func myFunc() {}
      • function myFunc() {}
      • def myFunc():

Weekly Cross-Domain Activities ( May 23 to May 29, 2025 )

API of the Day:

Project: Build a news feed using the NewsAPI.

  • Endpoint: https://newsapi.org/v2/top-headlines?country=us
  • Display the title, image, and description of each article.

Linux/DevOps Tip :

10 Useful Commands for Monitoring Server Health:

  • top, htop, iotop, vmstat, netstat, free -m, df -h, uptime, iostat, dstat

Real-World Project of the Week ( May 23 to May 29, 2025 )

Project of the Week:

    Build a "Remote Job Board" with React (Frontend), Node.js (Backend), PostgreSQL (Database).


Collaborative Project:

Contribute to Public APIs GitHub Repo – Add new APIs with proper documentation.

Case Study:

  • Analyze how Trello uses drag-and-drop + real-time sync.
  • Rebuild a Trello-style kanban board with Vue.js or React + Firebase.

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



Follow us on Facebook and Twitter for latest update.