PracHub
QuestionsPremiumLearningGuidesCheatsheetNEWCoaches
|Home/Coding & Algorithms/Instacart

Validate password strength and repair

Last updated: Mar 29, 2026

Quick Overview

This question evaluates string-processing, constraint-satisfaction, and algorithm-design skills by requiring validation against multiple password rules and computation of the minimal edits (insert, delete, replace) needed for compliance.

  • Medium
  • Instacart
  • Coding & Algorithms
  • Software Engineer

Validate password strength and repair

Company: Instacart

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: Medium

Interview Round: Onsite

Given a password policy—length between 8 and 20 characters; must include at least one lowercase letter, one uppercase letter, and one digit; and must not contain any character repeated three or more times consecutively—write a function that (a) validates whether an input string is compliant and (b) if not, returns the minimum number of edits (insert, delete, replace) needed to make it compliant along with one valid corrected password. Describe your algorithm, consider large inputs, and analyze time/space complexity.

Quick Answer: This question evaluates string-processing, constraint-satisfaction, and algorithm-design skills by requiring validation against multiple password rules and computation of the minimal edits (insert, delete, replace) needed for compliance.

Related Interview Questions

  • Implement an In-Memory File Storage System - Instacart (medium)
  • Decode an encoded string - Instacart (medium)
  • Evaluate an arithmetic expression - Instacart (medium)
  • Implement worker time and payroll tracker - Instacart (hard)
  • Solve Two Sorted-Array Tasks - Instacart (hard)
Instacart logo
Instacart
Aug 1, 2025, 12:00 AM
Software Engineer
Onsite
Coding & Algorithms
3
0

Given a password policy—length between 8 and 20 characters; must include at least one lowercase letter, one uppercase letter, and one digit; and must not contain any character repeated three or more times consecutively—write a function that (a) validates whether an input string is compliant and (b) if not, returns the minimum number of edits (insert, delete, replace) needed to make it compliant along with one valid corrected password. Describe your algorithm, consider large inputs, and analyze time/space complexity.

Comments (0)

Sign in to leave a comment

Loading comments...

Browse More Questions

More Coding & Algorithms•More Instacart•More Software Engineer•Instacart Software Engineer•Instacart Coding & Algorithms•Software Engineer Coding & Algorithms
PracHub

Master your tech interviews with 7,500+ 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
  • Compare Platforms
  • Discord Community

Support

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

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.