Dev Duel
Sharpen your skills with real coding challenges
Practice JavaScript, Python, SQL, and C++ with guided challenges built for beginners through advanced learners.
Daily Duel
Refactor Messy Inventory Management Code
Improve the structure and readability of a cluttered C++ function that manages inventory updates while preserving its original behavior.
Browse by language
Choose a language and jump into practical challenges.
JavaScript
Practice fundamentals, arrays, functions, async logic, and debugging.
Explore challenges →Python
Sharpen syntax, loops, functions, lists, dictionaries, and more.
Explore challenges →SQL
Train with filtering, joins, grouping, subqueries, and window functions.
Explore challenges →C++
Work on variables, loops, functions, OOP, and problem-solving.
Explore challenges →Featured Duels
Start with strong practice problems across languages.
Sum Two Values
Write a function that returns the sum of two numbers.
Count Even Numbers
Count how many even numbers appear in a list.
Find the Second Highest Salary
Return the second highest salary from an employees table.
Reverse a String Without Built-Ins
Reverse a string manually without using built-in reverse helpers.
Calculate Total Sales Per Employee Using SQL GROUP BY
Learn how to aggregate sales data by employee using the SQL GROUP BY clause and aggregate functions in this beginner-friendly challenge.
Beginner Challenge: Create a Function to Capitalize the First Letter of Each Word
Practice string manipulation by writing a JavaScript function that capitalizes the first letter of every word in a given sentence.
Sum All Odd Numbers in a List
Write a function that calculates the sum of all odd numbers in a given list of integers.
SQL Beginner Challenge: Calculate Total Sales per Customer
Practice basic SQL aggregation by calculating the total sales amount for each customer in a sales database.
Simple To-Do List App in JavaScript
Create a basic to-do list application where users can add tasks, mark them as completed, and see the updated list.
Fix the Broken SELECT Query to Retrieve Employee Names
A simple SQL query intended to retrieve all employee names is not working correctly. Your task is to identify and fix the syntax errors so the query runs successfully and returns the correct results.
Build a SQL Function to Calculate Running Median Over a Dynamic Window
In this challenge, you will create a SQL function that calculates the running median value of a numeric column over a dynamic sliding window based on timestamps. This requires advanced use of window functions, array manipulation, and median calculation within SQL.
Design and Query a Library Management Data Model
Create a SQL data model for a library management system and write queries to retrieve meaningful information about books, authors, borrowers, and loans.
Predict Output of Complex Recursive and Bitwise Operations in C++
Analyze a complex C++ program that uses recursion combined with bitwise operations and tricky short-circuit logic. Predict the exact output produced by the program without running it.
Build a Decorator to Cache Function Results with Expiry
Create a Python decorator function that caches the results of an expensive function call, with support for automatic expiration of cached values after a given time-to-live (TTL).
Build a Todo List Manager with Filtering and Prioritization
Create a JavaScript function that manages a list of todo items, allowing for adding, removing, updating status, and filtering tasks based on their priority and completion status.
Fix Bug in Async Data Aggregation and Error Handling Function
Debug and fix a complex asynchronous JavaScript function designed to fetch and aggregate data from multiple APIs with error handling. The current implementation contains subtle bugs causing unhandled promise rejections and incorrect data aggregation.
Fix the Bug in a C++ Function to Calculate Factorial
Identify and fix the bug in a simple C++ function intended to calculate the factorial of a given number. The function currently produces incorrect output for some inputs.
Build an Advanced Debounce Function with Immediate and Cancel Options
Create a robust debounce utility function in JavaScript that delays invoking a function until after a specified wait time elapses since the last call. Support both immediate execution on the leading edge and the ability to cancel a pending invocation.
Refactor SQL Query for Sales Aggregation Optimization
Improve the given SQL query that calculates total and average sales per product category. The original query uses multiple subqueries and redundant joins, causing inefficiencies. Refactor it to be cleaner and more performant while preserving the exact results.
Build a Movie Recommendation Engine Based on User Ratings
Create a Python mini-project that recommends movies to a user based on their past ratings and similarity to other users' ratings. Implement basic collaborative filtering logic without external libraries.
Simple Contact List Manager in C++
Create a basic contact list manager where users can add, display, and search contacts using console input and output.
Refactor Complex C++ Class for Improved Readability and Maintainability
Given a complex and messy C++ class implementation, refactor the code to improve readability, maintainability, and follow best OOP practices without changing the program's behavior.
Build a Simple To-Do List App
Create a basic to-do list application in JavaScript where users can add, view, and remove tasks. This project helps beginners practice working with arrays, functions, and DOM manipulation.
Predict the Output of an SQL Query with Subqueries and Joins
Analyze the given SQL query involving JOINs and a correlated subquery, and predict the final output based on a provided sample database schema and data.
Design and Implement a Scalable E-Commerce Order Tracking Data Model
Build a comprehensive SQL data model supporting order tracking, including customers, products, orders, shipments, and status history, ensuring efficient querying for complex business insights.
Create a SQL Function to Calculate Running Sales Total per Customer
Build a SQL function that calculates the running total of sales for each customer ordered by the sale date.
Refactor and Optimize Complex Data Processing Function
Given a large-function script that processes a nested data structure with redundant loops and poor readability, refactor the code to improve maintainability, reduce complexity, and optimize performance without changing its output.
Build a Function to Calculate the Area of a Rectangle
Write a simple C++ function that calculates the area of a rectangle given its width and height.
Predict the Output of Nested Array and Object Destructuring with Defaults
Analyze the given JavaScript code involving nested array and object destructuring with default values and predict the final output.
Fix the Bug in a Simple Temperature Converter
Debug a basic C++ function that is supposed to convert temperatures from Celsius to Fahrenheit but currently produces incorrect results.
Fix the Aggregation Bug in Employee Salary Report Query
An SQL query intended to generate a report summarizing total salaries by department and job title has incorrect aggregation logic causing wrong results. Your task is to identify and fix the bugs in the query to produce accurate aggregation.
Build a Function to Flatten a Nested List of Integers
Create a Python function that takes a nested list of integers and returns a flat list containing all the integers in their original order.
Build a Function to Serialize and Deserialize Nested Dictionaries with Custom Rules
Create a Python function to serialize a nested dictionary into a custom string format and another function to revert it back, handling complex nesting and type conversions.
Refactor and Improve Readability of a Data Filtering Function
Refactor a given Python function that filters and processes a list of dictionaries to improve its code quality, readability, and maintainability without altering its output behavior.
Predict the Output of a Simple Number Check Function
Analyze a Python function that checks if a number is positive, negative, or zero, and predict its output for given inputs.
Refactor a Function to Cleanly Aggregate User Purchases
The provided JavaScript function processes an array of user purchase objects to calculate total spending per user. The existing code works but is messy and repetitive. Refactor it for clarity, reusability, and improved readability without changing its behavior.
Refactor and Optimize Complex Sales Reporting SQL Query
Optimize a poorly written, inefficient SQL query that aggregates sales data by region and product category while filtering on multiple conditions. Improve readability, performance and ensure the output remains correct.
Build a Simple Inventory Management System in C++
Create a console-based inventory management mini-project using C++. Implement features to add, update, delete, and display items stored in an inventory using vectors and classes.
Implement a Memoized Recursive Function to Compute the nth Catalan Number
Create an efficient C++ function that calculates the nth Catalan number using recursion with memoization. Catalan numbers appear in various combinatorial problems and grow quickly, so naive recursion is inefficient for larger inputs.
Basic Calculator CLI Mini-Project in C++
Create a simple command-line calculator program in C++ that performs basic arithmetic operations like addition, subtraction, multiplication, and division based on user input.
Build a Personal Expense Tracker Mini Project
Create a Python program that allows users to add, view, and analyze their personal expenses over time, helping them track spending habits.
Create a Function to Calculate the Square of a Number
Write a Python function that takes a single number as input and returns its square. This is a fundamental exercise to practice defining functions and using arithmetic operators.
Fix a Bug in an SQL Query for Aggregated Sales Performance with Window Functions
Identify and fix the bug in a complex SQL query that attempts to calculate monthly sales performance rankings by salesperson, using window functions and joins.
Refactor SQL Query to Optimize Simple SELECT with CASE
Improve the readability and efficiency of a beginner-level SQL query that uses multiple CASE statements to classify product sales data without changing its behavior.
Fix the SQL Query to Retrieve Employees with Salary Over 50000
In this challenge, you are given a broken SQL query intended to select all employees earning more than 50000. Your task is to identify and fix the bugs so that the query returns the correct results.
Refactor a Function to Compute Unique Elements Frequency
Improve the provided Python function that calculates the frequency of unique elements in a list. Refactor the code for better readability, efficiency, and Pythonic style without changing its behavior.
Predict the Output of a Complex Nested Loop with Conditional Logic in C++
Analyze the given C++ code that uses nested loops with conditional statements to manipulate variables. Predict the output without running the code.
C++ Student Grade Management System
Build a mini-project that manages student grades by storing names and scores, calculating averages, and allowing queries for top students.
Design and Optimize a Sales Database Schema with Advanced Queries
Create a normalized database schema for a retail sales system that handles customers, products, orders, and shipments. Then, write optimized SQL queries to retrieve key business insights including sales trends, customer segmentation, and shipment statuses.
Refactor a Function to Calculate Average Scores with Better Readability and Efficiency
Improve a messy JavaScript function that calculates average scores from an array of student objects, making the code cleaner, more efficient, and easier to understand without changing its behavior.
Design and Query a Multi-Level Employee Management Hierarchy
Create a relational data model to represent an organization's employee hierarchy with multiple reporting levels and implement complex SQL queries to retrieve hierarchical reports and aggregate statistics.
Design and Query an Employee Hierarchy Data Model
Create a normalized data model to represent an employee hierarchy within a company, then write an advanced SQL query to retrieve hierarchical reports and aggregated information.
Advanced C++ Code Refactor: Optimize and Modernize Complex Class Implementation
Given a legacy C++ class with complex logic, repetitive code, and poor maintainability, your task is to refactor it for readability, efficiency, and modern C++ best practices without altering its external behavior.
Refactor Complex Nested Callbacks into Clean Async/Await Flow
Refactor a nested callback-based event processing function into clean, modular, and maintainable async/await style JavaScript code without changing the behavior or output.
Create a SQL Function to Calculate Customer Lifetime Value (CLV)
Write a SQL function that calculates the Customer Lifetime Value (CLV) based on customer transactions, applying discounting over time and accounting for customer churn rate.
Fix the Bug in Array Filtering and Object Mapping Function
Identify and fix the bug in a JavaScript function designed to filter an array of user objects and map them to a list of their names based on age criteria.
Build a Task Manager CLI Application in Python
Create a command-line task manager in Python that allows users to add, complete, delete, and list tasks with due dates and priorities.
Simple Budget Tracker
Create a basic C++ program that helps track expenses and calculate the remaining budget. Users will input their total budget and then enter expenses one by one. The program will output the remaining budget after each expense and a summary at the end.
Create a Deep Object Merge Function
Build a JavaScript function that takes two objects and merges them deeply, combining nested objects instead of overwriting them.
Refactor SQL Query for Optimized Employee Sales Report
Improve the given SQL query for generating a monthly sales report by employee to increase readability and performance without changing the output.
Predict the Output of Complex Pointer and Reference Manipulations in C++
Analyze the given C++ code involving multiple levels of pointers, references, and pre/post-increment operators. Predict the exact output after all manipulations, demonstrating deep understanding of pointer arithmetic, reference binding, and operator precedence.
Fix the Recursive Sales Totals Query for Hierarchical Employees
You are given a broken SQL query intended to calculate total sales made by each employee and their subordinates in a hierarchical company structure. The query uses a recursive CTE but produces incorrect or incomplete totals. Your task is to identify and fix the bugs so that the query accurately computes cumulative sales totals including all levels of subordinates.
Create a Function to Convert Celsius to Fahrenheit
Write a JavaScript function that converts a temperature from Celsius to Fahrenheit.
Design and Query an Employee-Project Assignment Schema
Create a normalized database schema to manage employees, projects, and their assignments. Write SQL queries to retrieve project involvement and employee workloads.
Refactor Complex C++ Banking System for Maintainability and Performance
Refactor the provided C++ code of a banking system that handles multiple account types, transactions, and interest calculations. The goal is to improve code quality, maintainability, and performance without changing the system's behavior.
Predict the Output of a Basic For Loop with Condition
Analyze the given JavaScript code snippet involving a for loop and conditional statements, then determine the output printed to the console.
Fix Memory Leak and Logic Bug in Custom Linked List Implementation
Identify and fix the memory management and logic bugs in a custom singly linked list class implemented in C++. The list supports insertion and search operations but has subtle issues causing memory leaks and incorrect behavior.
Refactor Messy Code to Calculate the Sum of Even Numbers
Improve the readability and quality of a Python function that calculates the sum of even numbers from a list, while keeping the output correct.
Fix the Logic Bug in the Array Frequency Counter
The given C++ function is intended to count the frequency of each integer in an input vector and return the result as a map. However, the current implementation produces incorrect frequency counts due to a logic bug. Your task is to identify and fix the bug so that the function returns accurate counts.
Create a Simple Employee and Department Tables with Basic Queries
Build and query basic employee and department tables to practice simple SQL data modeling and retrieval.
Advanced Social Network Graph Analyzer in Python
Build a Python mini-project that processes and analyzes a social network graph to extract insights such as influential users, community detection, and shortest connection paths.
Predict the Output of a Recursive Memoization with Mutable Default Argument
Analyze a Python function that uses recursion combined with mutable default arguments and memoization, then predict the exact printed output when the function is called.
Refactor Messy C++ Code for Calculating Statistics on an Integer Array
Improve and clean up a provided C++ function that calculates the minimum, maximum, and average of an integer array while maintaining the same behavior.
Create a Function to Get Employee Names by Department
Write a SQL function that returns a list of employee names for a given department from an employees table.
Build a Python Expense Tracker with Categorization and Summaries
Create a Python mini-project to manage daily expenses, categorize them, and generate summary reports for monthly spending by category.
Build a High-Performance Memoized Fibonacci Function Using C++ Templates
Create an advanced C++ function that computes Fibonacci numbers efficiently using both memoization and template metaprogramming techniques to optimize compile-time and run-time performance.
Fix the Incorrect JOIN Condition in Employee Salary Query
Identify and fix the bug in the provided SQL query that calculates the total salary by department. The current query returns incorrect totals due to a faulty JOIN condition.
Refactor Nested Loops to Improve Code Readability and Efficiency
Refactor the given Python function that uses nested loops to find common elements between two lists. Improve its readability and performance without changing its behavior.
Refactor to Optimize a Basic Employee Salary Query
Improve the given SQL query that retrieves employee names and salaries, by refactoring it to be more efficient while keeping the result unchanged.
Fix the Off-By-One Error in Loop Summation
Debug a simple function in C++ that aims to sum integers from 1 to n but produces incorrect results due to an off-by-one error in the loop.
Predict the Output of Recursive Nested Dictionary Merge with Side Effects
Analyze the given Python function that performs a recursive merge of nested dictionaries with side effects on mutable inputs. Predict the exact output of the code including the final printed dictionaries.
Predict the Output: Array Transformation and Loop Logic in C++
Analyze the given C++ code snippet that performs multiple array transformations and loop operations. Predict the final output printed by the program without running it.
Refactor a Complex C++ Class for Cleaner Design and Performance
Refactor the given C++ class that manages a large dataset with inefficient and messy logic. Improve code readability, maintainability, and performance while preserving functionality.
Build a Simple Grocery List Manager
Create a Python program that allows users to add items to a grocery list, remove items, and display the current list. This mini-project helps beginners practice working with lists, loops, and functions.
Advanced File System Explorer and Analyzer
Build a C++ program that recursively explores a given directory, constructs an in-memory model of the entire file system hierarchy starting at that directory, and generates detailed reports including total file counts, directory sizes, and file type distributions. The project tests your skills in recursion, data structures, file I/O, and performance optimization.
Build a Function to Merge and Sort Unique Elements from Two Lists
Create a Python function that takes two lists of integers and returns a sorted list containing all unique elements from both lists.
Fix the Bug in Filtering and Summing Product Prices
The provided JavaScript function is intended to filter products by category and then calculate the total price of those filtered products. However, it contains bugs that prevent it from working correctly. Your task is to debug and fix the function so that it returns the correct total price for the specified category.
Advanced Event Scheduler with Conflict Resolution in C++
Build an advanced event scheduler that manages multiple events with time conflicts resolution. The scheduler must support adding, removing, updating events, and querying free time slots efficiently.
Refactor SQL Query for Retrieving Active Users
Optimize and refactor a simple SQL query to improve readability and performance while maintaining the same output.
Refactor a SQL Query to Improve Readability and Efficiency
You are given a simple SQL query written with redundant expressions and unnecessary complexity. Refactor the query to improve its readability and optimize performance while keeping the same output.
Advanced Text Summarizer Using TF-IDF and Cosine Similarity
Build a Python function that performs extractive text summarization by selecting the most important sentences based on TF-IDF vectors and sentence similarity measures.
Refactor a Function for Summarizing Employee Sales Data
Improve the readability and efficiency of a given Python function that processes a list of employee sales records and returns a summary dictionary.
Build a Task Progress Tracker with Status Summary
Create a Python function to track the progress of multiple tasks with varying statuses and provide a summary of counts per status.
Fix the Bug in SQL Query Calculating Running Totals with Incorrect Window Frames
Identify and fix the logical error in the given SQL query that attempts to calculate running totals of sales per customer, but returns incorrect results due to improper window frame specification.
Fix Memory Leak and Logic Errors in a Multi-threaded Task Scheduler
You are given a flawed C++ implementation of a simple multi-threaded task scheduler that manages and executes tasks concurrently. The code contains memory leaks, race conditions, and logic errors that cause incorrect task execution and resource cleanup issues. Your job is to identify and fix the bugs to produce a robust, leak-free, and correctly functioning scheduler.
Build a Dynamic Kanban Board with Drag-and-Drop in JavaScript
Create a fully functional Kanban board application that supports adding, moving, and editing tasks across multiple columns using native JavaScript and the Drag-and-Drop API.
Refactor a Simple Temperature Converter Function
Improve the readability and efficiency of a basic Python function that converts temperatures from Celsius to Fahrenheit.
Fix the Bug in Filtering Unique Usernames from an Array
The provided JavaScript function is supposed to return an array of unique usernames from a list of user objects. However, it currently returns duplicates. Your task is to debug and fix the code to ensure it returns only unique usernames.
Create a Basic Employee Directory Table and Query
Build a simple employee directory table and write a query to retrieve filtered information about employees, practicing basic SQL data modeling and SELECT queries.
Fix the Off-By-One Error in List Processing Function
Identify and fix the bug in a Python function designed to process a list of numbers and return a transformed list. The current implementation has an off-by-one error causing incorrect output.
Fix the Bug in the Multithreaded Singleton Logger Implementation
Identify and fix the concurrency bug in a classic thread-safe Singleton Logger class in C++. The provided code attempts lazy initialization with double-checked locking but contains subtle issues that may cause race conditions or undefined behavior in a multithreaded environment.
Build a Scalable URL Shortener Service in Python
Create a mini-project to develop a URL shortener service that generates unique short URLs, supports custom aliases, and includes analytics features such as click tracking and expiration dates.
Refactor a Repetitive SQL Query Using Aliases and Simplified WHERE Clause
Optimize a beginner-level SQL query by refactoring repetitive conditions and using table aliases for clarity. The query fetches all employees from the 'employees' table who belong to certain departments and have a salary above a threshold.
Refactor Messy JavaScript Array Processing Function
Clean up and improve the readability and efficiency of a JavaScript function that processes an array of user objects. The function currently contains redundant code, unclear variable names, and inefficient looping that you need to refactor without changing its output.
Build a SQL Function to Find Top Customers by Total Spend
Create a SQL scalar function that calculates the top N customers based on their total purchase amount from sales data.
Create a Function to Merge Two Sorted Arrays Without Duplicates
Build a C++ function that takes two sorted integer arrays and returns a new sorted array containing all unique elements from both arrays, effectively merging them without duplicates.
Create a Function to Calculate Average Salary by Department
Write an SQL function that calculates the average salary for a given department from an employee table.
Refactor a Function to Calculate Factorial More Cleanly
Improve the clarity and simplicity of a provided factorial function without changing its behavior. Practice writing clean and readable Python code.
Build a Weather Dashboard with Dynamic City Search
Create a small weather dashboard application in JavaScript that fetches and displays weather data for cities searched by the user, using a public weather API.
Refactor a SQL Query for Efficient Employee Sales Aggregation
Improve a provided SQL query that calculates total sales per employee by refactoring it for better readability and optimization, while preserving its original behavior and output.
Build a Memoized Recursive Fibonacci Function with Performance Tracking
Create a Python function to compute Fibonacci numbers using memoization to optimize recursive calls. Additionally, implement performance tracking to count how many times the function is called and how many cache hits occur.
Fix Bug in C++ Function to Find Maximum Product of Two Elements
The provided C++ function is intended to find the maximum product of any two distinct elements in an integer array. However, it contains logical and implementation bugs that lead to incorrect results or runtime errors. Your task is to identify and fix these bugs to ensure the function works correctly for all valid inputs.
Fix the Bug in the Function That Calculates the Sum of an Array
This challenge involves debugging a simple JavaScript function that is intended to sum all numbers in an array but currently returns an incorrect result.
Build a Function to Perform Symbolic Differentiation of Polynomials in C++
Create an advanced C++ function that takes a polynomial expression as a string input and returns its derivative as another string. This function should handle multiple terms, coefficients, exponents, and the variable x correctly, performing symbolic differentiation in standard mathematical notation.
Fix Memory Leak and Concurrency Bug in Thread-Safe Cache Implementation
Given an incomplete and buggy thread-safe LRU cache implementation in C++, identify and fix issues related to memory leaks, data races, and incorrect cache eviction logic.
Build a Simple Employees and Departments Table with Basic Queries
Create two related tables, Employees and Departments, and write SQL queries to retrieve basic information such as employee names, their departments, and departments with employee counts.
Create a Function to Find the Longest Palindromic Substring
Write a Python function that takes a string as input and returns the longest palindromic substring within it. A palindrome reads the same backward as forward. This intermediate challenge helps you practice string manipulation and algorithmic thinking.
Design and Query a Normalized E-Commerce Sales Data Model
Create a relational schema to model an e-commerce sales environment and write advanced SQL queries to retrieve complex insights on sales performance and customer behavior.
Advanced Task Scheduler: Build a Priority-based Task Manager in Python
Create a Python mini-project that manages a list of tasks with start times, durations, and priorities, optimizing scheduling to avoid conflicts based on priority and timing.
Refactor and Optimize Deeply Nested Array and Object Processing in JavaScript
Improve the readability, maintainability, and performance of a complex function that processes deeply nested arrays and objects without changing its behavior.
Build a Memoized Recursive Function to Calculate Large Fibonacci Numbers
Implement an efficient recursive function in C++ that computes the nth Fibonacci number leveraging memoization to optimize overlapping subproblems, capable of handling large input values.
Refactor Nested Loops and Conditionals into Clean Functional Code
Improve the readability and maintainability of a JavaScript function that calculates a summary from an array of user objects with nested loops and conditionals, by refactoring it using higher-order array methods and cleaner logic without changing its behavior.
Fix Bug in Advanced Multithreaded Bank Account Simulation
You are given a broken multithreaded C++ program simulating deposits and withdrawals on a bank account. The code uses mutexes to protect the balance but still produces inconsistent results due to subtle bugs. Your task is to identify and fix these concurrency and logic bugs to ensure the balance always stays correct after concurrent operations.
Build a Simple Bank Account Manager in C++
Create a basic console application in C++ to simulate a simple bank account manager that allows a user to deposit, withdraw, and check their balance.
Predict the Output of a Complex SQL JOIN with Aggregation and Filtering
Analyze the given SQL query that involves multiple JOINs, aggregation, and HAVING clauses, and predict the final output.
Predict the Output of a Complex Recursive Lambda with State Captures in C++
Understand and predict the output of advanced C++ code involving recursive lambdas with mutable and reference state captures that manipulate shared variables and invoke themselves conditionally.
Fix the Incorrect JOIN Conditions in SQL Sales Report Query
This challenge presents a SQL query intended to generate a monthly sales summary by joining the sales and products tables. However, the query contains incorrect join logic that leads to incorrect results or excessive rows. Your task is to fix the join conditions and any other issues to produce an accurate sales report.
Build a Memoized Async Function Runner with Concurrency Control
Create an advanced utility function in JavaScript that memoizes asynchronous functions and limits their concurrency, optimizing performance and resource usage.
Refactor Legacy C++ Code to Enhance Readability and Performance
Given a legacy C++ function that processes and filters a vector of user data with multiple nested loops and repeated conditions, refactor the code to improve readability, reduce complexity, and optimize performance while preserving the original behavior.
Advanced File System Indexer and Search Tool in C++
Build a highly efficient file system indexer that recursively scans directories, indexes file metadata, and supports advanced search queries with filters and sorting, all implemented in C++.
Fix Bug in Advanced Recursive Directory Size Calculator
Debug and correct a broken Python function designed to recursively compute total file sizes in nested directory structures represented as dictionaries.
Refactor a SQL Query to Simplify and Optimize Filtering
Improve a given SQL query by refactoring it for clarity and better performance while maintaining the same output. This challenge focuses on rewriting a query that uses unnecessary subqueries and redundant filtering.
Build a Scalable Task Scheduler with Dependency Resolution in Python
Create a mini-project in Python to implement a task scheduler that executes tasks in the correct order based on their dependencies. The scheduler should detect circular dependencies and optimize for concurrent execution where possible.
Predict the Output of a List Comprehension with Nested Conditions
Analyze a Python code snippet using nested list comprehensions with conditional statements and predict the final output list.
Fix Bug in SQL Query for Customer Lifetime Value Calculation
Identify and fix the bug in the provided SQL query that attempts to calculate the Customer Lifetime Value (CLV) by aggregating total purchases over all transactions per customer, but currently returns incorrect results due to improper GROUP BY and JOIN logic.
Advanced SQL Output Prediction: Recursive CTE with Window Functions
Analyze the given SQL query utilizing recursive Common Table Expressions (CTEs) combined with window functions, and predict the exact output it will generate based on the provided data.
Create a Simple Employee-Department Relationship Table
Build SQL tables to model employees and departments, then write queries to retrieve employee details along with their department names.
Build a Memoized Recursive Function to Calculate the nth Generalized Fibonacci Number
Create a function that efficiently computes the nth term of a generalized Fibonacci sequence, where the first k terms are given and each subsequent term is the sum of the previous k terms. Implement memoization to optimize the recursive calculations.
Design and Implement a Thread-Safe LRU Cache in C++
Create a high-performance, thread-safe Least Recently Used (LRU) cache class in C++. The cache should support concurrent access from multiple threads and provide O(1) time complexity for insertions, lookups, and deletions.
Refactor a Slow Sales Summary Query for Better Performance
Improve the efficiency of a SQL query that summarizes total sales by product category and month by simplifying its logic and optimizing joins and aggregations.
Fix the Memory Leak and Logical Bugs in Async Data Processor
Identify and correct bugs in an asynchronous JavaScript function that processes a large dataset with complex filtering and transformations. The current implementation suffers from logical errors and potential memory leaks causing performance degradation.
Simple Temperature Converter Mini Project
Build a small program that converts temperatures between Celsius and Fahrenheit scales, allowing users to enter a temperature and choose the conversion direction.
Refactor and Optimize a Multithreaded Logging System in C++
Improve the readability, maintainability, and performance of an existing multithreaded logging system while preserving its functionality.
Build a Function to Flatten Nested Lists by One Level
Create a Python function that takes a list containing nested sublists and returns a new list flattened by exactly one level. This means only the first level of nested lists should be expanded, while deeper nested structures remain intact.
Refactor and Optimize a Complex SQL Query Using Window Functions
Given a complex SQL query with multiple nested subqueries and joins, refactor it to improve readability, performance, and maintainability while preserving the original output.
Build a Memoized Deep Clone Function with Circular Reference Handling
Create an advanced JavaScript function that performs a deep clone of any given object, including nested objects and arrays, while efficiently handling circular references using memoization to avoid infinite loops.
Fix the Bug in SQL Query to Correctly Calculate Employee Department Averages
You are given a SQL query that attempts to calculate the average salary per department along with the department name. However, the query is not returning correct results due to a bug in the JOIN and GROUP BY clauses. Your task is to identify and fix the bug to ensure the query returns each department's name along with the average salary of its employees.
Advanced File System Simulation with C++
Create an advanced mini-project that simulates a hierarchical file system including files and folders with operations like add, delete, move, and search, using efficient data structures in C++.