PracHub
QuestionsPremiumLearningGuidesCheatsheetNEWCoaches
|Home/Coding & Algorithms/Goldman Sachs

Solve string and hashmap interview tasks

Last updated: Mar 29, 2026

Quick Overview

This question evaluates proficiency in string manipulation and hash-based aggregation, specifically skills such as frequency counting, map/dictionary usage, and numeric aggregation for averages.

  • medium
  • Goldman Sachs
  • Coding & Algorithms
  • Software Engineer

Solve string and hashmap interview tasks

Company: Goldman Sachs

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: medium

Interview Round: Technical Screen

## Coding questions (solve both) ### 1) First non-repeating character Given a string `s`, return the **first character that appears exactly once** in the string. - If no such character exists, return an empty value (e.g., `""`) or a special marker such as `None`/`null`. **Input:** `s` (string) **Output:** the first non-repeating character (or empty marker) **Constraints (typical):** - `1 <= len(s) <= 10^5` - `s` may contain letters (assume ASCII unless stated otherwise) --- ### 2) Best average score You are given a list of score records. Each record contains a `name` (string) and a `score` (integer). Return the **highest average score** among all names. - A person may appear multiple times; their average is the mean of their scores. - You may assume each person has at least one score. - Specify how you handle rounding (e.g., return a floating-point number, or return an exact rational/decimal). **Input:** `records = [(name1, score1), (name2, score2), ...]` **Output:** the maximum average across names **Constraints (typical):** - `1 <= len(records) <= 10^5` - `score` can be negative or positive (state assumption if you restrict it)

Quick Answer: This question evaluates proficiency in string manipulation and hash-based aggregation, specifically skills such as frequency counting, map/dictionary usage, and numeric aggregation for averages.

Related Interview Questions

  • Implement an Integer Hash Map - Goldman Sachs
  • Solve string and hashmap coding tasks - Goldman Sachs (medium)
  • Find first non-repeating character index - Goldman Sachs (nan)
  • Count segments and optimize 3-server assignment - Goldman Sachs (medium)
  • Complete decision tree and gradient descent functions - Goldman Sachs (hard)
Goldman Sachs logo
Goldman Sachs
Dec 9, 2025, 12:00 AM
Software Engineer
Technical Screen
Coding & Algorithms
10
0

Coding questions (solve both)

1) First non-repeating character

Given a string s, return the first character that appears exactly once in the string.

  • If no such character exists, return an empty value (e.g., "" ) or a special marker such as None / null .

Input: s (string)

Output: the first non-repeating character (or empty marker)

Constraints (typical):

  • 1 <= len(s) <= 10^5
  • s may contain letters (assume ASCII unless stated otherwise)

2) Best average score

You are given a list of score records. Each record contains a name (string) and a score (integer).

Return the highest average score among all names.

  • A person may appear multiple times; their average is the mean of their scores.
  • You may assume each person has at least one score.
  • Specify how you handle rounding (e.g., return a floating-point number, or return an exact rational/decimal).

Input: records = [(name1, score1), (name2, score2), ...]

Output: the maximum average across names

Constraints (typical):

  • 1 <= len(records) <= 10^5
  • score can be negative or positive (state assumption if you restrict it)

Comments (0)

Sign in to leave a comment

Loading comments...

Browse More Questions

More Coding & Algorithms•More Goldman Sachs•More Software Engineer•Goldman Sachs Software Engineer•Goldman Sachs 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.