r/OfferEngineering • • 19h ago

Coding Question Microsoft Staff SWE OA

4 Upvotes

Problem 1 — Maximum Money on a Prime-Jump Journey

A traveler goes through a row of cities given as an integer array. Each value is the money earned in that city (positive) or spent there (negative). The trip starts at city 0 and has to end at city n - 1. From any city, the traveler can either move to the next city or jump ahead p cities, where p is any prime number whose last digit is 3. The task is to return the most money the traveler can have at the end of the trip.

cities = [0, -40, 70, -300, 60, -200, -90, 30]
output = 50

In this example, the array is short enough that 3 is the only usable prime ending in 3, so every move is either +1 or +3. The best route starts at city 0 and steps to city 1 (total −40). From there it jumps three cities to city 4 (−40 + 60 = 20) and jumps three more to city 7 (20 + 30 = 50).

The function to implement was optimalJourneyTotal(int cities[n]), which returns an int. The constraints were:

  • 1 <= n <= 10^4 and -10^4 <= cities[i] <= 10^4
  • cities[0] = 0

Problem 2 — House Robber IV (LeetCode 2560)

There are several consecutive houses along a street, each of which has some money inside. There is also a robber, who wants to steal money from the homes, but he refuses to steal from adjacent homes.

The capability of the robber is the maximum amount of money he steals from one house of all the houses he robbed. You are given an integer array nums representing how much money is stashed in each house. More formally, the ith house from the left has nums[i] dollars.

You are also given an integer k, representing the minimum number of houses the robber will steal from. It is always possible to steal at least k houses. Return the minimum capability of the robber out of all the possible ways to steal at least k houses.

Example 1:

Input: nums = [2,3,5,9], k = 2
Output: 5
Explanation: 
There are three ways to rob at least 2 houses:
- Rob the houses at indices 0 and 2. Capability is max(nums[0], nums[2]) = 5.
- Rob the houses at indices 0 and 3. Capability is max(nums[0], nums[3]) = 9.
- Rob the houses at indices 1 and 3. Capability is max(nums[1], nums[3]) = 9.
Therefore, we return min(5, 9, 9) = 5.

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 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 • • 5h 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 • • 8h 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!


r/OfferEngineering • • 41m ago

Interview Experience Reddit Senior SWE Phone Screen - Design Tennis Game

1 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 • • 21h ago

Interview Experience AWS SDE II Interview — Did I Just Win the LeetCode Lottery?

1 Upvotes

This interview experience was originally shared on Chill Interview

Interview Summary

My AWS SDE II process was a phone screen followed by a four-round onsite: two coding rounds, one system design round and a Bar Raiser. The questions were variants of connected components, LRU Cache with TTL, Task Scheduler and Optimal Account Balancing, plus a design for real-time game statistics that went deep on Redis. Almost every round included a live dry run and complexity analysis. The Bar Raiser asked for more than one approach to the same problem.

Phone Screen — Graph Connected Components

I got a graph problem similar to Number of Connected Components in an Undirected Graph (LeetCode 323). You have a graph of n nodes labeled from 0 to n - 1. You are given an integer n and an array edges where edges[i] = [ai, bi] indicates that there is an edge between ai and bi in the graph. Return the number of connected components in the graph.

Onsite Round 1 — Coding: LRU Cache with TTL

Design and implement something similar to LRU Cache (LeetCode 146). The interviewer explicitly asked me to build it with a HashMap and a doubly linked list, and then to dry run it live. The follow-up asked how I'd change the design if entries had a TTL (time-to-live). The round ended with time and space complexity analysis.

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 • • 22h ago

Interview Experience Shopify SWE Intern OA — Why Can't I Just Use One Programming Language?

1 Upvotes

This interview experience was originally shared on Chill Interview

Interview Summary

The assessment included three coding problems covering game theory and dynamic programming, polynomial expression parsing, and discount calculations for grouped products.

The coding questions used different programming languages, including Ruby and C++, and were followed by a series of quiz questions. The coding problems were generally approachable, but each required careful handling of the problem rules and edge cases.

Question 1 — Coding: Optimal Card Picking Game

The first coding question involved a two-player card game in which both players make optimal decisions. Two players are given a sequence of n cards, where n is even and every card contains a positive integer. The cards are arranged in a row. Players alternate turns, and on each turn, the current player must take exactly one card from either end of the remaining sequence.

The value of the selected card is added to that player's score. Both players start with a score of zero, know the entire card sequence in advance, and play optimally to maximize their own final scores.

Task

Implement the following function: max_score(cards). The function takes a list of integers representing the cards from left to right and returns the final score of the player who moves first, assuming both players play optimally.

Example

Input:
cards = [2, 8, 11, 4, 7, 3]

At each turn, the current player can select only the leftmost or rightmost remaining card. The challenge is that choosing the card with the highest immediate value does not necessarily produce the best final result, because the decision affects which cards the opponent can select later.

Key Considerations

The problem requires considering both players' future decisions rather than simply selecting the larger card at each turn. Since both players play optimally, the implementation must account for the opponent's best possible responses when calculating the first player's final score.

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 • • 23h ago

Interview Experience Gusto (Payroll & HR Tech) Senior SWE Interview — Wait, Why Is the Legal Team Interviewing Me?

1 Upvotes

This interview experience was originally shared on Chill Interview

Interview Summary

I recently completed Gusto's Software Engineer onsite interviews, which were spread across two days. The process included two coding rounds, an engineering manager behavioral interview, a restaurant scheduling system design interview, and an additional value alignment interview conducted by someone from the legal team.

Round 1 — Coding: Federal Income Tax Calculator

The first coding round involved implementing a federal income tax calculator. The task was to calculate the tax owed based on applicable tax rates and brackets. The initial problem was fairly standard, but the interviewer introduced several follow-ups that required extending the original design.

I was asked to implement a tax calculation system that applies different tax rates to different portions of a person's income. The implementation needed to represent the applicable tax brackets and calculate the total tax owed. This was primarily a business logic and software design problem rather than a traditional LeetCode-style algorithm question.

  • The interviewer asked how I would extend the implementation to support multiple tax years. Because tax brackets and rates can change from year to year, the design needed to accommodate different configurations without requiring a complete rewrite of the calculation logic.
  • The next follow-up involved supporting different tax filing statuses. For example, different filing statuses may use different tax brackets, so the calculator needed to apply the appropriate rules depending on the taxpayer's filing status.
  • Another follow-up asked how the system could support custom tax rates, including a fixed-rate configuration. This required thinking about how to make the calculation logic flexible enough to handle different tax structures rather than assuming every calculation would use the same progressive tax brackets.

Round 2 — Coding: Fair Money Distribution

The second coding round involved distributing a pool of money among multiple recipients. This was another frequently reported Gusto coding problem. The scenario was representative of financial allocation problems, where individually simple rules can become more complicated when applied together.

At Gusto, payments sometimes need to be distributed to multiple recipients from a single pool of funds. Given an amount of available money and a collection of recipients with their outstanding balances, implement a function that determines how much each recipient should receive.

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 • • 3h 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.