Question bank › Recursion
Dsa Recursion Hard

Hexadecimal Decoder

Write a program that decodes a hexadecimal string into its decimal value using a recursive method. The hexadecimal string may contain uppercase and lowercase letters (A-F, a-f) and numbers (0-9). The string will not contain any spaces and will always be a valid hexadecimal number. Input format: - A single line containing a hexadecimal string. Output format: - A single integer value representing the decimal equivalent of the hexadecimal string. Example: Input: 1A3F Output: 671

Key concepts

recursionstring manipulationbase conversion

Practise this out loud — free

Start a mock interview on THIS exact question — a voice AI interviewer opens with it, pushes back like a real onsite, then hands you an instant scorecard.

🎙 Practise this question now
Part of InterviewLab's verified interview question bank. We show the prompt and concepts to practise with — never a copy-paste solution.