← WeRide Interview InsightsSoftware Engineer

WeRide·Software Engineer·Technical Phone Screen·Intermediate

Intermediate
May 2026

Summary

Interviewed for a software engineer role at Weride and got a coding problem that was a variant of Sudoku. Not a lot of context to share but it was a technical screen focused purely on the problem.

Questions Asked (1)

Q1

Solve a Sudoku-style variant problem (a modified version of the classic Sudoku constraint satisfaction puzzle).

Algorithms & Data Structures
Author's notes

The twist on the standard Sudoku format is what slowed me down.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Clarify the exact variant rules and constraints, then model the problem as a constraint satisfaction problem. Discuss a backtracking solution with constraint propagation (e.g., MRV heuristic) and analyze time/space complexity, considering optimizations like bitmasks for tracking candidates.

Pro tip: Before coding, ask the interviewer about the variant's specific rules and constraints—this shows you prioritize understanding over assumptions. Also, mention how you would test with edge cases like an empty board or unsolvable puzzle to demonstrate thoroughness.

1. Clarify the problem

Ask questions to understand the variant: what are the grid dimensions, what constraints are modified, and what is the expected output? Confirm input format and edge cases.

2. Choose an algorithm

Decide between backtracking, constraint propagation, or exact cover (Dancing Links). For most variants, backtracking with heuristics like Minimum Remaining Values (MRV) is effective.

3. Outline the solution

Describe the recursive backtracking function: find an empty cell, try valid numbers, recurse, and backtrack. Explain how you track constraints (e.g., rows, columns, boxes) using sets or bitmasks.

4. Analyze complexity and optimize

State worst-case time complexity (exponential) and space complexity (O(n^2) for board). Discuss optimizations: MRV, forward checking, bitmask operations, and early pruning.

5. Test and validate

Walk through a small example or edge case (e.g., already solved board, unsolvable board) to verify the logic. Mention potential pitfalls like infinite loops or incorrect constraint checks.

Key Points to Mention

  • Backtracking algorithm with recursion
  • Constraint propagation techniques (e.g., MRV, forward checking)
  • Bitmask representation for efficient candidate tracking
  • Time and space complexity analysis
  • Handling of edge cases (empty board, unsolvable puzzle)
  • Comparison with alternative approaches like Dancing Links

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.