PracHub
QuestionsCoachesLearningGuidesInterview Prep
|Home/Coding & Algorithms/Pinterest

Solve prefix, array, and string problems

Last updated: Apr 27, 2026

Quick Overview

This set of problems evaluates proficiency in string and array algorithm design—covering prefix search, subsequence matching, and maximal-area computation from bar heights—measuring competence in algorithmic thinking, data structure usage, and time/space efficiency.

  • medium
  • Pinterest
  • Coding & Algorithms
  • Machine Learning Engineer

Solve prefix, array, and string problems

Company: Pinterest

Role: Machine Learning Engineer

Category: Coding & Algorithms

Difficulty: medium

Interview Round: Onsite

The interview included several coding problems: 1. **First index matching a prefix**: Given a sorted array of lowercase strings such as `["a", "apple", "appz", "b"]` and a prefix such as `"ap"`, return the index of the first word that starts with the prefix. If no word matches, return `-1`. 2. **Maximum rectangle from bar heights**: Given an array of non-negative integers representing adjacent bar heights, where each bar has width `1`, return the maximum rectangular area that can be formed using one or more consecutive bars. 3. **Check ordered deletion match**: Given two strings `s` and `t`, determine whether `s` can be formed by deleting some characters from `t` without changing the order of the remaining characters.

Quick Answer: This set of problems evaluates proficiency in string and array algorithm design—covering prefix search, subsequence matching, and maximal-area computation from bar heights—measuring competence in algorithmic thinking, data structure usage, and time/space efficiency.

Related Interview Questions

  • First Word Matching Each Prefix Query - Pinterest (medium)
  • Hierarchical Access Control for an Advertising Platform - Pinterest (medium)
  • Maximize Boxes Stored Through One Entrance - Pinterest (medium)
  • Solve Multiple Coding Interview Problems - Pinterest (medium)
  • Implement a Sparse Matrix Class - Pinterest (medium)
|Home/Coding & Algorithms/Pinterest

Solve prefix, array, and string problems

Pinterest logo
Pinterest
Apr 9, 2025, 12:00 AM
mediumMachine Learning EngineerOnsiteCoding & Algorithms
1
0
Practice Read
Loading...

The interview included several coding problems:

  1. First index matching a prefix : Given a sorted array of lowercase strings such as ["a", "apple", "appz", "b"] and a prefix such as "ap" , return the index of the first word that starts with the prefix. If no word matches, return -1 .
  2. Maximum rectangle from bar heights : Given an array of non-negative integers representing adjacent bar heights, where each bar has width 1 , return the maximum rectangular area that can be formed using one or more consecutive bars.
  3. Check ordered deletion match : Given two strings s and t , determine whether s can be formed by deleting some characters from t without changing the order of the remaining characters.

Submit Your Answer to Earn 20XP

Sign in to leave a comment

Loading comments...

Browse More Questions

More Coding & Algorithms•More Pinterest•More Machine Learning Engineer•Pinterest Machine Learning Engineer•Pinterest Coding & Algorithms•Machine Learning Engineer Coding & Algorithms
PracHub

Master your tech interviews with 8,000+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities
  • Student Access

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • AI Coding Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.