PracHub
QuestionsPremiumLearningGuidesCheatsheetNEWCoaches
|Home/Coding & Algorithms/Nuro

Implement BFS and a Job Scheduler

Last updated: Mar 29, 2026

Quick Overview

This question evaluates algorithmic problem-solving and concurrency engineering skills by combining a BFS-based grid-reveal algorithm for minefield traversal and a thread-safe periodic job scheduler requiring synchronization and scheduling semantics.

  • hard
  • Nuro
  • Coding & Algorithms
  • Backend Engineer

Implement BFS and a Job Scheduler

Company: Nuro

Role: Backend Engineer

Category: Coding & Algorithms

Difficulty: hard

Interview Round: Onsite

The interview report described two coding questions in the same category: 1. **Grid reveal with BFS** You are given an `m x n` board representing a hidden minefield. Each cell is one of: - `M`: unrevealed mine - `E`: unrevealed empty cell - `B`: revealed blank cell with no adjacent mines - `1`-`8`: revealed cell showing the number of adjacent mines - `X`: revealed mine after a click Given a click position `(row, col)`, update the board using these rules: - If the clicked cell is a mine (`M`), change it to `X`. - Otherwise, reveal cells using **BFS**: - Count the number of mines in the 8 neighboring cells. - If the count is greater than 0, write that digit in the cell and stop expanding from it. - If the count is 0, mark the cell as `B` and continue revealing its unrevealed neighbors. Return the updated board. 2. **Concurrent periodic job scheduler** Implement a thread-safe in-memory scheduler that supports periodic jobs. Each job has: - a unique `jobId` - an execution interval such as every `N` milliseconds - a callback function to run Support the following operations: - `register(jobId, intervalMs, task)` - `cancel(jobId)` - `start()` - `stop()` Requirements: - Multiple worker threads may execute jobs concurrently. - A job should be triggered approximately once per interval. - The same scheduled run must not execute more than once. - Cancellation must be safe even if other threads are polling or executing jobs. - Explain how you would handle cases where a task runs longer than its interval, clock drift, and backpressure under heavy load.

Quick Answer: This question evaluates algorithmic problem-solving and concurrency engineering skills by combining a BFS-based grid-reveal algorithm for minefield traversal and a thread-safe periodic job scheduler requiring synchronization and scheduling semantics.

Related Interview Questions

  • Parse logs and count error codes - Nuro (easy)
  • Group points by distance threshold - Nuro (medium)
  • Find Maximum Path Sum in N-ary Tree - Nuro (hard)
  • Find gaps between intervals - Nuro (medium)
Nuro logo
Nuro
Feb 4, 2025, 12:00 AM
Backend Engineer
Onsite
Coding & Algorithms
4
0

The interview report described two coding questions in the same category:

  1. Grid reveal with BFS You are given an m x n board representing a hidden minefield. Each cell is one of:
    • M : unrevealed mine
    • E : unrevealed empty cell
    • B : revealed blank cell with no adjacent mines
    • 1 - 8 : revealed cell showing the number of adjacent mines
    • X : revealed mine after a click
    Given a click position (row, col) , update the board using these rules:
    • If the clicked cell is a mine ( M ), change it to X .
    • Otherwise, reveal cells using BFS :
      • Count the number of mines in the 8 neighboring cells.
      • If the count is greater than 0, write that digit in the cell and stop expanding from it.
      • If the count is 0, mark the cell as B and continue revealing its unrevealed neighbors.
    Return the updated board.
  2. Concurrent periodic job scheduler Implement a thread-safe in-memory scheduler that supports periodic jobs. Each job has:
    • a unique jobId
    • an execution interval such as every N milliseconds
    • a callback function to run
    Support the following operations:
    • register(jobId, intervalMs, task)
    • cancel(jobId)
    • start()
    • stop()
    Requirements:
    • Multiple worker threads may execute jobs concurrently.
    • A job should be triggered approximately once per interval.
    • The same scheduled run must not execute more than once.
    • Cancellation must be safe even if other threads are polling or executing jobs.
    • Explain how you would handle cases where a task runs longer than its interval, clock drift, and backpressure under heavy load.

Comments (0)

Sign in to leave a comment

Loading comments...

Browse More Questions

More Coding & Algorithms•More Nuro•More Backend Engineer•Nuro Backend Engineer•Nuro Coding & Algorithms•Backend 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.