PracHub
QuestionsPremiumLearningGuidesCheatsheetNEWCoaches
|Home/Coding & Algorithms/NVIDIA

Solve small string and API tasks

Last updated: Apr 13, 2026

Quick Overview

This question evaluates proficiency in string algorithms (bracket validation and longest non-repeating substring) and practical API skills including HTTP request handling, JSON parsing, and data aggregation.

  • medium
  • NVIDIA
  • Coding & Algorithms
  • Software Engineer

Solve small string and API tasks

Company: NVIDIA

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: medium

Interview Round: Onsite

You are given three small programming tasks (typical “easy” difficulty). Implement each as a function. ## Task 1: Validate parentheses Given a string `s` consisting only of the characters `'(' , ')' , '{' , '}' , '[' , ']'`, determine whether it is valid. A string is valid if: - Open brackets are closed by the same type of brackets. - Open brackets are closed in the correct order. - Every close bracket has a corresponding open bracket. **Input:** `s` (length `0…1e5`) **Output:** `true` if valid, else `false` ## Task 2: Longest substring without repeating characters Given a string `s` (ASCII), return the length of the longest substring that contains no repeated characters. **Input:** `s` (length `0…2e5`) **Output:** integer length ## Task 3: Fetch from a public GET API and transform You are given a public HTTP GET endpoint that returns JSON. Assume the endpoint returns an array of records in the form: ```json [ {"id":"a1","group":"books","amount":12,"ts":"2026-01-01T10:00:00Z"}, {"id":"a2","group":"books","amount":7,"ts":"2026-01-01T11:00:00Z"}, {"id":"b1","group":"games","amount":20,"ts":"2026-01-02T09:00:00Z"} ] ``` Write code that: 1. Calls the endpoint. 2. Parses the JSON. 3. Produces a summary per `group` with: - `count` of records - `totalAmount` (sum of `amount`) 4. Returns the summary list sorted by `group` ascending. **Constraints/notes:** - Records may be empty. - `amount` is a non-negative integer. - You may assume the response fits in memory (≤ `1e5` records). - Focus on correctness and clean error handling (HTTP errors, invalid JSON).

Quick Answer: This question evaluates proficiency in string algorithms (bracket validation and longest non-repeating substring) and practical API skills including HTTP request handling, JSON parsing, and data aggregation.

Related Interview Questions

  • Return all file paths via DFS - NVIDIA (easy)
  • Implement a disk space manager with eviction - NVIDIA (medium)
  • Implement short algorithms on logs, grids, and strings - NVIDIA (hard)
  • Implement encode/decode for list of strings - NVIDIA (easy)
  • Implement matrix transpose and KV store - NVIDIA (medium)
NVIDIA logo
NVIDIA
Feb 9, 2026, 12:00 AM
Software Engineer
Onsite
Coding & Algorithms
5
0
Loading...

You are given three small programming tasks (typical “easy” difficulty). Implement each as a function.

Task 1: Validate parentheses

Given a string s consisting only of the characters '(' , ')' , '{' , '}' , '[' , ']', determine whether it is valid.

A string is valid if:

  • Open brackets are closed by the same type of brackets.
  • Open brackets are closed in the correct order.
  • Every close bracket has a corresponding open bracket.

Input: s (length 0…1e5)

Output: true if valid, else false

Task 2: Longest substring without repeating characters

Given a string s (ASCII), return the length of the longest substring that contains no repeated characters.

Input: s (length 0…2e5)

Output: integer length

Task 3: Fetch from a public GET API and transform

You are given a public HTTP GET endpoint that returns JSON.

Assume the endpoint returns an array of records in the form:

[
  {"id":"a1","group":"books","amount":12,"ts":"2026-01-01T10:00:00Z"},
  {"id":"a2","group":"books","amount":7,"ts":"2026-01-01T11:00:00Z"},
  {"id":"b1","group":"games","amount":20,"ts":"2026-01-02T09:00:00Z"}
]

Write code that:

  1. Calls the endpoint.
  2. Parses the JSON.
  3. Produces a summary per group with:
    • count of records
    • totalAmount (sum of amount )
  4. Returns the summary list sorted by group ascending.

Constraints/notes:

  • Records may be empty.
  • amount is a non-negative integer.
  • You may assume the response fits in memory (≤ 1e5 records).
  • Focus on correctness and clean error handling (HTTP errors, invalid JSON).

Comments (0)

Sign in to leave a comment

Loading comments...

Browse More Questions

More Coding & Algorithms•More NVIDIA•More Software Engineer•NVIDIA Software Engineer•NVIDIA Coding & Algorithms•Software Engineer Coding & Algorithms
PracHub

Master your tech interviews with 7,500+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities
  • Student Access

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.