cswork / libraryOpen practice workspace

READ. UNDERSTAND. PRACTICE.

Coding questions

Explore algorithm tutorials, coding and system design questions, interview experiences, and computer science study guides.

1,899 resources · Page 66 of 80

  1. Coding questions · Amazon

    Search target in unknown-length sorted array

    This question evaluates algorithm design and implementation skills for search algorithms on array-like interfaces with unknown length, focusing on bounds discovery, handling out-of-bounds sentinels, duplicate elements, and rigorous time and space complexity analysis.

  2. Coding questions · LinkedIn

    Second-Smallest Value in a Min Tournament Tree in Logarithmic Time

    Given a full binary tournament tree stored in array order, where each internal node holds the smaller of its two children, return the second-smallest leaf value in logarithmic time. It tests reasoning about how a knockout structure constrains where the runner-up can be, array-based tree indexing, and justifying a partial search.

  3. Coding questions · TikTok

    Segment a message with width-constrained suffixes

    This question evaluates algorithm design and string-processing skills, focusing on constraint-aware segmentation with variable-length suffix metadata and the accompanying complexity analysis.

  4. Coding questions · TikTok

    Select 10% Users Randomly from User Table

    This question evaluates competency in randomized sampling and data manipulation using SQL or Python, focusing on probabilistic selection and the use of built-in sampling functions within the Data Manipulation (SQL/Python) domain.

  5. Coding questions · TikTok

    Select max-discount product per category

    This question evaluates proficiency in data manipulation and SQL querying—specifically use of window functions versus set-based alternatives, group-level ranking and tie-breaking, NULL-aware expressions, and numeric precision when computing discounts within the Data Manipulation (SQL/Python) domain.

  6. Coding questions · Amazon

    Select maximum tasks before deadlines

    This interview question evaluates algorithm design, data structures, correctness, complexity, edge cases, and implementation details in a realistic interview setting. A strong answer for Select maximum tasks before deadlines states assumptions, handles edge cases, explains trade-offs, and shows how to validate the result clearly.

  7. Coding questions · Amazon

    Select Top Customers Using Transaction Data Filters

    This question evaluates a candidate's ability to perform data aggregation, filtering, ranking, and deterministic tie-breaking on transactional datasets, assessing skills in Data Manipulation (SQL/Python).

  8. Coding questions · Meta

    Shortest 8-Directional Clear Path Across a Binary Grid

    Find the number of cells on the shortest path from the top-left to the bottom-right corner of a square binary grid, moving in any of eight directions through open cells only, or return -1 when no path exists. It tests modeling a grid as a graph, shortest-path reasoning and edge cases such as blocked endpoints.

  9. Coding questions · BCG

    Shortest Distance in an Unweighted Adjacency-Matrix Graph

    Find the minimum edge count between two vertices in a connected, undirected graph represented by a Boolean adjacency matrix. The problem tests traversal order, visited-state handling, the same-vertex case, and matrix-specific complexity.

  10. Coding questions · Glean

    Shortest Manhattan Distance Between Any X and Any Y in a String or Grid

    Find the shortest distance between any X and any Y, first in a string and then in a 2D grid using Manhattan distance, returning -1 when one letter is missing. Tests moving from a linear scan to multi-source breadth-first search and reasoning about efficiency on large grids.

  11. Coding questions · Visa

    Shortest Prefix of a Digit String That Can Build Every Permutation of a Target

    Given a digit string and a list of digit targets, return for each target the length of the shortest prefix whose characters could build every permutation of that target, or -1 if no prefix can. It tests character frequency counting, precomputation over a string, and answering many queries efficiently.

  12. Coding questions · Walmart Labs

    Shortest Talent-Covering Team Starting At Each Index

    Practice a sliding-window coding question where each start index needs the shortest contiguous team containing every talent type. This prompt targets hash map counts, two-pointer window management, and O(n) reasoning for large arrays.

  13. Coding questions · SoFi

    Simulate 1-D collisions and scale to huge inputs

    This question evaluates a candidate's algorithm design skills, proficiency with appropriate data structures, and ability to analyze time and space complexity alongside system-level scalability concerns for large datasets.

  14. Coding questions · Apple

    Simulate a Fixed-Capacity Least-Recently-Used Cache over a Stream of Operations

    A coding question that asks you to implement a fixed-capacity key-value cache with least-recently-used eviction and run it over a stream of get and put operations. It tests precise recency and eviction rules, updates to keys already in the cache, and the design of a data structure with constant-time operations.

  15. Coding questions · Wex

    Simulate a Stack from Push, Pop and End-of-Input Commands

    A coding problem that simulates a stack from a stream of text commands: push an integer, pop and output the top value, or end the input. It tests careful token parsing, signed integers and returning the popped values in the order they were removed.

  16. Coding questions · Uber

    Simulate and Construct Tournament Rankings

    This question evaluates understanding of tournament simulation and constructive permutation design, testing skills in array manipulation, sequential pairwise elimination reasoning, and combinatorial ordering of eliminations.

  17. Coding questions · Glean

    Simulate Modulo-Assigned Document Indexers with Wrap-Around and Rank the Busiest

    Simulate documents assigned to indexers by index modulo m, falling through to the next free indexer with wrap-around and dropping documents when all are busy, then report processed totals, the busiest indexer and the top-k share. Tests event simulation, finding the next free slot efficiently and precise tie rules.

  18. Coding questions · Amazon

    Simulate one disc-flipping board game move across all eight directions

    Simulate one move of a two-player disc-flipping board game: place a piece, flip every run of opponent pieces enclosed by the player's own pieces in all eight directions, and return the board unchanged when the move is illegal. It tests careful grid traversal, precise legality rules and avoiding partial updates.

  19. Coding questions · Uber

    Simulate one-round color elimination on a grid

    This question evaluates array and matrix manipulation skills, including grid traversal, orthogonal neighbor-checking, simultaneous state-update detection, and maintaining relative order while applying gravity-like column operations.

  20. Coding questions · Airbnb

    Simulate pouring water onto a 1D terrain

    This question evaluates understanding of simulation of discrete physical processes, array manipulation, state tracking, and greedy/local-search movement rules, measuring algorithmic design and efficiency competencies.

  21. Coding questions · Upstart

    Simulate Radioactive Decay to Validate Analytical Solution

    This question evaluates a candidate's ability to implement Monte Carlo simulations and validate analytical probability results, testing skills in stochastic processes, numerical estimation, and programming within the Coding & Algorithms domain for data scientist roles.

  22. Coding questions · Shopify

    Simulate robot moves on a grid

    This question evaluates competency in grid-based simulation, state updates, boundary condition handling, and sequential command parsing. Commonly asked in Coding & Algorithms interviews to gauge correct implementation and edge-case reasoning, it assesses practical application more than abstract theory and can be extended to path reconstruction or obstacle-aware movement as follow-ups.

  23. Coding questions · Uber

    Simulate robot on grid with obstacles

    Simulate robot on grid with obstacles evaluates algorithm design, data structures, correctness, complexity, edge cases, and implementation details in a realistic interview setting. A strong answer states assumptions, handles edge cases, explains trade-offs, and shows how to validate the result clearly.

  24. Coding questions · Anthropic

    Simulate stack traces from logs

    This question evaluates stack-based simulation for computing exclusive execution time in nested function call logs and stream-processing concepts for handling equal timestamps, slight reordering, and detection of N consecutive categorical events.