Lyft logo

Lyft Hard Interview Questions

5 hard-level practice questions for Lyft technical interviews

Lyft software engineer interviews cover algorithms, data structures, system design, and coding problems drawn from real interview rounds.

Software Engineer Backend Engineer Frontend Engineer Full Stack Engineer Mobile Engineer Data Engineer Data Scientist ML Engineer DevOps Engineer DevOps Engineer Product Manager SRE Security Engineer Engineering Manager Data Analyst UX/UI Designer QA Engineer
coding Hard Verified Question #1

1. Restaurant Delivery Network


Category: String coding problem
You are building a food discovery platform. Given a user's location, a list of restaurants with their coordinates, and a menu of items with prices,...
Input: List
Output: Computed result
Want to practise this one?
Create a free account to open the full question and practise Lyft questions with AI.
Sign up free
coding Hard Verified Question #2

2. Transactional Cache


Category: String coding problem
Implement an in-memory key-value cache that supports nested transactions. The cache stores string keys mapped to string values and provides the...
Input: String
Output: Computed result
coding Hard Verified Question #3

3. Probe Collision Simulator


Category: Algorithm coding problem
A set of probes is arranged in a line from left to right. Each probe has a mass and a velocity. A positive velocity means the probe moves to the...
Input: List
Output: Computed result
coding Hard Verified Question #4

4. Log Query Engine


Category: String coding problem
You are given a collection of log records. Each record is a five-element list of strings: [time, id, user, type, value], where time and value...
Input: Array of strings
Output: Computed result
coding Hard sliding window #1

1. [Sliding Window] — Find the shortest substring covering all required characters


Background
Lyft engineers work with streams of operational events when investigating ride-request and dispatch failures; finding a compact interval containing required event types is one useful diagnostic operation. This exercise studies the underlying string-window problem, which an unverified reposted Lyft interview account reported as Minimum Window Substring; it does not reproduce a production Lyft interface.
Problem statement
Given strings s and t, return the shortest contiguous substring of s that contains every character in t, including its multiplicity. For example, if t contains two A characters, a valid substring must contain at least two A characters.
Characters are case-sensitive, and their order in t does not constrain their order in the substring. If multiple valid substrings have the same minimum length, return the one with the smallest starting index in s. Return "" if no valid substring exists or if t is empty.
Implement an algorithm that runs in O(len(s) + len(t)) time, including construction of the returned string. Do not enumerate every substring.
Function or class signature
  • min_window(s: str, t: str) -> str


Example 1:
Input:
{"s": "ADOBECODEBANC", "t": "ABC"}
Output:
"BANC"
Explanation: "BANC", beginning at index 9, contains A, B, and C. No substring of length three contains all three required characters, so length four is optimal.
Example 2:
Input:
{"s": "AAABBAAC", "t": "AABC"}
Output:
"BAAC"
Explanation: A valid window needs two copies of A, one B, and one C. The substring at indices 4 through 7 is "BAAC", satisfying all four required occurrences. Its length equals len(t), so no shorter answer is possible.
Constraints:
  • 0 <= len(s), len(t) <= 200000.

  • Both inputs are strings containing only uppercase and lowercase English letters: A–Z and a–z.

  • Repeated characters count separately; character comparison is case-sensitive.

  • Inputs are available in memory and must not be modified.


Follow-up:
Suppose s arrives as a one-pass stream and cannot be reread. Return the best window's inclusive start and exclusive end indices rather than its contents. Can you process the stream in O(len(s) + len(t)) total time using O(len(t)) auxiliary space, even when an arbitrarily long run of irrelevant characters appears?
Want to practise this one?
Create a free account to open the full question and practise Lyft questions with AI.
Sign up free

Start practicing Lyft questions

Sign up for free to access walkthroughs, AI-generated questions, and more.

Get Started Free