practice a little every day, paws crossed ♡
Coding & Algorithms Interview Questions
Practice 9403 coding, system design and machine learning questions from 546 companies, sorted by role, topic and interview round. Every question has step-by-step hints, a code runner that supports 8 languages and an AI mentor; members also get the full solution walkthrough.
- 9403
- Questions
- 546
- Companies
- 11
- Topics
- 8
- Languages
Showing 2281–2310 of 3276 results
- PinduoduoMediumSoftware EngineerClockwise Spiral Matrix Traversal That Turns at Blocked Cells
Return the values of a matrix in clockwise spiral order starting from the top-left cell, then extend the walk so that blocked cells force clockwise turns and can end it early. Tests precise grid simulation, direction rotation, visited and boundary checks, and an unambiguous stopping rule.
Coding & AlgorithmsTechnical Screen - PinduoduoMediumSoftware EngineerCompute longest increasing subsequence length
This question tests the ability to solve the Longest Increasing Subsequence (LIS) problem, specifically targeting the transition from a standard dynamic programming approach to an optimized binary search solution.
Coding & AlgorithmsTechnical ScreenDynamic ProgrammingBinary SearchArrays - PinduoduoHardSoftware EngineerCount Longest Substrings After Character Replacements
This problem tests the sliding window technique with dynamic constraints, requiring an efficient way to track window state and calculate valid substring counts.
Coding & AlgorithmsTechnical ScreenSliding WindowTwo PointersStrings - PinduoduoMediumSoftware EngineerDesign a Recency-Eviction Cache
This problem tests your ability to implement a Least Recently Used (LRU) cache using a combination of a hash map and a doubly linked list to achieve constant time operations.
Coding & AlgorithmsTechnical ScreenHash MapLinked ListLRU Cache - PinduoduoHardSoftware EngineerFind Shortest Square-Sum Path
This problem tests your ability to model a shortest-path graph search problem where states are integers and transitions involve adding perfect squares.
Coding & AlgorithmsTechnical ScreenDynamic ProgrammingBFSNumber Theory - PinduoduoMediumSoftware EngineerGenerate a Matrix in Spiral Order
This problem tests your ability to simulate a specific traversal pattern in a 2D grid and maintain precise boundary pointers to fill the matrix correctly.
Coding & AlgorithmsTechnical ScreenArrayMatrixSimulation - PinduoduoEasySoftware EngineerGenerate a Spiral Matrix
This problem tests your ability to manage matrix traversal coordinates and maintain state (direction and boundaries) while iteratively filling a grid.
Coding & AlgorithmsTechnical ScreenArraysMatricesSimulation - PinduoduoMediumSoftware EngineerLongest Single-Letter Substring After at Most k Character Changes
Given a string of uppercase letters and a budget of at most k single-character changes, find the longest run of one repeated letter that can be produced. Tests reasoning about which substrings can be made uniform, efficient counting, and a near-linear solution for strings of up to 100,000 characters.
Coding & AlgorithmsTechnical Screen - PinduoduoMediumSoftware EngineerTraverse a Matrix in Spiral Order
Traverse a rectangular matrix in clockwise spiral order using shrinking boundaries. Handle empty, single-row, and single-column inputs without duplicates while achieving linear time and constant auxiliary space beyond the result.
Coding & AlgorithmsTechnical Screen - PinterestMediumSoftware EngineerAnswer Policy Violation Log Queries
Design an in-memory query engine over a timestamp-sorted policy violation log to support aggregate, point, and range queries efficiently using hash maps and binary search.
Coding & AlgorithmsTechnical Screenhash-tablebinary-searchdesign - PinterestMediumSoftware EngineerAssign Pins to Shortest Columns
This question evaluates understanding of greedy assignment strategies and data structures for maintaining and updating minimums in an online allocation problem, while also testing load-balancing reasoning and analysis of time and space complexity.
Coding & AlgorithmsTechnical Screen - PinterestMediumData ScientistCalculate 95% Bootstrap Confidence Interval for Order Values
This question evaluates a data scientist's competence in statistical inference using bootstrap resampling, proficiency with numerical computing for large sample operations, and attention to performance optimization.
Coding & AlgorithmsOnsite - PinterestMediumSoftware EngineerCollect Pins from Reachable Boards
Implement a breadth-first graph traversal over a collection of boards to collect unique pins in discovery order, handling cycles, shared children, and invalid references.
Coding & AlgorithmsOnline AssessmentGraphBFSHash Table - PinterestEasyData ScientistCompute average unique pins per user
This question evaluates a candidate's ability to process collections and compute aggregated metrics, including per-user deduplication of items, handling of missing/null entries, numeric averaging and rounding.
Coding & AlgorithmsTechnical Screen - PinterestMediumSoftware EngineerCompute reachable cells for a cleaning robot
This problem tests graph traversal techniques (BFS/DFS) on a 2D grid, focusing on efficient coordinate management and state representation when navigating obstacles.
Coding & AlgorithmsOnsiteBFSGraph Traversal2D Grid - PinterestHardSoftware EngineerCount Distinct Active Pins per Time Segment from Overlapping Interaction Logs
Process overlapping pin interaction logs to calculate the number of distinct active pins over continuous time segments. Tests interval merging, line sweep techniques, and boundary handling.
Coding & AlgorithmsOnsitesweep-lineintervalssorting - PinterestMediumSoftware EngineerCross-reference logs to flag spam numbers
This question evaluates proficiency with data structures (such as hash maps), parsing and deduplication, frequency counting, input validation, and analysis of time and space complexity.
Coding & AlgorithmsOnsite - PinterestMediumSoftware EngineerDecide target via subsequence plus/multiply expression
A Pinterest software-engineer coding screen: given positive 32-bit integers and a target, decide whether some subsequence with '+'/'*' operators evaluated strictly left to right (equal precedence) hits the target, and return a valid expression. The answer spans forward backtracking, monotonicity-based pruning, a divisibility-guided reverse search from the target, complexity analysis, and 32-bit overflow handling.
Coding & AlgorithmsTechnical Screen - PinterestMediumData ScientistDecode and Explain Ambiguity in Compression Strings
This question evaluates parsing of compact count-value encodings, reasoning about ambiguous encodings, and combinatorial enumeration of all valid decodings.
Coding & AlgorithmsOnsite - PinterestMediumSoftware EngineerDelete and Compact a Forest Stored by Parent Indices
Implement subtree deletion on a parent-pointer forest array, supporting tombstoning and index compaction with pointer remapping.
Coding & AlgorithmsTechnical Screentreegrapharray - PinterestMediumData ScientistDesign Algorithm to Minimize Payments in Expense-Sharing App
This question evaluates algorithm design and optimization skills, focusing on modeling multi-party transactions and minimizing the number of settlement operations.
Coding & AlgorithmsOnsite - PinterestMediumData ScientistDesign Data Structure for Sparse Matrices Operations
This question evaluates a candidate's ability to design efficient data structures and implement algorithms for sparse matrix storage and operations, emphasizing space-efficient representations, matrix arithmetic, and computational complexity reasoning.
Coding & AlgorithmsOnsite - PinterestMediumMachine Learning EngineerDesign Hierarchical Permission Checks
This question evaluates understanding of hierarchical access control, tree data structures, and permission inheritance, testing competencies in data modeling and algorithmic reasoning.
Coding & AlgorithmsTechnical Screen - PinterestMediumSoftware EngineerDesign a violation log analyzer
This question evaluates proficiency in data structures, in-memory indexing and query design, algorithmic time/space complexity analysis, and reasoning about state management for dynamic event streams.
Coding & AlgorithmsTechnical Screen - PinterestMediumSoftware EngineerDesign adjustable ID allocator
A Pinterest software-engineer onsite coding problem: design an adjustable ID allocator over a fixed [0, 999] ID space with named, contiguous, non-overlapping bucket ranges. It covers initial allocation (packing from desired sizes and validating/normalizing proposed ranges), a resize operation that grows or shrinks a bucket by consuming adjacent free space and then minimally shifting or borrowing from neighbors under a deterministic policy, plus complexity analysis, boundary-case testing, and concurrency handling.
Coding & AlgorithmsOnsite - PinterestMediumData ScientistDetermine Pin Connections Through Common Boards
This question evaluates graph modeling and connectivity concepts, including representing boards and pins as relationships and reasoning about reachability and minimal connection paths.
Coding & AlgorithmsOnsite - PinterestMediumSoftware EngineerDetermine equality of arbitrarily nested sets
This question evaluates understanding of nested data structures and set semantics, including canonicalization, hashing, recursion, handling of edge cases, unit-test design, and time/space complexity analysis.
Coding & AlgorithmsTechnical Screen - PinterestMediumSoftware EngineerFewest Buses to Ride Between Two Stops on Looping Bus Lines
A coding problem about bus lines that loop through fixed lists of stops: find the fewest buses a rider must board to travel from a source stop to a target stop, or report that the target cannot be reached. It tests modeling transfers between lines as a graph and keeping the search efficient when many lines share stops.
Coding & AlgorithmsOnsite - PinterestMediumSoftware EngineerFind First Prefix-Matching Word
This problem tests your ability to efficiently search through a collection of strings to find the first element that satisfies a specific prefix condition, emphasizing clean iteration and edge case management.
Coding & AlgorithmsTechnical ScreenStringsArraysIteration - PinterestMediumData ScientistFind available reservation time slots
This question evaluates a candidate's ability to reason about time-interval data and temporal normalization, testing competencies in interval manipulation, conflict detection, and algorithmic problem-solving for scheduling contexts.
Coding & AlgorithmsOnsite