Instacart Interview Questions (2026-2027)
8 questions · 6 experiences · InterviewDB (8) · Reddit (1) · LeetCode (4) · 1p3a (1)
Browse by role
14 entries
A Hand of Three Cards: Evaluate Poker-Like Hand Rankings for Three-Card Combinations
Average Travel Time: Compute Mean Trip Duration Between Station Pairs from Tap-In/Tap-Out Logs
Data Pivot Table: Transform Row-Level Records into a Cross-Tabulated Summary Table
Decode Password: Reverse a Multi-Step Encoding Scheme to Recover the Original Password
Encoded Matrix: Decode a 2D Matrix Encoded with Row and Column XOR Checksums
Instacart SWE Phone - Expression Evaluation
Pattern Finding: Identify Repeating Structural Patterns in Sequences and Predict Next Elements
Instacart SWE Phone - Timestamped Key-Value Store
Instacart Frontend Focused Onsite Interview Experience
Experiences with Instacart loop
Interview Experience at Instacart Toronto : Seeking Clearer Feedback After a Positive Process
#1701 Average Waiting Time
#34 Find First and Last Position of Element in Sorted Array
#49 Group Anagrams
A Hand of Three Cards: Evaluate Poker-Like Hand Rankings for Three-Card Combinations
Question Details
Problem
You are given a hand of exactly 3 cards, each as (rank, suit) where rank is 2-14 (14=Ace) and suit is one of H/D/C/S. Evaluate the hand and return its category. Categories in descending order:
STRAIGHT_FLUSH— three consecutive ranks, same suitTHREE_OF_A_KIND— all same rankSTRAIGHT— three consecutive ranks, mixed suitsFLUSH— same suit, not consecutivePAIR— exactly two same rankHIGH_CARD— none of the above
python
from typing import NamedTuple
class Card(NamedTuple):
rank: int # 2-14
suit: str # H/D/C/S
def evaluate_hand(cards: list[Card]) -> str:
...
**Input**: [(10,'H'),(11,'H'),(12,'H')] -> "STRAIGHT_FLUSH"
**Input**: [(7,'H'),(7,'D'),(7,'C')] -> "THREE_OF_A_KIND"
**Input**: [(2,'H'),(5,'D'),(3,'C')] -> "STRAIGHT"
**Input**: [(9,'H'),(3,'H'),(6,'H')] -> "FLUSH"
**Input**: [(9,'H'),(9,'D'),(2,'C')] -> "PAIR"
**Input**: [(2,'H'),(7,'D'),(K,'C')] -> "HIGH_CARD"
Follow-ups
- Ace can be low (A-2-3) or high (Q-K-A). How do you handle both cases in your straight detection?
- Given two hands of the same category, how do you compare them to determine a winner (tiebreaker logic)?
- Extend to 5-card poker hands. How does your architecture change?
- How would you generate all possible 3-card hands from a standard 52-card deck and count hands per category?
Topics
More from Instacart
People also viewed