w3resource

Daily Coding Challenges & Projects


Thursday


Frontend Mini Project Challenge

Theme : React Hooks & State Management

Challenge :

Create a React component <CounterWithTimer> that:

  • Starts at 0
  • Increments every second
  • Has "Pause" and "Reset" buttons

Tech Focus : useState, useEffect, clearInterval

Playground : Try it on CodeSandbox (link placeholder)

Backend Challenge

Language Focus : Node.js & Go

Node.js Challenge

Task : Build a simple REST API using Node.js + Express that returns a list of products.

Bonus : Add support for query parameters (e.g., ?category=electronics).


Go Challenge

Task : Write a Go program that reads a file line by line and counts how many lines contain a specific keyword.

Hint : Use bufio.NewScanner() for efficient line-by-line reading.

Database Query Challenge

Problems on SQL - HR Database :

  1. Find employees with salaries above the average salary of all employees.
  2. Find the department-wise highest paid employee.

HR database



Data Structures & Algorithms Challenge

  • Easy:
    • Problem :Reverse a string without using built-in reverse functions.
    • Hint :Use two-pointer swapping or a manual loop.
  • Medium:
    • Problem : Find the majority element in an array (appears more than ⌊n/2⌋ times).
    • Hint :Use Boyer-Moore Voting Algorithm.
  • Hard:
    • Problem :Given n meetings with start and end times, determine the minimum number of meeting rooms required.
    • Hint :Use a min-heap to track end times efficiently.

Bug of the Day

Node.js

Node.js Bug

    Buggy Code:

    
    const fs = require('fs');
    
    fs.readFile('data.txt', (err, data) => {
      if (!err) {
        console.log(data);
      }
    });
    

Challenge :The file content isn't printed as expected. What’s wrong? Fix the code to properly display file contents.

📋 Daily Micro-Project

Type : Frontend

Task :

Build a theme switcher (light/dark mode) using React. Store the preference in localStorage so it persists after reload.

Bonus :Use useEffect to sync with the system theme (prefers-color-scheme).

Trivia: 5 Fun Facts

  1. What does JSX stand for in React?
  2. What year was Node.js released?
  3. Which company maintains the Go language?
  4. What is the default port used by Express.js?
  5. Who created React?

Tool & Resource of the Day

Tool : ESLint

Use : Identify and fix problematic patterns in JavaScript code. Enforces code quality and consistency.

Bonus Resource : Airbnb JavaScript Style Guide

Interview Question of the Day

Daily Interview Questions

    Frontend :
    1. What is the difference between useEffect and useLayoutEffect?
    2. How does React reconcile DOM changes using Virtual DOM?
    3. How do you lift state up in React, and why is it important?
    4. Explain the difference between controlled and uncontrolled components in React.
    Backend :
    1. What is the difference between callbacks, promises, and async/await in Node.js?
    2. How does event-driven architecture work in Node.js?
    3. What are goroutines in Go?
    4. What is a middleware function in Express.js?
    Database :
    1. What is a composite key in SQL?
    2. What is the difference between DELETE and TRUNCATE?
    3. How does a B-tree index work?
    Others :
    1. What is an environment variable and how is it used?
    2. What is the difference between Docker containers and virtual machines?

Daily Quiz Challenge

    Frontend ( React Hooks Focus ) :

    1. Which hook is used to manage side effects in React?
      • useState
      • useRef
      • useEffect
      • useCallback
    2. What will useState(0) return?
      • 0
      • A variable
      • An array with state and setter
      • A promise
    3. What’s the correct way to conditionally apply styles in JSX?
      • style="color: red"
      • style={{color: 'red'}}
      • style: 'color: red'
      • style=color:red

    Backend ( Node.js & Go ) :

    1. What is the use of next() in Express.js middleware?
      • End the request
      • Move to next middleware
      • Send response
      • Exit Node process
    2. How do you create a simple HTTP server in Go?
      • http.Listen()
      • net.ListenAndServe()
      • http.HandleFunc()
      • http.ListenAndServe()
    3. What is the use of package.json in Node.js?
      • Store environment variables
      • Configuration file for Go
      • Define project dependencies
      • Manage database

    Others :

    1. Which SQL clause is used after GROUP BY to filter aggregated results?
      • HAVING
      • WHERE
      • ORDER BY
      • LIMIT
    2. What does npm install do?
      • Launches the app
      • Installs global tools
      • Installs dependencies from package.json
      • Updates Node.js

Weekly Cross-Domain Activities ( August 01 to August 07, 2025 )

API of the Day:

Build a crypto tracker using the CoinGecko API.

Display current prices and 24h change of selected coins.

Linux/DevOps Tip :

Top 10 htop features for server monitoring (process tree, CPU graph, filter by user, etc.)

Real-World Project of the Week ( August 01 to August 07, 2025 )

Project of the Week:

Build a Task Manager App with React + Node.js + MongoDB (MERN Stack)

Collaborative Project:

Create an Open Source GitHub repo for “Interview Prep Hub” – collect user-submitted questions and answers.

Case Study:

Explore how Notion manages blocks and rich content – replicate a basic block-based note editor with contenteditable elements.


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  09-06-2025  10-06-2025  11-06-2025  12-06-2025  13-06-2025  16-06-2025  17-06-2025  18-06-2025  19-06-2025  20-06-2025  23-06-2025  24-06-2025  25-06-2025  26-06-2025  27-06-2025  30-06-2025  01-07-2025  02-07-2025  03-07-2025  04-07-2025  07-07-2025  08-07-2025  09-07-2025  10-07-2025  11-07-2025  14-07-2025  15-07-2025  16-07-2025  17-07-2025  18-07-2025  21-07-2025  22-07-2025  23-07-2025  24-07-2025  25-07-2025  28-07-2025  29-07-2025  05-08-2025  06-08-2025



Follow us on Facebook and Twitter for latest update.