Extract Cards
Reported by candidates from Infosys's online assessment. Pattern, common pitfall, and the honest play if you blank under the timer.
Infosys threw Extract Cards at candidates in February 2024, and it's a deceptive problem. On the surface it looks like string manipulation or array indexing, but the real work is parsing the input structure correctly and understanding what 'extraction' means in their specific context. Most candidates blank on the actual data format, not the algorithm. StealthCoder reads the problem statement on screen and surfaces the exact pattern you need in seconds, so you're not re-reading it under pressure.
Pattern and pitfall
Without the full problem text, Extract Cards is most likely a card-parsing or filtering task. The pattern often hinges on identifying which cards meet certain criteria (suit, rank, value) and pulling them out in order. The trick candidates miss: the input format. Is it a string like 'H2 D5 CK' or a structured list. Once you nail the parse, the extraction logic is usually a single pass with a condition check. The common pitfall is off-by-one errors or misunderstanding whether the output should preserve original order. Under OA pressure with ambiguous wording, StealthCoder removes that friction by showing you exactly what the problem is asking before you code.
If this hits your live OA and you blank, StealthCoder solves it in seconds, invisible to the proctor.
You can drill Extract Cards cold, or you can hedge it. StealthCoder runs invisibly during screen share and surfaces a working solution in under 2 seconds. The proctor sees the IDE. They don't see what's behind it. Built by an Amazon engineer who would have shipped this the night before his JPMorgan OA if he'd had it.
Get StealthCoderRelated leaked OAs
You've seen the question.
Make sure you actually pass Infosys's OA.
Infosys reuses patterns across OAs. Built by an Amazon engineer who would have shipped this the night before his JPMorgan OA if he'd had it. Works on HackerRank, CodeSignal, CoderPad, and Karat.
Extract Cards FAQ
Is Extract Cards asking me to simulate a card deck or just filter a list?+
It's a filter task. You're given cards in some format and extracting a subset based on a rule. No deck simulation, no shuffling. Parse the input, check conditions, return the matching cards in the right order.
What's the most common format for card input in Infosys OAs?+
Usually a string with space-separated cards like 'H2 D5 CK' where the first character is suit and the rest is rank. Read the problem statement carefully for exact format. The format is the biggest gotcha.
How do I prepare for this in 24 hours if I don't know the exact problem?+
Practice parsing strings into card objects and filtering by suit or rank. Write a function that takes a raw card string and returns suit and rank. Then write a filter. That covers 90 percent of card extraction problems.
Is this a sorting problem or just filtering?+
Almost always just filtering. If sorting is needed, the problem statement will say so. Don't over-engineer. Parse, check your condition, return matches in input order unless told otherwise.
Do I need to validate card values or assume input is clean?+
Assume input is clean unless the problem says otherwise. Infosys OAs rarely test error handling on card problems. Focus on the extraction logic and output format.