Necklace Cut into Two Halves with Equal D/R Counts
Asked at Google · Coding Questions · Difficulty: Medium · Last asked May 3, 2026
A necklace is a circular string made only of the letters `D` and `R`, with exactly as many `D` as `R`. Cutting the circle at two different positions splits it into two arcs. Find two cut positions so that each arc contains the same number of `D` as `R`.
Loading the problem…
More Google interview questions
- LLM conceptual questions
- Implement a Nested Tic-Tac-Toe Game Engine
- ML Fundamentals Deep Dive (AI/ML & MLE Roles)
- Design a Real-Time Product Recommendation System
- Implement Scaled Dot-Product Attention
- Design a Multi-Tenant, Multi-Region API Rate Limiter