FastPrepBest Graphics Card
Problems/Best Graphics Card

Best Graphics Card

NVIDIA logoNVIDIA● MediumFULLTIMEOA

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: Reported in an NVIDIA online assessment for a full-time role. The report leaves open how several models are parsed and what the input limits are. We filled those in.

Our version is about 95% the same as the reported question.

You are given graphics-card description lines. Return every line with the best performance, preserving the original text and input order. Duplicate best lines must also be returned.

A nonblank line ends with @ frequency MHz, using one ASCII space at each shown space. The frequency is a positive decimal integer with no leading zero. Its digits may be much longer than a fixed-width integer can hold.

Before that ending, words contain printable ASCII characters with codes from 33 through 126 and are separated by one ASCII space. They describe a nonempty brand, a model, an optional Ti token, and an optional suffix. A model is a whole four-digit word matching [1-9]0[1-9]0. The brand and suffix may contain model-looking words.

For this exercise, assume that when several whole model words fit a line, the rightmost one is the model, with at least one brand word before it. Treat Ti as a modifier only when it is the next whole word after that model, separated by one space. Thus 3080 Ti is a Ti model, while 3080 Titanium is not. Other words belong to the brand or suffix. Use the last @ separator to find the frequency ending.

Compare cards by these rules, in order:

  1. A larger model number wins.
  2. For the same model number, a Ti card wins over a non-Ti card.
  3. For the same model number and Ti status, a larger numeric frequency wins.

Ignore blank lines consisting only of ASCII spaces. For this exercise, assume an input with no nonblank card line returns an empty array. Return the original strings for all cards tied for the best rank.

Function

bestGraphicsCards(lines: String[]) → String[]

Examples

Example 1

lines = ["NVIDIA GeForce RTX 4090 Founders Edition @ 2520 MHz","NVIDIA GeForce RTX 4090 Founders Edition Rev. 2 @ 2520 MHz","NVIDIA GeForce RTX 4080 Founders Edition @ 2505 MHz","NVIDIA GeForce RTX 4070 Founders Edition @ 2475 MHz","NVIDIA GeForce RTX 4060 Ti Founders Edition @ 2535 MHz"]return = ["NVIDIA GeForce RTX 4090 Founders Edition @ 2520 MHz","NVIDIA GeForce RTX 4090 Founders Edition Rev. 2 @ 2520 MHz"]

Both 4090 cards have frequency 2520 and tie for first. Every lower model number loses, including the 4060 Ti at frequency 2535. Keep the two winning lines in their input order.

Example 2

lines = ["My 3080 Ti Is Excellent @ 1000 MHz","RTX 9999 RTX 2080 Ti RTX @ 1000 MHz","Ti Ti Ti 3080 (?) Ti Ti Ti Ti @ 1000 MHz","Happy Hacking 3080 Ti @ 1000 MHz"]return = ["My 3080 Ti Is Excellent @ 1000 MHz","Happy Hacking 3080 Ti @ 1000 MHz"]

The model numbers are 3080, 2080, 3080, and 3080. The first and last cards are Ti models at frequency 1000. The third card has no Ti modifier: its next word is (?), so later Ti words are only suffix text. The two 3080 Ti lines win.

Example 3

lines = ["Brand 4090 Note 3080 Ti @ 9 MHz","Brand 3080 Ti @ 10 MHz"]return = ["Brand 3080 Ti @ 10 MHz"]

The rightmost whole model word in the first line is 3080. Both cards are 3080 Ti models, and frequency 10 beats 9.

Constraints

  • For this exercise, assume 0 <= lines.length <= 10000.
  • For this exercise, assume each line has at most 200000 characters and the total length of all lines is at most 200000.
  • Every character has ASCII code from 32 through 126.
  • Each nonblank line follows the format and contains at least one model word with a nonempty brand before it.
  • Model words match [1-9]0[1-9]0; frequency strings match [1-9][0-9]*.

More NVIDIA Online Assessment questions

  • 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
  • Generate Bit MaskOA · Seen Oct 2026
  • Reconstruct an Array from Prefix XOROA · Seen Oct 2026
  • Sum of Subarray MinimumsOA · Seen Oct 2026
  • Unique Integers That Sum to ZeroOA · Seen Oct 2026

Similar questions at other companies

  • Count Proper Prefix MatchesAT&T · OAAT&T interview questions
  • Decode Words with Anagram KeysCresta · OACresta interview questions
  • String Permutations in Custom Character OrderWex · OA · PHONE SCREEN
  • Longest String ChainVisa · OAVisa interview questions
  • Maximize Workday EarningsCitadel · OA · PHONE SCREEN · ONSITE INTERVIEWCitadel interview questions
  • Return Exact Cash Register ChangeBank of America · OABank of America interview questions
  • Largest Binary Number by ConcatenationAdobe · OAAdobe interview questions
  • Minimum Edit-Distance String for Each QueryTarget · OA
  • Frequently Bought TogetherAmazon · OA
  • Largest File in a Long ListingIntuit · OAIntuit interview questions

Interview reports that mention this question

  • NVIDIA OA: What It Tests (2026)

NVIDIA interview experiences

  • NVIDIA Full-Time SWE Onsite Scheduling: 1 Experience
  • NVIDIA DevOps, QA and Infra Intern Interviews: 12 Experiences
  • NVIDIA Ignite Internship OA Experience
  • NVIDIA Software Intern Interview Questions: 9 Experiences
  • NVIDIA Ignite SWE Intern OA Questions: 6 Experiences
All NVIDIA interview questionsSee NVIDIA hiring insights
Saved
class Solution {
    public String[] bestGraphicsCards(String[] lines) {
        // Return every best line in input order.
    }
}
Checking account…