Software Engineer • Senior-Level
Software Engineer • Senior-Level
High QualityPractice Other Questions that Perplexity Asked
Continue with targeted prep from Perplexity's coding question bank and system design questions.
Interview Summary
The coding interview was divided into four progressive parts, with each part extending the previous implementation. One important detail was that input validation was required throughout the exercise, and invalid inputs needed to raise errors.
Interview Details
Round 1 — Coding: Design a Feature Flag Rule Engine
The coding interview focused on implementing a feature flag system based on a set of provided interfaces. Each feature flag rule contained the following fields:
| Field | Description |
|---|---|
namespace | Namespace associated with the rule |
flag_name | Name of the feature flag |
enabled | Whether the flag is enabled |
pct | Percentage used for feature rollout |
depends_on | List of other feature flags that this flag depends on |
The interviewer gradually introduced additional requirements, starting with namespace parsing and rule resolution before adding percentage-based rollout and dependency validation.
Part 1 — Parse Hierarchical Namespaces
The first task was to implement two namespace utility functions.
-
Function 1:
parse_namespace(namespace)Given a namespace represented as a dot-separated string, return its individual components. For example:
Input: namespace = "payments.risk.rules" Output: ["payments", "risk", "rules"]Input: namespace = "payments.risk.rules" Output: ["payments", "risk", "rules"] -
Function 2:
parse_ancestors(namespace)Given a hierarchical namespace, return the namespace itself followed by its ancestors, moving toward the root namespace. For example:
Input: namespace = "payments.risk.rules" Output: [ "payments.risk.rules", "payments.risk", "payments", "" ]Input: namespace = "payments.risk.rules" Output: [ "payments.risk.rules", "payments.risk", "payments", "" ]An important requirement was that the empty string
""is a valid namespace. It represents
Unlock Full Details
Create a free account to unlock this interview experience report.