Given a text string and a glossary, insert spaces to generate all possible sentences where every segment matches a glossary entry. In Part 2, both the i…
Trending Tracker: Top-K Retrieval You are building a trending tracker. You receive a stream of operations: apply(“inc”, key, delta) — increase the key’s…
Part 1 – Parse and Validate: Remove slots with missing fields, invalid ISO timestamps, or durations other than exactly 10 minutes. Part 2 – Aggregate: G…
Given a list of envelopes [width, height] , find the maximum number of envelopes that can be nested inside each other. An envelope can go inside another…
What is deadlock? How do you avoid it? Discuss class components of customer, orders, and discount related to customer order history and order content. W…
Implement a reusable DB connection pool. Design a component that manages a fixed set of database connections and allows clients to acquire and release t…
Given 2 lists, find the common items in both lists. 这道题要求找出两个列表中的公共元素,最直接的做法是先遍历其中一个列表并用哈希集合记录出现过的值,再扫描第二个列表,判断哪些元素也出现在集合中。这样可以把查找从线性时间降到接近 O(1),整体复杂度通常…
Build a simple class that implements a basic in-memory service that: Records a song play event for a given song id Returns play counts for individual so…
You are given a matrix whose elements are initially set to 0 and a starting position (startRow, startCol) (0-based indexing). Fill the matrix with incre…
Build a reservation system for a predefined set of conference rooms given as a list of room IDs [roomA, roomB, …] . It should have a method like sched…
We are designing a system for officers to check out a body worn camera from a pool of available cameras. We need an object to store a collection of came…
Please implement a Python function that takes a non-negative integer argument n as input, and it produces a list of all binary strings with length n suc…
There are 3 tables in the database. Application : stores customer application information. AppStatusDesc : lookup table for application status. ProductD…
Track Customer Visits and First-Time Visitors Millions of customers visit our website every day. For each customer, we have a unique identifier that sta…
Dict Bot We are building a small chat bot that can receive messages and keep track of what everyone has said. Given a sequence of messages, implement a…
Given a binary tree, create two functions: one that serializes the binary tree into a string and one that deserializes a serialized string back into a b…
You are given a list of calls, where each call has a type such as search , tts , or db.lookup . Each call type has a cooldown period. There are m time s…