PracHub
QuestionsPremiumLearningGuidesCheatsheetNEWCoaches
|Home/Coding & Algorithms/Optiver

Minimize moves to transform floor layouts

Last updated: Mar 29, 2026

Quick Overview

This question evaluates algorithm design and combinatorial optimization skills, focusing on reasoning about minimal moves, greedy heuristics, and proving optimality within the Coding & Algorithms domain for data-science technical roles.

  • Medium
  • Optiver
  • Coding & Algorithms
  • Data Scientist

Minimize moves to transform floor layouts

Company: Optiver

Role: Data Scientist

Category: Coding & Algorithms

Difficulty: Medium

Interview Round: Take-home Project

You are given an initial arrangement of apartments across Floors 1–4 and a target arrangement. In one move you may reposition a single apartment to a different floor (assume any move is allowed unless it violates the target’s per-floor apartment counts). Design an algorithm to transform the initial arrangement into the target using the fewest moves. Answer the following: - Describe your algorithm and prove or argue its optimality. - Analyze its time and space complexity. - Evaluate the greedy strategy "fix Floor 1 first, then Floors 2–4": is it always optimal? Provide a counterexample or a proof. - If multiple optimal solutions exist, how would you output one sequence of moves?

Quick Answer: This question evaluates algorithm design and combinatorial optimization skills, focusing on reasoning about minimal moves, greedy heuristics, and proving optimality within the Coding & Algorithms domain for data-science technical roles.

Related Interview Questions

  • Find missing numbers in sequences - Optiver (hard)
  • Design a circular queue data structure - Optiver (medium)
  • Optimize flight and cargo bookings for profit - Optiver (hard)
  • Compare two programs for equivalence - Optiver (Medium)
  • Design a satellite propagation simulator - Optiver (Medium)
Optiver logo
Optiver
Sep 6, 2025, 12:00 AM
Data Scientist
Take-home Project
Coding & Algorithms
1
0

You are given an initial arrangement of apartments across Floors 1–4 and a target arrangement. In one move you may reposition a single apartment to a different floor (assume any move is allowed unless it violates the target’s per-floor apartment counts). Design an algorithm to transform the initial arrangement into the target using the fewest moves. Answer the following:

  • Describe your algorithm and prove or argue its optimality.
  • Analyze its time and space complexity.
  • Evaluate the greedy strategy "fix Floor 1 first, then Floors 2–4": is it always optimal? Provide a counterexample or a proof.
  • If multiple optimal solutions exist, how would you output one sequence of moves?

Comments (0)

Sign in to leave a comment

Loading comments...

Browse More Questions

More Coding & Algorithms•More Optiver•More Data Scientist•Optiver Data Scientist•Optiver Coding & Algorithms•Data Scientist 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.