ThoughSpot Interview Experience/Question - MTS2,3
Anonymous User
244
May 08, 2026
May 08, 2026

Hi everyone! I recently interviewed with the ThoughtSpot Orion Team and wanted to share a specific question I was asked. The team emphasized that this problem is very representative of their daily work on the orchestration layer. If you’re preparing for a role with them, I highly recommend practicing this one.

The Question:
You are given a root directory called:

/services

Inside this directory, each subdirectory represents a service.

Example:

/services
/Auth
config.txt
/Billing
config.txt
/User
config.txt
/Database
config.txt

📄 Config File Format

Each service contains a file config.txt.

The file contains exactly one line in this format:

depends=ServiceA,ServiceB,ServiceC

If there are no dependencies:

depends=

🎯 Requirements

Write a C++ program that:

Scans all service folders inside /services.

Parses each config.txt.

Determines the correct deployment order.

Ensures:

A service is deployed only after all services listed in its depends line are deployed.

Services that have no remaining unmet dependencies can be deployed in parallel.

Outputs deployment batches.

Detects cyclic dependencies and prints:

Error: Cycle detected. Deployment not possible.

✅ Example
Folder Structure
Auth → depends=Database
Billing → depends=Auth
User → depends=Auth
Database → depends=

Expected Output
Batch 1: Database
Batch 2: Auth
Batch 3: Billing User

Comments (2)