Dynamic Path Accessor
Updated
Problem statement
Implement get_dict_value for a nested dictionary and a dot-separated path. Each path segment names a key in the current dictionary.
- If every segment exists, return the value at that path.
- If a segment is missing, or an intermediate value is not a dictionary, return
None.
The runner provides the following parameters:
String objJson: a JSON serialization of the source dictionaryString path: the dot-separated path to access
Return: A string containing the resolved value as compact JSON text, or None when the path does not exist.
Function
get_dict_value(objJson: String, path: String) → StringExamples
Example 1
objJson = "{\"car\":{\"wheels\":2,\"gears\":5}}"path = "car.gears"return = "5"The path car.gears resolves to the integer 5. The runner returns its compact JSON representation, 5.
More NVIDIA interview questions
- Network Layer Execution OrderPHONE SCREEN · Seen Nov 2026
- Paged KV Cache AccessPHONE SCREEN · Seen Nov 2026
- Sliding Window Attention over a KV CachePHONE SCREEN · Seen Nov 2026
- Summarize Server Healthcheck LogsPHONE SCREEN · Seen Oct 2026
- Query a Header-Encoded MatrixOA · Seen Oct 2026
- Maximum ScoreOA · Seen Oct 2026
- Address on Same PageOA · Seen Oct 2026
- Minimize Task Resource ConsumptionOA · Seen Oct 2026
- Minimum Project Bid CostOA · Seen Oct 2026
- Count Ideal Numbers in a RangeOA · Seen Oct 2026
Similar questions at other companies
- Total Each Letter's Count in an Encoded StringIBM · OAIBM interview questions
- FIX Message ReconciliationVirtu Financial · OAVirtu Financial interview questions
- Split Tender Part 4 - RefundsStripe · OA · PHONE SCREENStripe interview questions
- Job Runner Chain ReportsHeadlands Technologies · OAHeadlands Technologies interview questions
- Inventory Discount TrackerRoblox · OARoblox interview questions
- Hidden ArtifactsIMC Trading · OAIMC Trading interview questions
- Employee Count Median, Mean and ModeClay · PHONE SCREEN
- Aggregate Values by LetterRiot Games · PHONE SCREEN
- Message Latencies from CSV LogsAmazon · ONSITE INTERVIEW
- Count Repeated WordsDatadog · PHONE SCREENDatadog interview questions