Problem A — Multiply two non-negative integer strings
You are given two strings num1 and num2 representing non-negative integers in base-10.
-
Return their product as a base-10 string.
-
You
must not
convert the inputs to built-in integer/big-integer types.
-
The output must not contain leading zeros (unless the value is exactly
"0"
).
Input: num1, num2 (strings)
Output: product as a string
Constraints (typical): 1 <= len(num1), len(num2) <= 10^4, digits only.
Problem B — Parse email addresses from a huge log string
You are given a very large string s that contains multiple records. Conceptually:
-
Records are separated by a semicolon
;
only when the semicolon is not inside
:
-
double quotes
"..."
(display name), or
-
parentheses
(...)
(a comment).
-
Each record corresponds to one email entry, but the record can contain optional parts:
-
an optional display name (possibly quoted),
-
an email address token containing exactly one
@
,
-
optional comments in parentheses, and a comment may appear
anywhere
in the record.
Task: Extract all email addresses from the string and return a deduplicated list.
-
If an email appears multiple times, keep only the first occurrence.
-
You may assume the email address itself does not contain spaces/semicolons/parentheses/quotes.
Input: one string s
Output: list of unique email strings
Problem C — Maximum area axis-aligned rectangle from points
You are given N distinct points on a 2D integer grid: points[i] = (xi, yi).
A rectangle is axis-aligned (sides parallel to axes). A valid rectangle requires all four corners to be present in the input set.
Task: Return the maximum rectangle area possible. If no rectangle can be formed, return 0.
Input: array of points
Output: integer maximum area (or 0)
Constraints (typical): 1 <= N <= 2000 (or similar), coordinates fit in 32-bit signed int.
Problem D — Stock price tracker with corrections
Design a data structure supporting these operations:
-
update(timestamp, price)
: record the stock price at
timestamp
.
-
If the timestamp already exists, this call
overwrites/corrects
the previous price.
-
current()
: return the latest stock price (price at the maximum timestamp seen so far).
-
maximum()
: return the maximum price among all timestamps currently stored.
-
minimum()
: return the minimum price among all timestamps currently stored.
Input: sequence of operations
Output: values returned by current/maximum/minimum
Constraints (typical): up to 2e5 operations; timestamps and prices are positive integers.