PracHub
QuestionsPremiumLearningGuidesCheatsheetNEWCoaches
|Home/Coding & Algorithms/Sunrise

Solve common data-structure and puzzle problems

Last updated: Mar 29, 2026

Quick Overview

This multi-part problem set evaluates core coding and algorithmic concepts—linked list manipulation, constant-time spatial indexing, number-theoretic reasoning, in-place list modification, combinatorial scheduling, BST validation, interval merging, and gap analysis—focusing on algorithm design, correctness, complexity analysis, and edge-case handling. Category/domain: Coding & Algorithms; level of abstraction: a mix of implementation-level programming (pointer and traversal operations, interval merging) and high-level mathematical/analytical reasoning (O(1) formulas, divisor properties, optimal scheduling), commonly asked to assess efficiency and problem-solving rigor.

  • easy
  • Sunrise
  • Coding & Algorithms
  • Software Engineer

Solve common data-structure and puzzle problems

Company: Sunrise

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: easy

Interview Round: Onsite

Solve the following independent problems (language of your choice; assume typical 32/64-bit constraints): 1) **Reverse a singly linked list** - Given the head of a singly linked list, reverse it and return the new head. (Iterative and/or recursive.) 2) **Numbering on an outward spiral grid** - Integers are written on an infinite 2D grid starting with `1` at `(0,0)`, then `2` at `(1,0)`, and continuing counterclockwise in an outward square spiral (right, up, left, down, ...). - Given integer coordinates `(x, y)`, compute the value written at that cell in **O(1)** time (no simulating the spiral). 3) **100 bulbs toggling** - There are 100 bulbs labeled `1..100`, all initially OFF. - Person 1 toggles every bulb; person 2 toggles bulbs `2,4,6,...`; person 3 toggles `3,6,9,...`; ...; person 100 toggles bulb `100`. - Which bulbs are ON at the end? 4) **Delete a node with only that node** - You are given a pointer/reference to a node `p` inside a singly linked list (you do **not** have the head pointer). - Delete `p` from the list in O(1) time. State any required assumptions. 5) **Bridge-and-torch scheduling** - Four people must cross a bridge with one torch. At most two people cross at a time, and they must carry the torch. - Their individual crossing times are `1, 2, 5, 6` minutes; when two cross together, the pair takes the slower person’s time. - Find a schedule that gets everyone across in **≤ 13 minutes**, or prove it’s impossible. 6) **Validate a BST** - Given the root of a binary tree, determine whether it satisfies the binary search tree property. 7) **Merge intervals** - Given a list of intervals `[start, end]` (inclusive), merge all overlapping intervals and return the merged list. 8) **Maximum adjacent gap after sorting** - Given an unsorted array of integers, if the array were sorted, what is the maximum difference between two adjacent elements in the sorted order? - Design an algorithm better than O(n log n) if possible, and state assumptions.

Quick Answer: This multi-part problem set evaluates core coding and algorithmic concepts—linked list manipulation, constant-time spatial indexing, number-theoretic reasoning, in-place list modification, combinatorial scheduling, BST validation, interval merging, and gap analysis—focusing on algorithm design, correctness, complexity analysis, and edge-case handling. Category/domain: Coding & Algorithms; level of abstraction: a mix of implementation-level programming (pointer and traversal operations, interval merging) and high-level mathematical/analytical reasoning (O(1) formulas, divisor properties, optimal scheduling), commonly asked to assess efficiency and problem-solving rigor.

Sunrise logo
Sunrise
Jul 21, 2025, 12:00 AM
Software Engineer
Onsite
Coding & Algorithms
0
0

Solve the following independent problems (language of your choice; assume typical 32/64-bit constraints):

  1. Reverse a singly linked list
  • Given the head of a singly linked list, reverse it and return the new head. (Iterative and/or recursive.)
  1. Numbering on an outward spiral grid
  • Integers are written on an infinite 2D grid starting with 1 at (0,0) , then 2 at (1,0) , and continuing counterclockwise in an outward square spiral (right, up, left, down, ...).
  • Given integer coordinates (x, y) , compute the value written at that cell in O(1) time (no simulating the spiral).
  1. 100 bulbs toggling
  • There are 100 bulbs labeled 1..100 , all initially OFF.
  • Person 1 toggles every bulb; person 2 toggles bulbs 2,4,6,... ; person 3 toggles 3,6,9,... ; ...; person 100 toggles bulb 100 .
  • Which bulbs are ON at the end?
  1. Delete a node with only that node
  • You are given a pointer/reference to a node p inside a singly linked list (you do not have the head pointer).
  • Delete p from the list in O(1) time. State any required assumptions.
  1. Bridge-and-torch scheduling
  • Four people must cross a bridge with one torch. At most two people cross at a time, and they must carry the torch.
  • Their individual crossing times are 1, 2, 5, 6 minutes; when two cross together, the pair takes the slower person’s time.
  • Find a schedule that gets everyone across in ≤ 13 minutes , or prove it’s impossible.
  1. Validate a BST
  • Given the root of a binary tree, determine whether it satisfies the binary search tree property.
  1. Merge intervals
  • Given a list of intervals [start, end] (inclusive), merge all overlapping intervals and return the merged list.
  1. Maximum adjacent gap after sorting
  • Given an unsorted array of integers, if the array were sorted, what is the maximum difference between two adjacent elements in the sorted order?
  • Design an algorithm better than O(n log n) if possible, and state assumptions.

Comments (0)

Sign in to leave a comment

Loading comments...

Browse More Questions

More Coding & Algorithms•More Sunrise•More Software Engineer•Sunrise Software Engineer•Sunrise 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.