PracHub
QuestionsCoachesLearningGuidesInterview Prep

Quick Overview

This question evaluates graph traversal and pathfinding with weighted edge composition for currency conversion reachability, and sequence partitioning with diversity-aware pagination for preserving ordering and maximizing distinct identifiers, testing skills in modeling relationships, reachability, aggregation of multiplicative metrics, and constrained list processing. It is commonly asked in technical interviews in the Coding & Algorithms domain to assess practical application of data-structure and algorithmic concepts (graph algorithms and list processing/data partitioning), emphasizing efficiency, correctness, and pragmatic reasoning about reachability and ordering rather than purely theoretical understanding.

  • medium
  • Mavenclinic
  • Coding & Algorithms
  • Software Engineer

Solve two interview coding problems

Company: Mavenclinic

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: medium

Interview Round: Onsite

This interview included two coding tasks: 1. **Currency conversion graph** You are given a set of directed currency exchange rates, for example: - `CAD -> USD = 0.880` - `USD -> JPY = 2000.000` Given a source currency and a target currency, determine whether the target is reachable from the source. If multiple conversion paths exist, return the path with the fewest conversions (minimum number of edges). Also compute the resulting exchange rate along that path by multiplying the rates on the path, and round the final result to three decimal places. 2. **Paginate clinic listings by payer diversity** You are given a pre-sorted list of clinic listing records. Each record contains fields such as `payer_id`, `listing_id`, and `rating`. Split the list into pages of size `x`. Each page should contain as many distinct `payer_id` values as possible. If there are not enough distinct `payer_id` values left to fill the page, use the remaining records to fill the page while preserving the original order as much as possible. Return the paginated result.

Quick Answer: This question evaluates graph traversal and pathfinding with weighted edge composition for currency conversion reachability, and sequence partitioning with diversity-aware pagination for preserving ordering and maximizing distinct identifiers, testing skills in modeling relationships, reachability, aggregation of multiplicative metrics, and constrained list processing. It is commonly asked in technical interviews in the Coding & Algorithms domain to assess practical application of data-structure and algorithmic concepts (graph algorithms and list processing/data partitioning), emphasizing efficiency, correctness, and pragmatic reasoning about reachability and ordering rather than purely theoretical understanding.

Shortest Currency Conversion Path

Return the fewest-edge currency conversion path and multiplied rate rounded to three decimals, or None if unreachable.

Constraints

  • Rates are directed

Examples

Input: ([('CAD', 'USD', 0.88), ('USD', 'JPY', 2000.0)], 'CAD', 'JPY')

Expected Output: {'path': ['CAD', 'USD', 'JPY'], 'rate': 1760.0}

Explanation: Two-edge conversion.

Input: ([('A', 'B', 2.0), ('A', 'C', 3.0), ('C', 'B', 4.0)], 'A', 'B')

Expected Output: {'path': ['A', 'B'], 'rate': 2.0}

Explanation: Chooses fewest conversions.

Input: ([], 'A', 'B')

Expected Output: None

Explanation: Unreachable.

Hints

  1. BFS finds the path with the fewest edges in an unweighted graph.

Paginate Listings by Payer Diversity

Split pre-sorted listings into pages, taking at most one record per payer first, then filling remaining slots in original order.

Constraints

  • records are pre-sorted

Examples

Input: ([{'payer_id': 'a', 'listing_id': 1}, {'payer_id': 'a', 'listing_id': 2}, {'payer_id': 'b', 'listing_id': 3}, {'payer_id': 'c', 'listing_id': 4}], 2)

Expected Output: [[1, 3], [2, 4]]

Explanation: Prioritizes distinct payers per page.

Input: ([], 3)

Expected Output: []

Explanation: No records.

Input: ([{'payer_id': 'a', 'listing_id': 1}, {'payer_id': 'a', 'listing_id': 2}], 3)

Expected Output: [[1, 2]]

Explanation: Fills when diversity unavailable.

Hints

  1. Build one page at a time: first pass takes unseen payers, second pass fills leftover capacity.
Last updated: Jun 27, 2026

Related Coding Questions

  • Check Meeting Attendance With Breaks - Mavenclinic (medium)
  • Reorder Search Results for Provider Diversity - Mavenclinic (medium)

Loading coding console...

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.