319 challenges in the catalogue. Browse freely; sign in to open the editor and submit.
Build a GraphQL API server for a social platform with users, posts, and comments. Implement a type schema, resolvers for queries and mutations, handle nested relationships efficiently using DataLoader, and implement proper error handling.…
Sign in to solveDesign a distributed, in-memory key-value cache system similar to Redis or Memcached. The system should provide low-latency data access and be scalable across multiple nodes to handle massive amounts of data and high request rates. Basic…
Sign in to solveWrite a SQL query that reports the product_name, year, and price for each sale_id in the Sales table. Return the result table in any order. Input: Sales table: | sale_id | product_id | year | quantity | price |…
Sign in to solveGiven an array of integers temperatures represents the daily temperatures, return an array answer such that answer[i] is the number of days you have to wait after the ith day to get a warmer temperature. If there is no future day for which…
Sign in to solveDesign a time-based key-value data structure that can store multiple values for the same key at different time stamps and retrieve the key's value at a certain timestamp. Implement the TimeMap class: TimeMap() Initializes the object of the…
Sign in to solveGiven the head of a linked list, remove the $n^{th}$ node from the end of the list and return its head. Example 1: Example 2: Example 3: The number of nodes in the list is sz. 1 <= sz <= 30 0 <= Node.val <= 100 1 <= n <= sz Could you do…
Sign in to solveGiven a 1-indexed array of integers numbers that is already sorted in non-decreasing order, find two numbers such that they add up to a specific target number. Let these two numbers be numbers[index1] and numbers[index2] where 1 <= index1…
Sign in to solveImplement a simplified version of React's useState hook. Your implementation should maintain state across "re-renders" (repeated function calls) and support both direct value updates and functional updates. You will need to implement a…
Sign in to solveGiven a m x n grid filled with non-negative numbers, find a path from top left to bottom right, which minimizes the sum of all numbers along its path. Note: You can only move either down or right at any point in time. Example 1: Example 2:…
Sign in to solveid is the primary key column for this table. Each row contains an email. Emails will not contain uppercase letters. Write a SQL query to delete all duplicate email entries in the Person table, keeping only one unique email with the…
Sign in to solveGiven the head of a singly linked list and two integers left and right where left <= right, reverse the nodes of the list from position left to position right, and return the reversed list. Example 1: Example 2: The number of nodes in the…
Sign in to solveGiven the root of a binary tree, return its maximum depth. A binary tree's maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node. Example 1: Example 2: The number of nodes in the tree…
Sign in to solve