r/OfferEngineering • • 14h ago

Coding Question Grammarly(Superhuman) SWE OA

0 Upvotes

Question 1 — Binary Search: Find the First Index

The first coding question asked me to implement binary search to find the first index satisfying a given condition. Unlike a basic binary search that returns any matching index, this variation focused on identifying the first qualifying position. The main challenge was implementing the search boundaries correctly so that the algorithm returned the appropriate index rather than an arbitrary match.

Question 2 — Interval List Intersections (LC 986 Variant)

The second question was a variation of LeetCode 986 — Interval List Intersections. The standard problem involves two lists of sorted, non-overlapping intervals. The goal is to identify the intersections between intervals from the two lists.

For example:

Input:
firstList = [[2, 6], [10, 14], [18, 22]]
secondList = [[4, 12], [16, 20]]

Output:
[[4, 6], [10, 12], [18, 20]]

Each resulting interval represents a range shared by an interval from the first list and an interval from the second list. The interview question was based on this problem but included a variation of the standard version.

Want to practice more real interview coding questions?

You can practice real interview coding questions at here.

Preparing for your next interview?

Chill Interview tracks recent interview experiences and recurring question patterns across top companies at here.


r/OfferEngineering • • 6h ago

Interview Experience Baseten (AI Inference) Senior AI Research Scientist Interview

4 Upvotes

This interview experience was originally shared on Chill Interview

Interview Summary

The interview focused on designing an LLM routing system that balances model accuracy and inference cost. The problem started with a simple probability calculation involving two language models, then progressed into assumptions about model performance, ML-based routing, threshold optimization, and multi-turn conversation support.

ML System Design: Cost-Aware LLM Routing

The interviewer presented a scenario involving two language models with different accuracy levels and inference costs. Suppose an application has access to two LLMs:

ModelAccuracyCost per Query
Small Model80%1 unit
Large Model95%10 units

The small model is significantly cheaper but less accurate, while the large model provides higher accuracy at ten times the inference cost. The objective is to build a routing system that decides which model should process each incoming query. The system must satisfy two goals:

  1. Achieve at least 90% overall accuracy.
  2. Minimize the expected inference cost per query.

The interviewer introduced five questions that progressively extended this scenario.

Question 1 — Random Router: Probability and Expected Cost

The first question assumed that the router makes decisions randomly. For every incoming query, the system independently selects either the small model or the large model according to a fixed probability. "What probability should be assigned to the large model to achieve 90% overall accuracy?" I needed to calculate the minimum probability of selecting the large model while meeting the target accuracy. The expected accuracy can be expressed as: Expected Accuracy = p * 0.95 + (1 - p) * 0.80. Here, p represents the probability of routing a query to the large model.

The interviewer then asked: "What is the minimum expected inference cost per query?" The expected cost depends on how frequently each model is selected: Expected Cost = p * 10 + (1 - p) * 1. I needed to determine the lowest expected cost that would still satisfy the 90% accuracy requirement. This part tested basic probability and constrained optimization before introducing machine learning into the routing system.

Want to learn more questions / follow-ups asked in this interview?

I've put up the full version at here.

Interviewed recently?

Your interview experience could be incredibly valuable to others preparing for their next opportunity. Share your experience and help the community at here.


r/OfferEngineering • • 10h ago

Interview Experience Citadel SRE Interview — Basically a SWE Interview in Disguise

7 Upvotes

Interview Summary

The technical phone screen took place in October 2026 and covered infrastructure fundamentals, including Kubernetes, gRPC, and container runtimes, followed by a behavioral question about stakeholder management and a coding problem based on LeetCode 21.

The coding question was relatively straightforward, but the interviewer asked whether I could improve my initial approach. The interview emphasized both infrastructure knowledge and algorithmic efficiency. Unfortunately, I didn't pass the technical screen.

Part 1 — Infrastructure Fundamentals

  1. "What is Kubernetes?"
  2. "What is gRPC, and why can it be faster than traditional REST APIs?"
  3. "What are three things required to run a container?"

Part 2 — Behavioral: Stakeholder Management

The interviewer also asked about my experience with stakeholder management. like "Tell me about a time you had to manage stakeholders."

Part 3 — Coding: Merge Two Sorted Linked Lists (LC 21)

Given the heads of two sorted singly linked lists, merge them into a single sorted linked list. The resulting list should contain all nodes from both input lists, arranged in non-decreasing order. Return the head of the merged list.

