319 challenges in the catalogue. Browse freely; sign in to open the editor and submit.
Build a function that generates a responsive CSS grid system. Given a configuration with column count, gap size, and breakpoints, generate the CSS rules that create a responsive grid layout — similar to Bootstrap's grid but using CSS Grid.…
Sign in to solveBuild a distributed tracing system that tracks requests across microservices. Implement span creation, context propagation, and trace analysis following OpenTelemetry conventions. Implement a tracing library that can: Create Spans: Start…
Sign in to solveGiven an integer n, return the number of trailing zeroes in n!. Note that n! = n (n - 1) (n - 2) ... 3 2 1. Input: n = 3 Output: 0 Explanation: 3! = 6, no trailing zero. Input: n = 5 Output: 1 Explanation: 5! = 120, one trailing zero.…
Sign in to solveThe school cafeteria offers circular and square sandwiches (represented by 0 and 1 respectively). Students stand in a queue and each prefers either circular or square. The sandwich on top of the stack is served. If the student at the front…
Sign in to solveIn a distributed system, generating unique identifiers (IDs) at scale is a common requirement. These IDs are often used as primary keys in databases. Traditional auto-incrementing IDs in a single database don't scale globally and create a…
Sign in to solveYou are assigned to put some amount of boxes onto one truck. You are given a 2D array boxTypes, where boxTypes[i] = [numberOfBoxes_i, numberOfUnitsPerBox_i]: numberOfBoxes_i is the number of boxes of type i. numberOfUnitsPerBox_i is the…
Sign in to solveA path in a binary tree is a sequence of nodes where each pair of adjacent nodes in the sequence has an edge connecting them. A node can only appear in the sequence at most once. Note that the path does not need to pass through the root.…
Sign in to solveYou are given an integer array prices where prices[i] is the price of a given stock on the ith day, and an integer k. Find the maximum profit you can achieve. You may complete at most k transactions. Note: You may not engage in multiple…
Sign in to solveA company's executives are interested in seeing who earns the most in each department. A high earner in a department is an employee who has a salary in the top three unique salaries for that department. Write a SQL query to find the…
Sign in to solveThere is no primary key for this table; it may have duplicate rows. Each row of this table indicates that some viewer viewed an article (written by some author) on some date. Note that equal author_id and viewer_id indicate the same…
Sign in to solveYou are given the head of a singly linked-list. The list can be represented as: L_0 → L_1 → … → L_{n - 1} → L_n Reorder the list to be on the following form: L_0 → L_n → L_1 → L_{n - 1} → L_2 → L_{n - 2} → … You may not modify the values…
Sign in to solveid is a continuous auto-increment column starting from 1. Write a SQL query to swap the seat id of every two consecutive students. If the number of students is odd, the id of the last student is not swapped. Return the result table ordered…
Sign in to solve