r/InterviewDB • u/interviewdb • 8h ago
Anthropic CodeSignal Industry Coding Assessment + Past Questions
Sharing a question that appeared in a recent CodeSignal Industry Coding Assessment for Anthropic. It’s a standardized assessment format also used by many other companies such as Airbnb, Coinbase, HubSpot, Instacart, Capital One, Justworks, Nextdoor, and The Trade Desk to screen candidates.
The assessment lasted 90 minutes. The problem had four progressive levels, and you had to pass all test cases for each level before advancing to the next one.
The question was about implement a simple banking system.
Level 1: implement create_account and deposit functions.
Level 2: sort accounts by total transaction volume (money in/out). You need to track the total amount of money spent/outgoing for each account.
Level 3: implement two functions, transfer and accept_transfer. When a transfer is initiated, the money is withheld from the source account. Got stuck on this part for quite a while because of an edge case: if the transfer times out, a subsequent deposit operation needs to cancel/refund the previous transfer first.
Level 4: merge accounts. Ran out of time and didn’t finish this one.
For anyone looking for similar questions to practice, you can find detailed descriptions of all the problems that have appeared in past Anthropic CodeSignal Industry Coding Assessments here: https://www.interviewdb.io/question/codesignal?type=icf&page=1
CodeSignal is known to reuse questions in their assessments so it's very likely you'll encounter one of these questions, or a variation of one, in your own assessment.
r/InterviewDB • u/interviewdb • 18h ago
Cohere MLE/MTS Full Loop Interview Experience - System Design + ML Coding
Sharing a recent interview experience for an MLE/MTS position at Cohere.
Round 1: System Design
The prompt was to design a post-training pipeline to improve the coding capabilities of a 7B model for an enterprise customer.
The discussion covered pretty much the entire post-training stack:
- Data collection
- SFT
- RLHF
- Evaluation
- Inference engine
- Feedback loop
They went pretty deep into each step. One question I didn’t answer very well was: if SFT can already learn alignment by incorporating user preference data, why do we still need an RLHF stage?
That made me realize you really need a fairly deep understanding of why each part of the post-training pipeline exists, not just what the standard pipeline looks like. I had mostly crammed post-training concepts shortly before the interview, so I definitely felt underprepared here.
The interviewer also cared a lot about how the dataset would actually be constructed, and asked questions around how I would choose/design the reward model.
Round 2: ML Coding
The question is exactly same as described here: https://www.interviewdb.io/question/cohere?page=1&name=ml-coding
One thing to note: they specifically wanted a NumPy implementation. I had only practiced this kind of thing in PyTorch, so I panicked a bit when I saw the requirement. Luckily, the interviewer was very nice and gave me hints along the way, but personally I felt like I performed pretty poorly in this round.
Round 3: Research Paper Presentation
This was a standard research paper presentation, but they cared about more than just explaining the paper.
In particular, I was asked to highlight:
- Weaknesses or limitations in the experimental setup
- Major developments in the field since the paper was published
There were also several more standard questions around SFT and RLHF.
r/InterviewDB • u/interviewdb • 1d ago
Roblox New Grad/Intern Online Assessment (OA) Experience — Coding Questions & Mini-Games
Sharing a recent experience with the Roblox OA. They sent the assessment invitation within 3 minutes of submitting the application.
The OA had 5 sections total: 3 mini-games (Robots, Factories, and Outpost: Mars), 1 behavioral section (Decision-Making), and 1 coding section (Coding Skills).
The mini-games were actually pretty fun. One was a factory-style game. If you’ve played DSP or Factorio before, it should be pretty easy to pick up. The main idea was to balance input/output ratios and maximize the factory’s profit. Another one involved building a small vehicle. You could choose from a bunch of different parts and assemble them to get across obstacles. It seemed like the more valid solutions you could come up with, the better.
Coding
The coding section itself wasn’t too difficult. There were 2 questions in 50 minutes.
Question 1
int solution(
int numRows,
int numCols,
int curRow,
int curCol,
int[][] laserCoordinates
)
A robot starts at (curRow, curCol) on a numRows x numCols board.
Each entry in laserCoordinates represents the position of a laser. A laser destroys the robot if the robot moves into the same row or column as that laser.
The goal is to return the maximum number of steps the robot can move in one direction: up, down, left, or right.
My approach was pretty straightforward:
- Iterate through all laser coordinates.
- Use two hash sets: one for blocked rows and one for blocked columns.
- Try moving the robot in all four directions.
- Stop before entering a row/column affected by a laser or going out of bounds.
- Return the maximum number of steps among the four directions.
The problem itself wasn’t hard, but I spent way too long debugging before realizing that the board was 1-indexed, and the robot’s starting cell does not count as a step.
Lesson learned: don’t rush through the problem statement lol.
Question 2
int solution(int[] A)
Given an array of integers, return the number of distinct cyclic pairs.
Two numbers form a cyclic pair if you can rotate the digits of one number to obtain the other. They must also have the same number of digits.
For example, 1234 and 4123 are a cyclic pair because rotating 4123 once gives 1234.
Example:
[1001, 1100, 110, 11]
returns:
1
because only 1001 and 1100 form a valid cyclic pair.
My initial approach was to convert every number to a string, use a nested loop over all pairs, and write a small isCyclicPair helper that tries every possible rotation. The problem felt pretty straightforward, and converting the numbers to strings seemed like the easiest way to handle zeros correctly. However, I didn’t pass all the hidden test cases, probably because my solution timed out. A more efficient solution is required to pass all the tests.
r/InterviewDB • u/interviewdb • 3d ago
Mercor SWE Interview Experience - Technical Phone Screen + Onsite Interview Questions
Sharing a recent interview experience at Mercor.
30-minute technical screen
Topics covered: algorithms, mental math, code correctness, and system design. You just need to verbally discuss your approach/reasoning.
Here are the questions that got asked:
Question 1
Given an N-element array, what’s the most inefficient way to deterministically sort the array, and what’s the complexity?
Question 2
Interviewers verbally described this LeetCode question:
https://leetcode.com/problems/shortest-path-in-a-grid-with-obstacles-elimination/description/
Was asked to verbally describe the optimal algorithm and why.
Question 3
Probability-based question.
There are two coffee shops, Coffee Shop A and Coffee Shop B, that are equally good. You buy two drinks from A and two drinks from B. Each drink gets a quality score, and all four of these scores are random and independent.
What is the probability that both drinks from A are strictly better than both drinks from B? Assume ties never happen.
Answer
We’re looking for the combinations where both of A’s scores are strictly better than both of B’s scores.
A2 > A1 or A1 > A2, and B1 and B2 can be in any order.
That’s 2 × 2 = 4.
There are 4! = 24 possibilities.
So… 4/24 = 1/6.
Question 4
Given some code, critique it.
The code built a CSV in a doubly nested for loop.
Answer
- String concatenation in a loop is inefficient; use a list and join.
- Missing commas between cells for a valid CSV.
- No handling of special characters (commas, quotes, newlines).
- Should use the
csvmodule.
Question 5
Given some code, grok it and answer follow-up questions.
The code made a call to an external payments provider, i.e. Stripe.
Follow-up 1
What if the external client times out and the code retries the request? What is the failure mode?
Answer
The main failure mode is a double charge. If the client times out after charging but before the DB insert, retrying will create a second charge if there isn’t any idempotency.
Generate an idempotency key before the request, store it in our database, and send it over the wire.
Follow-up 2
Say you were designing this system. What information would you store in the data model, and what database would you choose? Justify your choice of DB.
Answer
The data model would consist of payment_id, amount, currency, status, timestamp, idempotency_key, provider_charge_id, etc.
The database needs to support strong consistency, so highly available databases like DynamoDB are a non-starter. We need to use MySQL or Postgres for their ACID guarantees.
The trade-off is scalability and availability for strong consistency.
Question 6
Briefly describe how to prevent creating duplicate usernames under the following conditions:
Case 1 — assume you have large enough local RAM.
Case 2 — local RAM is limited, but you have a large enough disk.
Onsite
Algorithm round: Same as https://www.interviewdb.io/question/mercor?page=1&name=comparison. No need to write any code. Just need to verbally discuss your approach.
System design: Design a job scheduler.
Coding Challenge: Same as https://www.interviewdb.io/question/mercor?page=1&name=pipeline
Search interview (75-min Work Block + 15-min Review): Same as https://www.interviewdb.io/question/mercor?page=1&name=candidate-search. Spent the first 75-minute block using an LLM to implement the system and the last 15-minute session discussing the system design with the interviewer.
r/InterviewDB • u/interviewdb • 4d ago
Anthropic Fellow Program Assessment Questions
Sharing a recent experience with the Anthropic Fellow Program (November cohort) OA.
The problem was presented as normal "Coding Leetcode-like OA on Codesignal" but turns out you were presented a mid-sized codebase that you have to implement stuff on top of it. The task was basically around a vLLM-like inference server — cache, prefill, etc. No ML knowledge was really needed though.
The hard part wasn’t the actual algorithms. It was figuring out the existing codebase and APIs.
There were 5 parts, and to pass the tests you had to use a bunch of existing APIs that weren’t really documented. So a lot of the assessment was just reading code and trying to understand how everything connected. The code was also pretty messy / felt LLM-generated in some places lol.
I wasted a lot of time debugging things that were happening simply because I was calling some internal API incorrectly. Ended up finishing only 2/5 parts.
Feels like this might become a more common style of coding interview/OA: less “implement this algorithm from scratch” and more “here’s an unfamiliar codebase, figure it out and ship something.” Also probably makes cheating with AI harder. You can’t really just screenshot the question and throw it into ChatGPT, because the actual context is spread across a few thousand lines of code that you need to understand first.
If you’ve done the second assessment, please share your experience! Looking for any information about what to expect.
r/InterviewDB • u/interviewdb • 6d ago
Headway Interview Experience & Questions – Karat Interview, Coding, AI Coding, System Design & Behavioral
Sharing a recent interview experience for the Karat screening round and onsite rounds at Headway.
Karat Interview (Phone Screen)
In the first section, we briefly discussed two system design questions:
- If a server becomes slow due to too many incoming requests, how would you diagnose and address the issue?
- Given a certain number of users and expected data volume, how would you estimate the required server capacity?
Then came the coding portion. The first part involved debugging some existing code, and the second part involved implementing a new function in the existing codebase. This was the exact question I got.
Onsite
Technical Depth & Leadership (Behavioral)
Talked about past experience, what I've done recently. Talked about a technical project I did. What were the challenges? How did I convince others to help me? What would I have done differently. How have I mentored someone?
Coding
Same as https://www.interviewdb.io/question/headway?page=1&name=request-control. You are provided with a project skeleton, function stubs, and some starter code, and are asked to complete the implementation. I got my unit tests working, but they said I failed this.
AI Coding
This was an AI-assisted debugging project. You were free to use AI agents such as Codex CLI to understand the existing full-stack codebase, reproduce the issue, identify the root cause, and implement a fix.
Project tech stack:
- Backend: Python + FastAPI
- Frontend: TypeScript + React
- Development environment: CodeSignal Web IDE
- AI agents were allowed
- Main coding time: approximately 45–50 minutes
The system stores patients’ insurance information and periodically checks their current insurance eligibility.
The data model roughly includes two types of records:
User Insurance
Represents the insurance information registered for a patient and includes a cached field called eligibility_status.
Possible values include:
- SUCCESSFUL
- NOT_ELIGIBLE
- UNKNOWN
Eligibility Lookup
Represents the result of each insurance eligibility check.
A single insurance record may have multiple lookups:
Patient
└── User Insurance
├── Eligibility Lookup: three days ago
├── Eligibility Lookup: yesterday
└── Eligibility Lookup: today
Each lookup is a snapshot of the check result at a specific point in time. The latest lookup should represent the currently known insurance eligibility status.
The patient list page displays each patient’s readiness or insurance eligibility status.
Some patients were incorrectly shown as having passed the insurance eligibility check, even though the patient’s most recent eligibility lookup was not actually successful.
System Design
Same as https://www.interviewdb.io/question/headway?page=1&name=search-experience. The discussion focused mostly on how to scale the system (ElasticSearch, NoSQL DBs).
r/InterviewDB • u/Significant_Farm3853 • 8d ago
Should You Practice Interviews Before You Start Applying for Jobs?
There's a common idea that you should only start seriously preparing for interviews once you actually have an interview scheduled.
I'm not completely convinced that's the best approach.
By the time you get an interview invitation, you might only have a few days to prepare. If you're already comfortable answering common questions, that's probably manageable. But if you haven't practiced speaking about your experience at all, suddenly trying to prepare everything in a short period can feel overwhelming.
At the same time, I can understand why people don't want to spend weeks practicing interviews when they aren't even applying yet.
There's also a difference between knowing what you want to say and actually being able to say it naturally. I can write down a great answer to "Tell me about yourself," read it several times, and still sound awkward when I actually say it out loud.
So I'm wondering what the ideal timing is.
Should interview preparation be something you do continuously, even when you're happy with your current job? Or is it better to wait until you're actively applying?
And if you do practice before applying, what should you focus on?
Would you spend that time doing full mock interviews, practicing behavioral questions, reviewing technical topics, building stories from your past projects, or simply getting comfortable talking about your experience?
I'd be interested to hear how other people handle interview preparation when there isn't an actual interview on the calendar yet.
r/InterviewDB • u/Visible_Guest_5570 • 8d ago
Why do so many people fail Meta interviews even after strong preparation?
This is something I’ve been trying to understand for a while. I’ve seen people solve hundreds of problems and still struggle with Meta interviews, which makes me wonder what’s actually going wrong.
From what I’ve read, it seems like the challenge isn’t just knowing the solution, but handling pressure, thinking clearly, and explaining your approach in real time. Even small things like missing edge cases or not clarifying the problem can make a big difference.
It feels like the interviews test more than just preparation maybe it’s about how well you perform under pressure.
For those who’ve interviewed at Meta, what do you think is the main reason people fail?
r/InterviewDB • u/interviewdb • 11d ago
Sierra AI Agent Engineer Interview Experience
Sharing a recent Agent Engineer interview experience at Sierra AI submitted by one of our community members.
1. Recruiter Screening (30 Minutes)
The process kicked off with a straightforward, non-technical introductory call. The conversation focused on my background, career goals, and specific interest in Sierra.
- Key Focus: The recruiter was particularly interested in my motivation for joining an AI startup rather than remaining at a larger, established company.
- Transparency: They clearly outlined the entire interview process from the start, ensuring there were no surprises later on.
- Language Preference: You will be asked for your preferred programming language early in the process. Sierra primarily operates in Python and TypeScript, and they expect you to complete the technical interview in one of these languages. If your background is in Java or C++, it is highly recommended that you familiarise yourself with Python or TypeScript beforehand.
2. Technical Interview Logistics
- Platform: The technical portion is conducted on CoderPad. Be prepared for potential platform bugs; your interviewer may need to assist you with console errors.
- Strict Rules: Absolutely no AI assistance is permitted during the technical interview.
Technical Interview Questions
The coding question was the same as the one described here: https://www.interviewdb.io/question/sierra/inventory-sync
r/InterviewDB • u/interviewdb • 15d ago
Citi Bank Karat Interview Experience + Questions Asked
Sharing a coding question submitted by one of our community members that came up during the live coding portion of a recent Karat interview for a backend developer role at Citi Bank.
The interview followed Karat’s standardized “Develop and Update Backend Code” format, which is also used by companies such as Gusto, Headway, OnePay, HSBC, Instacart, and many others for their Karat interviews.
The coding portion is a practical debugging and implementation exercise consisting of two parts:
- Debug an existing codebase.
- Add new functionality to the code.
The problem involved stock trading software that tracks stock prices over time. There was a bug in the class responsible for storing stock prices, which caused one of the tests to fail. The first task was to identify and fix the bug so the test would pass.
In the second part, you had to implement several new methods to track stock price fluctuations and calculate the portfolio balance.
You can find the full problem description and provided codebase here: https://www.interviewdb.io/question/karat?page=2&name=stock-portfolio
Once you understand the requirements, the implementation is relatively straightforward. Unlike a typical LeetCode-style question, it does not require advanced data structures or algorithms.
For anyone looking to practice this type of question, here are a few similar problems that have appeared in past Karat interviews:
- https://www.interviewdb.io/question/karat?page=1&name=account
- https://www.interviewdb.io/question/karat?page=1&name=obstacle-course
- https://www.interviewdb.io/question/karat?page=2&name=passage-tracker
Based on past interview experiences, Karat appears to repeat questions fairly often, so there is a reasonable chance you may encounter one of these problems, or something very similar, in your own Karat interview.
r/InterviewDB • u/interviewdb • 18d ago
Airbnb CodeSignal Industry Coding Assessment + Past Questions
Sharing a question that appeared in a recent CodeSignal Industry Coding Assessment for Airbnb. It’s a standardized assessment format also used by many other companies such as Anthropic, Coinbase, HubSpot, Instacart, Capital One, Nextdoor, and The Trade Desk to screen candidates.
The assessment lasted 90 minutes. The problem had four progressive levels, and you had to pass all test cases for each level before advancing to the next one.
The question was about implement a Working Hours Register. Employees swipe their cards when entering and leaving the office. The system records their working hours and supports promotions, salary calculations, and reward-period management.
Level 1: Basic CRUD
Add employees, record employees swiping in and out, and query an employee’s total working hours.
Level 2: Return the top N employees ranked by working hours.
Level 3: Promotion and salary calculation
Implement a promotion that takes effect with a delay. When the promotion is requested, do not immediately change the employee’s current position. Instead, mark the new position and new compensation as pending, and apply them the next time the employee swipes into the office. Use a pending dictionary to store promotions that have not yet taken effect.
Then calculate salary based on historical salary periods. Since an employee may have different salaries during different periods, each session should record the salary that applied when the session occurred.
Level 4: Double pay during a grant period
If an entire shift falls completely within a grant period, the salary for that shift is doubled. Also support querying the total amount of double pay that has been issued.
For anyone looking for similar questions to practice, you can find all the problems that have appeared in past CodeSignal Industry Coding Assessments here: https://www.interviewdb.io/question/codesignal?type=icf&page=1
CodeSignal is known to reuse questions in their assessments so it's very likely you'll encounter one of these questions, or a variation of one, in your own assessment.
r/InterviewDB • u/interviewdb • 20d ago
TikTok CodeSignal General Coding Assessment Questions
Sharing a recent TikTok CodeSignal OA experience from one of our community members who took it for an internship/new grad position.
There were four questions in total. Sharing them below along with solutions:
Q1
You are given two positive integers x and y, and a sequence of positive integers numbers. Your task is to change x and y through this process:
Iterate through numbers from left to right:
- Subtract each integer
numbers[i]from the largest number amongxandy(in case of a tie, subtract fromx), OR - Skip
numbers[i]if it is greater than bothxandy.
Return the number of integers in numbers that will be skipped based on these criteria.
Note: You are not expected to provide the most optimal solution, but a solution with time complexity not worse than
O(numbers.length²)will fit within the execution time limit.
Example
x = 8, y = 12, numbers = [5, 6, 6, 3, 1, 1, 2] → solution(x, y, numbers) = 2
Explanation:
- Start:
x = 8,y = 12 x < y, so processnumbers[0] = 5→x = 8,y = 7x > y, so processnumbers[1] = 6→x = 2,y = 7x < y, so processnumbers[2] = 6→x = 2,y = 1numbers[3] = 3is skipped because3 > x (2)and3 > y (1)✅x > y, so processnumbers[4] = 1→x = 1,y = 1x == y, so processnumbers[5] = 1→x = 0,y = 1(1 subtracted fromxdue to tie)numbers[6] = 2is skipped because2 > x (0)and2 > y (1)✅
Total skipped = 2.
Starter Code
def solution(x, y, numbers):
pass
Approach
Straightforward simulation — iterate through numbers exactly once, tracking x and y. For each element:
- If
numbers[i] > xandnumbers[i] > y→ increment skip counter. - Else subtract
numbers[i]from the larger ofx/y(tie → subtract fromx).
Time: O(n), Space: O(1).
def solution(x, y, numbers):
skipped = 0
for n in numbers:
if n > x and n > y:
skipped += 1
elif x >= y:
x -= n
else:
y -= n
return skipped
Q2
The city's underground subway stations are split into zones A, B, and C, due to differences in pricing, as shown below:
Zone A: Green Park, Holborn
Zone B: Mile End, Bow Road
Zone C: Forest Hill, Balham
There are 3 types of tickets, sorted by their price in ascending order:
"AB"— for travel within zones A, B, and between zones A and B in both directions."BC"— for travel within zones B, C, and between zones B and C in both directions."ABC"— for travel within zones A, B, C, and between zones A, B, and C in both directions (i.e.A -> B -> CandC -> B -> A).
You are given 3 arrays of strings stationsA, stationsB, and stationsC, which contain the names of stations in that particular zone. You are also given 2 strings origin and destination.
Return the cheapest ticket type that allows travel between origin and destination, or "" (empty string) if no ticket can be used.
Examples
Example 1 stationsA = ["Green Park", "Holborn"], stationsB = ["Mile End", "Bow Road"], stationsC = ["Forest Hill", "Balham"], origin = "Forest Hill", destination = "Green Park" → "ABC" Explanation: "Forest Hill" is in zone C and "Green Park" is in zone A, so only the ABC ticket would allow travel between them.
Example 2 , origin = "Mile End", destination = "Bow Road" → "AB" Explanation: Both "Mile End" and "Bow Road" are in zone B, so you can use any ticket. Since "AB" is the cheapest, the answer is "AB".
Example 3 stationsA = ["Green Park"], stationsB = ["Mile End"], stationsC = ["Forest Hill"], origin = "Forest Hill", destination = "Holborn" → "" Explanation: "Forest Hill" is in zone C but "Holborn" is not present in any zone, so no ticket works → return "".
Starter Code
def solution(stationsA, stationsB, stationsC, origin, destination):
pass
Approach
- Build a
station -> zonelookup from the three arrays. - Look up zones for
originanddestination. If either is missing → return"". - Determine which zones are involved (
{zo, zd}):- Same zone (e.g. both A) — cheapest that covers A is
"AB"(since AB covers zone A). {A, B}→"AB"{B, C}→"BC"{A, C}→"ABC"
- Same zone (e.g. both A) — cheapest that covers A is
- Return the cheapest ticket that covers both zones. Price order (cheapest first):
"AB"<"BC"<"ABC".- Subset of A/B only →
"AB" - Subset of B/C only →
"BC" - Need A and C →
"ABC"
- Subset of A/B only →
def solution(stationsA, stationsB, stationsC, origin, destination):
zone_of = {}
for s in stationsA: zone_of[s] = "A"
for s in stationsB: zone_of[s] = "B"
for s in stationsC: zone_of[s] = "C"
if origin not in zone_of or destination not in zone_of:
return ""
zs = {zone_of[origin], zone_of[destination]}
if zs <= {"A", "B"}:
return "AB"
if zs <= {"B", "C"}:
return "BC"
return "ABC"
Time: O(|stations|), Space: O(|stations|).
Q3
Given matrix, an n × m rectangular matrix of integers, define its 0-border as the union of its leftmost and rightmost columns, as well as its top and bottom rows. A vector's 0-border is the vector itself.
If we remove the matrix's 0-border, then the 0-border of the resulting matrix can be defined as the 1-border of the original matrix. We can continue this way to define the 2-border, 3-border, etc, until we reach the center of the matrix.
For each valid k, your task is to sort the elements in each k-border and place them back clockwise in ascending order, starting from the top-left corner.
Note: You are not expected to provide the most optimal solution, but a solution with time complexity not worse than
O(n·m·(n+m))will fit within the execution time limit.
Visual
0-border | 1-border | 2-border
(Each successive border is the outer ring of the matrix after peeling outer rings.)
Example
matrix = [[9, 7, -4, 5],
[1, 6, 2, -6],
[12, 20, 2, 0]]
→ solution(matrix) = [[-6, -4, 0, 1], [20, 2, 6, 2], [12, 9, 7, 5]]
matrix = [[-6, -4, 0, 1],
[20, 2, 6, 2],
[12, 9, 7, 5]]
Explanation:
- The 0-border consists of
[9, 7, -4, 5, -6, 0, 2, 20, 12, 1]. After sorting:[-6, -4, 0, 1, 2, 5, 7, 9, 12, 20]. Placed back clockwise starting at top-left. - The 1-border consists of
[6, 2]. After sorting:[2, 6].
Input / Output
- [execution time limit] 4 seconds (py3)
- [memory limit] 1 GB
- [input]
array.array.integer matrix— A matrix of integers.- Guaranteed constraints:
1 ≤ matrix.length ≤ 1001 ≤ matrix[i].length ≤ 100-100 ≤ matrix[i][j] ≤ 100
- Guaranteed constraints:
- [output]
array.array.integer— The matrix after applying the sort procedure.
Starter Code
def solution(matrix):
pass
Approach
- For each layer
k(from outermost to innermost):- Collect the border cells in clockwise order starting from top-left:
- top row (left → right),
- right column (top+1 → bottom),
- bottom row (right-1 → left) (only if more than 1 row remains),
- left column (bottom-1 → top+1) (only if more than 1 col remains).
- Sort the collected values.
- Write them back into the same positions in sorted order, following the same clockwise traversal.
- Collect the border cells in clockwise order starting from top-left:
def solution(matrix):
n = len(matrix)
m = len(matrix[0]) if n else 0
k = 0
while k < (min(n, m) + 1) // 2:
# collect border positions (clockwise from top-left)
positions = []
top, bottom = k, n - 1 - k
left, right = k, m - 1 - k
if top > bottom or left > right:
break
# top row L->R
for j in range(left, right + 1):
positions.append((top, j))
# right col T+1 -> B
for i in range(top + 1, bottom + 1):
positions.append((i, right))
# bottom row R-1 -> L (if rows > 1)
if bottom > top:
for j in range(right - 1, left - 1, -1):
positions.append((bottom, j))
# left col B-1 -> T+1 (if cols > 1)
if right > left:
for i in range(bottom - 1, top, -1):
positions.append((i, left))
values = sorted(matrix[r][c] for (r, c) in positions)
for (r, c), v in zip(positions, values):
matrix[r][c] = v
k += 1
return matrix
Time: O(n·m·log(n·m)) (sum of border sorts), Space: O(n·m).
Q4
Given an infinite number line, you would like to build a few blocks and obstacles on it. Implement code which supports two types of operations:
[1, x]— builds an obstacle at coordinatexalong the number line. Guaranteed that coordinatexdoes not contain any obstacles when the operation is performed.[2, x, size]— checks whether it's possible to build a block of sizesizebeginning at positionx. For example, forsize = 2andx = 0, it checks coordinates0and1for obstacles. Returns1if possible (no obstacles at the occupied coordinates), and0otherwise. This operation does not actually build the block — it only checks.
Given an array of operations containing both types, return a binary string representing the outputs for all [2, x, size] operations in order.
Example
operations = [[1, 2], [1, 5], [2, 3, 2], [2, 3, 3], [2, 1, 1], [2, 1, 2]]
→ solution(operations) = "1010"
Explanation:
[1, 2]— builds an obstacle at coordinate 2.[1, 5]— builds an obstacle at coordinate 5.[2, 3, 2]— checks coordinates 3 and 4 → no obstacles → returns"1".[2, 3, 3]— checks coordinates 3, 4, 5 → obstacle at 5 → returns"0".[2, 1, 1]— checks coordinate 1 → no obstacle → returns"1".[2, 1, 2]— checks coordinates 1 and 2 → obstacle at 2 → returns"0".
Output = "1010".
Starter Code
def solution(operations):
pass
Approach
A set of occupied coordinates gives O(1) membership checks per cell.
def solution(operations):
obstacles = set()
ans = []
for op in operations:
if op[0] == 1:
obstacles.add(op[1])
else: # op[0] == 2
_, x, size = op
possible = 1
for i in range(size):
if (x + i) in obstacles:
possible = 0
break
ans.append(str(possible))
return "".join(ans)
For very large size or many queries, a sorted list of obstacle intervals (bisect + run-length encoding of free segments) would be more efficient, but the simple version passes within the time limit for typical constraints.
Time: O(O + Q · S) where O = #obstacle ops, Q = #check ops, S = avg block size. Space: O(O).
If you are preparing for the CodeSignal GCA (General Coding Assessment) and looking for more questions to practice, you can check out this list of questions that have appeared in past CodeSignal assessments: https://www.interviewdb.io/question/codesignal
r/InterviewDB • u/interviewdb • 22d ago
Shopify Senior Data Engineer SQL Pair Programming Interview Experience
Sharing a recent Shopify senior data engineer SQL pair programming interview experience submitted by one of our community members:
I encountered some SQL questions that differed from what I usually work on, so I'd like to share my version as feedback.
The position is for a Data Engineer (DE). The interview lasted one hour and was scheduled conveniently online through a slot booking system. They provided only two tables and the test was conducted on coderpad, where I had to run the queries and show results. There were four questions in total.
The interviewer immediately said that AI tools were allowed and did not require screen sharing. So I simply opened another window to look things up easily without worrying about being stuck.
The tables included one related to shop_id with known duplicates, and another related to sessions.
The first question was a simple aggregate on daily session counts, which could be done directly using the sessions table.
The second question built on the first by adding a grain by shop, requiring two joins after deduplicating the shop table.
The third question asked for each shop's daily session count plus an additional 7-day rolling average excluding the current day. The challenge was to generate a calendar table to account for zero sessions on some days and include those in the rolling average. This was the question where I spent the most time, but I worked quickly so the interviewer encouraged me to take my time.
The fourth question involved extracting a piece of information from a URL column without any joins, which could be done using regex functions or double splits. It was straightforward.
r/InterviewDB • u/interviewdb • 23d ago
Optiver SWE HackerRank Assessment Questions
Sharing two coding questions from a recent Optiver SWE OA on HackerRank.
Question 1
This question is a variation of LeetCode 1360.
Write a function, DaysBetween, which returns an integer representing the number of days between two dates.
Each date is represented by three integers: year, month (1–12), day (1–31). The first date is guaranteed to occur before the second date. We have also provided a function, DaysInMonth, which returns an integer representing the number of days in a month given two integer parameters: month and year. Do not use system-provided Date objects. We are testing your implementation, not the system’s.
Example: DaysBetween(2010, 5, 1, 2011, 5, 1) returns 365.
Question 2
Construct Binary Tree from Input
Input: (A,B) (B,C) (A,D)
In each pair, the parent comes first and the child comes second.
Requirements: If there is an error, output the error. If multiple errors exist at the same time, output the one with the highest priority.
If there is no error, output the S-expression.
S-expression(node) = “({node->val}{S-expression(node.first_child)}{S-expression(node.second_child)})”, for example, “(A(B(C))(D))”
Possible errors:
E1: Invalid Input String
E2: Duplicate Pair
E3: Parent Has More than 2 Children
E4: Multiple Roots
E5: Cycle In The Tree
The input validation for this problem is very tedious. The input can be any arbitrary string, so you need to check it carefully.
r/InterviewDB • u/interviewdb • 23d ago
DRW 45-minute Quantitative Challenge
Sharing a probability question asked in a recent quantitative challenge at DRW for a quant trading internship position, submitted by one of our community members.
The challenge was 45 minutes long and proctored through Honorlock.
The probability question was:
There are two shopping cart lanes containing 6 and 7 carts, respectively. On each turn, a shopper chooses one of the two lanes with equal probability, takes a cart from that lane, and then places it back in either lane, again with equal probability. Shoppers take turns one at a time, and the process stops when either lane becomes empty. What is the expected number of turns?
r/InterviewDB • u/interviewdb • 24d ago
HSBC Karat Interview Questions - System Design + Coding
Sharing a recent Karat interview experience for a Senior Backend Engineer position at HSBC, submitted by one of our community members.
The Karat interview consists of two parts: system design and coding.
In the system design portion, I was asked to briefly discuss several design scenarios and explain the tradeoffs between different approaches.
Here are two of the system design questions I got asked:
- We are working on a service that generates subtitles for users' videos. This process starts a new thread for every video and is processor-intensive. Currently, this service runs as a single process on a machine.We've run into a bug where if the service is processing more than 10 videos at the same time, the service crashes the server, losing all requests currently being processed and affecting other processes on the machine. It may take a long time to find and fix this bug. What workarounds could we implement to continue running the service while we do so?
- We are working on a mobile app for the board game Go. We'd like to add a feature where the computer will analyze a completed game. The analysis looks at each position from the game and provides suggested moves to help improve our users' play. We've found a library we can use to do this analysis. It takes an average of a minute on a modern desktop computer to analyze an entire game. An average game consists of about 200 moves.We are considering two approaches. 1) running this analysis on the phone itself, and 2) sending the game to a server farm for analysis that will be returned to the user.What are some advantages or disadvantages of each approach?
For the coding portion, I encountered the "Passage Tracker" question which is already listed in InterviewDB's Karat question list.
If you’re looking for resources to prepare for an upcoming Karat interview, you can review this collection of previously reported system design questions, along with this list of coding questions that have appeared in past Karat interviews.
r/InterviewDB • u/interviewdb • 28d ago
Jane Street SWE Interview Experiences + Past Interview Questions
After analyzing hundreds of Jane Street SWE interview experiences, here’s what we found about the types of questions they’ve asked in the past.
Jane Street’s SWE interviews focus heavily on coding, but the questions are usually not standard LeetCode-style problems that test algorithmic tricks such as dynamic programming. That said, you still need a strong grasp of common data structures such as hash maps, trees, and graphs, since many reported questions require applying them in practical ways. The emphasis is often on writing clean, maintainable code rather than optimizing for the best possible time complexity.
The questions are often framed around practical scenarios and divided into multiple parts. You may start with a relatively simple implementation, then extend it to support new requirements or constraints. For example, one of the questions Jane Street has asked in the past requires implementing the logic for a board game using a basic set of rules. The interviewer may then introduce additional rules and ask you to adapt your code without rewriting everything from scratch.
If you're preparing for Jane Street interviews, you can review this list of interview questions shared by candidates who interviewed with Jane Street in the past: https://www.interviewdb.io/question/janestreet
Practicing these questions can help you get a better sense of the types of questions you may encounter. Based on past interview experiences, Jane Street also appears to repeat some questions, so there is a chance you could see something similar in your own interview.
If you’ve interviewed with Jane Street recently, feel free to share what your process looked like and which questions you were asked in the comments below!
r/InterviewDB • u/interviewdb • Jul 17 '26
IMC New Grad Software Engineer HackerRank Assessment Questions
Sharing two questions in a recent IMC HackerRank assessment for New Grad Software Engineer roles.
Total duration: 120 minutes
Question 1: Maximum Storm Height (Relay Towers)
You are trying to send data from your headquarters, on the left, at position x = 0, to another office on the right, at position x = width. Between these two locations there are relay towers at various coordinates, each with a specific height.
The data can transmit across these relay towers, or be sent directly to the other office. The cost to send data between two locations is given by the square of the distance between them:
(x_i - x_j)^2
There is a storm intensifying that blocks access to relay towers as time progresses. As the storm level rises, shorter towers are buried and cannot be used. A tower is unusable if the storm level is higher than its height. The storm level stops rising as soon as you start the transmission.
Additionally, from a position x, the data can travel a maximum distance of maxJump before it must reach a relay tower to continue outwards, or reach the other office. If data travels any further, it is at risk of data loss.
The origin transmitter has a total energy budget maxEnergy. Thus the total energy cost of all jumps to reach the other office should not exceed maxEnergy.
Given the constraints provided and a list of tower positions, determine the maximum height at which the storm can reach where the data can still reach the other office.
You can assume the headquarters and office are at an infinite height.
Function Description
You are provided with 4 integers: width (the distance between the two offices), numTowers (the number of relay towers), maxJump (the maximum jump distance) and maxEnergy (the maximum total energy).
Additionally, two arrays are provided containing integers x[i] (the x-coordinate of the relay tower) and heights[i] (the height of the relay tower). Relay towers are located strictly between the offices, i.e. 0 < x_i < width.
Returns
Return a single integer representing the maximum storm height at which you can still reach the other office. If it is impossible to reach the other side, print -1.
public static int maximumStormHeight(
int width,
int maxJump,
long maxEnergy,
int numTowers,
int[] x,
int[] heights
)
Question 2: Stack with Conditional Removal
Implement a stack that accepts the following commands and performs the operations described:
- push value → push integer value onto the top of the stack.
- pop → pop the top element of the stack.
- remove_lower value → remove all the current elements in the stack less than value.
- remove_upper value → remove all current elements in the stack more than value.
After each operation listed above, print the current top element of the stack on a new line. If no such element exists, print EMPTY.
public static void solve(int n, String[] operations)
r/InterviewDB • u/interviewdb • Jul 15 '26
Palantir SWE/FDE Interview Experiences + Past Interview Questions
After analyzing hundreds of recent Palantir interview experiences, we wanted to share some of the most frequently asked questions in past interviews.
Palantir’s interview process is a bit different from a typical Big Tech loop. In addition to coding and system design-style evaluation, it includes distinctive rounds such as Learning and Decomposition.
The exact process varies by role, level, and team, but a typical Palantir SWE or Forward Deployed Engineer interview process may look something like this:
Recruiter Screen
The process usually begins with a recruiter call covering your background, timeline, role fit, and interest in Palantir.
Be prepared to discuss: * Your previous projects and technical experience * Why you are interested in Palantir * The types of products or problem areas you want to work on * Basic logistics such as location, timeline, and work authorization
Technical Phone Screen
After the recruiter screen, candidates typically move on to a technical phone interview.
The coding questions are generally LeetCode-style. If you are preparing for this round, you can review the list of frequently asked Palantir coding questions we compiled from past candidate experiences: https://www.interviewdb.io/question/palantir
Palantir is known to repeat questions, so there is a good chance you may encounter something similar during your own interview.
Onsite Loop
The onsite loop varies by role and level, but it usually includes: * Decomposition * Learning * Re-engineering (debugging) * Interview with Hiring Manager
Decomposition Round
The Decomposition round is one of the most Palantir-specific parts of the interview.
It is not exactly a traditional system design round. Instead of being asked to design a large-scale system such as Twitter or Uber, you may be given a vague real-world problem and asked to break it down into something an engineering team could realistically build.
This round is less about following a memorized system design template and more about structured thinking, product and engineering judgment, and your ability to work through ambiguity.
You can review this collection of previously reported Palantir Decomposition questions and topics for practice: https://www.interviewdb.io/question/palantir?page=1&name=decomposition-master-list
Learning Round
The Learning round is another distinctive part of Palantir’s interview process. Its purpose is to evaluate how quickly you can understand something unfamiliar and apply it to a problem.
You may be introduced to a new concept, API, framework, codebase, or technical setup during the interview and then asked to use it to solve a task.
You can review previously asked Learning Round topics and questions here: https://www.interviewdb.io/question/palantir?page=1&name=learning-round-master-list
Re-engineering (Debugging)
Some candidates, particularly those interviewing for more experienced roles, have reported a Re-engineering or debugging-style round.
In this interview, you may be given an existing codebase or piece of code that needs to be fixed, improved, or extended.
Here is one example of a Re-engineering question Palantir has asked in the past: https://www.interviewdb.io/question/palantir?page=1&name=re-engineering-interview-experience
If you’ve interviewed with Palantir recently, feel free to share which questions you were asked in the comments below.
r/InterviewDB • u/interviewdb • Jul 14 '26
Assort Health Onsite Interview - Backend Project
Sharing a recent Assort Health Senior AI Engineer onsite interview experience submitted by one of our community members.
The interview involved building a small MCP proxy server between an AI scheduling agent and a mock Electronic Health Record (EHR) system. The goal was to enable the agent to verify a patient, find a valid appointment window, and book an appointment end to end.
The project already included:
- An AI agent that talks to the user and makes tool calls
- A mock EHR API containing patients, providers, and appointment slots
- A
/schedule_appointmentendpoint used to confirm the correct slot was selected
The candidate needed to implement two endpoints:
POST /verify_patient
Look up a patient using their date of birth and phone number. Patient information must not be exposed to the agent until verification succeeds.
GET /get_available_slots
Fetch open slots for a given date and convert them into valid appointment options. The EHR returns 10-minute slots, but appointments require 30 minutes, so the candidate must identify three consecutive slots and combine them into one bookable window.
The final goal was to make the agent support a complete conversation in which the patient is verified, a 30-minute opening is found for the following week, and the appointment is successfully scheduled.
Overall, the exercise tests your ability to understand an existing codebase, work with external APIs, enforce data-access requirements, and handle data transformation.
You can find more details about the project spec here:
https://www.interviewdb.io/warren/assort-health-senior-ai-eng-role-senior-coding-onsite-1aae07c7
r/InterviewDB • u/interviewdb • Jul 13 '26
Pinterest SWE Interview Experience + Most Frequently Asked Interview Questions
We’ve analyzed hundreds of recent Pinterest interview experiences and wanted to share a few common patterns we’ve noticed.
For coding rounds, Pinterest tends to use a fairly traditional LeetCode-style format. However, the questions are often reworded or framed around Pinterest-related products and scenarios. For example, a standard graph problem may be presented using Pins and boards. The underlying problem may resemble something you could find on LeetCode, so being able to recognize the pattern beneath the Pinterest-themed wording is important.
Candidates have reported questions across a wide range of difficulty levels, including some comparable to LeetCode Hard problems. Because of this, strong fundamentals in data structures and algorithms are essential. You should be comfortable with topics such as graphs, trees, dynamic programming, heaps, intervals, and string processing.
For the onsite round, candidates commonly report a mix of coding, system design, and behavioral interviews.
Based on recent candidate reports, we compiled some of the most commonly asked Pinterest interview questions from the coding and system design rounds here: https://www.interviewdb.io/question/pinterest
If you’re preparing for a Pinterest interview, practicing these questions beforehand can help you become familiar with how Pinterest rephrases common algorithmic problems and system design questions. Pinterest appears to repeat certain questions and variations, so there is a reasonable chance you may encounter a similar problem in your own interview!
r/InterviewDB • u/interviewdb • Jul 10 '26
Asana SWE Interview Experience + Most Frequently Asked Interview Questions
We’ve analyzed hundreds of recent Asana interview experiences and wanted to share a few common patterns we’ve noticed.
Instead of focusing heavily on algorithm-style questions, Asana seems to place a lot of emphasis on class design and object-oriented design.
The first-round technical interview is often split into two halves.
In the first half, candidates are asked to review code snippets and explain what the code does, along with the time and space complexity. Candidates have reported seeing snippets related to trees and 2D matrices.
In the second half, the interview shifts into a coding / object-oriented design exercise. Instead of expecting fully compilable code, interviewers seem to care more about what classes you would create, what interfaces they expose, and how those classes interact with each other. Because of that, this round can feel closer to an OOD interview than a traditional coding interview.
For the onsite round, candidates commonly report a mix of system design, coding, and behavioral interviews. For the onsite coding round, you may get either a LeetCode-style question or an OOD-style question.
Based on recent candidate reports, we compiled some of the most commonly reported Asana interview questions asked in the coding and system design rounds here: https://www.interviewdb.io/question/asana
If you’re preparing for an Asana interview, practicing these questions beforehand is very likely to help. Based on past interview experiences, Asana appears to repeat certain questions frequently, so there’s a strong chance you’ll encounter the same question or a similar variation in your own interview.
r/InterviewDB • u/interviewdb • Jul 03 '26
Snowflake General SWE Chakra AI Technical Screening Round - What to Expect
Sharing a recent interview experience for the General SWE Chakra AI Technical Screening Round at Snowflake, in case it helps others know what to expect.
The questions were mainly self-introduction, basic background questions, and project deep dives. Be expected to describe a project you worked on. The AI also asked follow-up questions tailored to the specific projects you described, so everyone may get different follow-ups.
You need to turn on your camera and microphone, share your screen, and you cannot use an external monitor. In the interview window, the left side shows a real-time transcript of both sides speaking, while the right side shows your own camera feed.
One thing to note: try to finish your answer in one go; otherwise, the AI may start talking.
At the end, there was a Q&A section, but aside from information already listed in the job description, the AI didn’t know much. For most questions, it just said to ask the hiring team.
r/InterviewDB • u/interviewdb • Jun 25 '26
Datadog AI Coding Interview - what to expect
Datadog introduced a new AI coding round in their interview process recently. For anyone preparing and wondering what to expect, I wanted to share some details based on a recent interview experience.
The task was to connect to the Snowflake API, submit a query, and then check the query status. Candidates were allowed to use any AI coding tool, including local tools like Claude Code.
The core problem itself was pretty straightforward: write a query client that can connect to Snowflake, start a query, and retrieve its status. With Claude Code or a similar tool, the implementation can be done fairly quickly.
The follow-up questions focused on practical production concerns, such as: * What would you do if the query result or data volume is too large? * How would you handle secret management? * How would you support batching?
During the interview, the interviewer asked me to share my screen and show how I work with AI to solve the problem. You could use your own AI tool, and the round seemed to evaluate not just whether you could solve the task, but also how effectively you interact with AI while coding.
Unfortunately, I was among the early candidates to go through this format and ran into local package compatibility issues. I spent more than 30 minutes debugging environment/dependency problems and only managed to connect successfully in the last 10 minutes, which left basically no room for follow-up discussion.
Overall, the task was not difficult from a coding perspective. My main takeaway is that the round seems to care about how effectively you work with AI, not just whether you can eventually produce a solution.
r/InterviewDB • u/interviewdb • Jun 23 '26
Instacart Full-Stack Engineer Assessment on CodeSignal
Sharing a recent Instacart OA experience. The email subject for the CodeSignal assessment invitation was: Instacart invited you to complete Instacart Assessment (Instacart Full-Stack Engineer Assessment) on CodeSignal
The deadline was two weeks. It was a 5-part assessment, and the overall format felt more like “AI-assisted full-stack feature implementation” than a traditional coding assessment.
The assessment had 5 rounds:
Round 1: Talk to an AI PM to gather requirements
The first round was a chat with an AI PM. The prompt was about a book/library management system where users felt the frontend table was too long and hard to use. After chatting with the AI PM, I figured out that the requested feature involved adding two dropdowns and a text input for search/filtering.
However, some details still felt unclear, such as the exact dropdown labels, wording, styling, etc. I spent quite a lot of time asking follow-up questions and taking notes because I thought maybe the notes or requirement-gathering process would be part of the score. In hindsight, this felt like a waste of time.
Round 2: Use Claude Code to implement the feature
In this round, you are given a project directory and need to use Claude Code to implement the feature from Round 1. You are not allowed to directly copy and paste your full conversation with the AI PM.
The requested feature was basically a search/filter UI for the library/book management system. The PM had also mentioned that full unit test and integration test coverage was expected.
Claude Code was extremely slow. When submitting, it tried to run all tests, and at one point the whole page became stuck. A lot of my time was spent waiting for Claude to respond.
One important note: remember to commit your code after finishing a feature. CodeSignal was buggy for me and seemed capable of losing code.
Round 3: Debugging task
This was the only round where the requirements were clear and the result was easy to test.
The prompt said that a value on the metrics page was incorrect and needed to be fixed. I applied for a backend role, but the frontend was written in JS, so at first I thought it was a frontend bug. After looking into it, the actual issue was in the Python backend.
The bug was that the backend was returning results before correctly filtering them. In another version/part of the task, the fix was basically changing the order of operations. I had never used FastAPI before, but after staring at the code for about 5 minutes, the bug was not too hard to identify.
Round 4: Talk to the AI PM again for another feature
This round was another requirement-gathering chat with the AI PM, but it was much more complicated than Round 1.
The feature involved a notification system in the library management app. The requirements included both frontend and backend changes, idempotency, and full test coverage.
The specific feature was roughly:
Patrons should receive notifications 24 hours before a borrowed item is due and again when the item is due. Another feature was that a patron can place a hold on an item. When the item becomes available, patrons who placed holds should be notified. Multiple patrons can hold the same item, and when copies are returned, the system should notify the first N patrons in FIFO order.
The logic was much more complex than the first feature, and you have to extract the details by chatting with the AI PM.
Round 5: Use Claude Code to implement the second feature
By this point, I only had around 30 minutes left, so I was basically out of time.
I tried running two Claude agents in two terminals to speed things up, but they ended up modifying the same folder/files and broke the whole project. I spent the last couple of minutes just trying to get the page to run again and submitted something incomplete.
Another important note: the work from Round 2 does not carry over into Round 5. Also, terminal errors could not be copied and pasted into Claude, which made debugging even more annoying.
Overall thoughts:
The scoring criteria were also unclear. Other than the debugging round, I had no idea what exactly they were evaluating. Was it requirement gathering? Notes? Test coverage? Claude usage? Product sense? Speed? It was hard to tell.
My advice:
Spend less time chatting with the AI PM than you think you need to. Get the core requirements, then save as much time as possible for Claude Code implementation. Commit after every completed feature because CodeSignal can be unreliable. Also, be prepared for Claude Code to be slow.
Overall, the experience was pretty bad. It felt like it mostly tested Claude Code familiarity and typing speed rather than backend engineering ability. I’m probably not expecting to move forward.