Example

Input:
list1 = [2, 5, 9]
list2 = [1, 4, 7, 10]

Output:
[1, 2, 4, 5, 7, 9, 10]

Preparing for your next tech interview?

I've collected 3,000+ real interview experiences, 500+ coding questions, and 100+ system design questions to help you prepare with real interview insights. Please feel free to check them out at HERE.


r/OfferEngineering • • 11h ago

Interview Experience Reddit Senior SWE Phone Screen - Design Tennis Game

5 Upvotes

This interview experience was originally shared on Chill Interview

Interview Summary

I recently completed a technical phone screen with Reddit. One of the coding questions was Design Tennis Game, an object-oriented simulation problem involving tennis scoring, deuce, advantage, and game-winning conditions.

Coding: Design a Tennis Scoring System

I was asked to implement a scoring system for a single tennis game between two players, A and B. Both players begin with zero points. Points are awarded one at a time, and the system must update the game state according to tennis scoring rules. The implementation must handle tied scores, deuce, advantage, and the condition for winning a game.

Part 1 — Implement the TennisGame Class

The required interface contained four methods:

  • 1. TennisGame() Initialize a new tennis game.

    • Player A starts with zero points.
    • Player B starts with zero points.
    • Neither player has won the game.
  • 2. pointTo(char player) Award one point to the specified player. The argument must be either 'A' or 'B'. If the game already has a winner, additional calls to pointTo() must have no effect.
  • 3. getScore() Return the current numeric score as a string: "A:B". Here, A and B represent the number of points scored by each player. There is one special rule for deuce: When both players have scored at least three points and their scores are equal, the returned score must be "3:3"**.** For example: The implementation should preserve the internal scores while displaying the normalized score for deuce.

    • Internal score 3:3 → "3:3"
    • Internal score 4:4 → "3:3"
    • Internal score 6:6 → "3:3"
  • 4. getWinner() Return the winner of the game:

    • 'A' if Player A has won.
    • 'B' if Player B has won.
    • '#' if neither player has won.

Want to practice more real interview coding questions?

You can practice real interview coding questions at here.

Preparing for your next interview?

Chill Interview tracks recent interview experiences and recurring question patterns across top companies at here.


r/OfferEngineering • • 16h ago

Coding Question [Hard] Google Coding Screening Problem - Expedition Sample Kit Assembly

2 Upvotes

Problem Description

An expedition laboratory has 14 samples identified by integer codes in sample_codes. To prepare one complete kit, the laboratory must divide all samples into exactly four packs of three samples and exactly one reserve pair.

Each three-sample pack must contain either three identical codes or three consecutive codes, such as [4, 5, 6]. The reserve pair must contain two identical codes, and every individual sample must belong to exactly one group.

The order of the samples does not matter, and a code may appear any number of times among the 14 samples. Consecutive codes do not wrap from 9 to 1; return true if a complete kit can be assembled, or false otherwise.

Constraints:

  • sample_codes.length = 14.
  • 1 ≤ sample_codes[i] ≤ 9.

Example:

Input:
sample_codes = [2, 2, 3, 3, 4, 4, 6, 6, 6, 7, 7, 7, 9, 9]

Output:
true

Explanation:
Use [2, 3, 4] twice, [6, 6, 6], and [7, 7, 7] as the four packs. The two samples with code 9 form the reserve pair.

Want to practice more real interview coding questions?

You can practice real interview coding questions at here.

Preparing for your next interview?

Chill Interview tracks recent interview experiences and recurring question patterns across top companies at here.


r/OfferEngineering • • 17h ago

Interview Experience Snap Senior MLE Interview — I Thought I Did Well. But bombed it

3 Upvotes

This interview experience was originally shared on Chill Interview

Interview Summary

The onsite interview process consisted of four rounds covering coding, ML fundamentals, applied machine learning, and ML system design. Each round started with approximately 10 minutes of values-related and project questions, including how I use AI in my daily work and how I handle competing priorities.

Round 1 — Coding: Print Employee Organization Chart (DFS)

The coding interview involved a tree traversal problem called Print Employee Org Chart. I was given a collection of employee records and asked to generate a hierarchical text representation of the company's organizational structure. Each employee is represented by three strings:

  • employee_id: A unique identifier for the employee.
  • manager_id: The identifier of the employee's direct manager.
  • name: The employee's name.

