PracHub
QuestionsPremiumLearningGuidesCheatsheetNEWCoaches
|Home/Coding & Algorithms/Optiver

Solve a Skyscraper puzzle efficiently

Last updated: May 15, 2026

Quick Overview

This question evaluates understanding of constraint satisfaction and combinatorial search, testing competency in modeling Latin-square domains with visibility constraints, pruning and uniqueness verification, and algorithmic complexity analysis.

  • Medium
  • Optiver
  • Coding & Algorithms
  • Data Scientist

Solve a Skyscraper puzzle efficiently

Company: Optiver

Role: Data Scientist

Category: Coding & Algorithms

Difficulty: Medium

Interview Round: Take-home Project

Design and implement a solver for the Skyscraper logic puzzle on an N×N grid (3 ≤ N ≤ 7). Each row and column must contain the numbers 1..N without repetition. Edge clues indicate how many buildings are visible from that side given building heights. Given a set of clues (possibly some blanks), return one valid grid or report that none exists. Describe your modeling (e.g., constraint propagation with Latin-square domains, visibility predicates), search strategy (backtracking, MRV/degree heuristics, forward checking), pruning techniques, and how you would verify uniqueness. Provide the expected input/output formats and analyze worst-case complexity.

Quick Answer: This question evaluates understanding of constraint satisfaction and combinatorial search, testing competency in modeling Latin-square domains with visibility constraints, pruning and uniqueness verification, and algorithmic complexity analysis.

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
34
0

Design and implement a solver for the Skyscraper logic puzzle on an N×N grid (3 ≤ N ≤ 7). Each row and column must contain the numbers 1..N without repetition. Edge clues indicate how many buildings are visible from that side given building heights. Given a set of clues (possibly some blanks), return one valid grid or report that none exists. Describe your modeling (e.g., constraint propagation with Latin-square domains, visibility predicates), search strategy (backtracking, MRV/degree heuristics, forward checking), pruning techniques, and how you would verify uniqueness. Provide the expected input/output formats and analyze worst-case complexity.

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.