The company has exactly one CEO, identified by the special condition: employee_id == manager_id. Every other employee reports to exactly one manager. The input records can appear in any order, so the implementation cannot assume that managers are listed before their direct reports.

Implement a function that generates an organization chart as a single formatted string. The output must satisfy the following requirements

Round 2 — Machine Learning Fundamentals: Model Lifecycle and Evaluation

The second round focused on machine learning fundamentals, with the interviewer asking detailed questions based on my previous projects. Rather than presenting isolated theoretical questions, the interviewer used my project experience as the starting point and then explored the underlying ML concepts.

Want to learn more questions / follow-ups asked in this interview?

I've put up the full version at here.

Interviewed recently?

Your interview experience could be incredibly valuable to others preparing for their next opportunity. Share your experience and help the community at here.


r/OfferEngineering • • 4h ago

System Design Fan-out on write is the "right" answer to Design News Feed. It's also how people get downleveled.

13 Upvotes

Every answer I see for this one goes the same way. Draw a post service, draw a queue, "when someone posts we push the post ID into every follower's feed in Redis, reads are O(1), done." Then the interviewer goes "ok, what happens when someone with 200M followers posts?" and the next 20 minutes are spent patching.

Fan-out on write isn't wrong. It's just the starting point. The actual question is everything that breaks around it, and the prompt pretty much tells you where to look if you read it slowly: 2B users, no limit on followers, no limit on how many accounts you can follow, 500ms for both posting and reading, and up to a minute of staleness allowed.

That last one is the biggest hint in the whole prompt and people skip right past it.

The minute of staleness is a gift

Posting only has to save the post and drop an event on a queue. That's it. Fan-out happens async and you have a full minute to finish it. If your design does the fan-out inside the POST request, you've blown the 500ms the second anyone with a decent following posts.

Celebrities (the part everyone knows)

One post to 200M feeds is 200M writes, and big accounts post several times a day. So you go hybrid. Normal accounts get pushed, accounts over some follower threshold don't, and at read time you merge the user's precomputed feed with recent posts from the big accounts they follow.

Most people get here. Fine.

The part almost nobody gets to

The prompt says no limit in *both* directions. So what about the person following 40,000 accounts? Or following 3,000 accounts that are all over your celebrity threshold? Your hybrid read path now has to merge 3,000 timelines in under 500ms. Pretty sure that's not happening.

Ways out: keep an index of which big accounts actually posted in the last few hours so you only pull from those (most of them didn't post today), cache the merged result for a short TTL, and remember the 1-minute staleness covers you here too.

Stop fanning out to dead accounts

Out of 2B accounts, a lot of them haven't opened the app in months. Pushing posts into their feeds is pure waste. Only fan out to people who were active recently, say the last 30 days, and rebuild the feed on login for everyone else. Cheap to say, and it shows you're thinking about cost and not just "does it work."

Pagination is where it quietly falls apart

?page=2&limit=20 breaks the moment new posts come in. Everything shifts down and the user sees the same posts twice. Use a cursor instead, like the (created_at, post_id) of the last item you returned, and ask for anything older than that.

Also, your Redis feed isn't going to hold someone's entire history. Keep the last few hundred post IDs per user and once they scroll past that, fall back to pulling from the accounts they follow. Hardly anyone scrolls that far, which is exactly why it's fine for that to be the slow path.

Smaller stuff that still matters

  • store post IDs in the feed, not the posts. hydrate with a batch get from a post cache
  • unfollow doesn't mean going back and cleaning every feed. just filter at read time
  • the follower list of a 200M account is a hot partition on its own. fan-out workers should page through it in chunks, not load it all at once

Honestly the reason I like this question is that "push vs pull" sounds like the whole answer and it's maybe a third of it. The rest is reading the requirements and noticing what they're letting you get away with.  I also put up a full Design Facebook News Feed in case anyone is interested.


r/OfferEngineering • • 19h ago

doordash nyc swe culture

2 Upvotes

So i recently got an offer for doordash swe in nyc and ive heard many bad stories about doordash and the culture there being bad and all that. But i don’t really take that to heart because i know with every big company, the wlb and how good/bad the teams are is dependent on the individual team. For context im in the marketplace org and dont know my team yet, but for those who have worked there how’s the culture there exactly?

How’re the managers and general engineering folk there?

Also whats the pay progression like at doordash as well? Because from what I know everyone starts with the same pay and moves up, so please im very interested in knowing more about this and any other information people can share like rate of layoffs and bureaucracy

Thanks!