DSA Studio
Search
Home
Sign in
Module 8: Capstone Parser Quiz
Test your understanding of building a production ISO8583 parser
1. Your parser receives input that starts with '30313030'. How can you tell if this is a hex string representation of '0100' or actual binary data?
Check if all characters are valid hex digits (0-9, A-F)
Check if the length is divisible by 2
Both of the above, plus verify it decodes to valid ISO8583
You can't tell - always require the user to specify
2. You're parsing a message and the first 16 bytes after the MTI are '723A448108E18000'. What encoding is this bitmap using?
Binary - these are raw bitmap bytes
Hex-ASCII - these are printable hex characters representing the bitmap
BCD - each nibble is a bitmap value
Cannot determine without knowing the network
3. Your parser finds DE2 = '4532101234567890' (16 digits). What should the pretty-printer output?
4532101234567890 (show full PAN)
453210******7890 (mask middle digits)
[REDACTED] (never show any part)
4532-1012-3456-7890 (add dashes)
4. You're parsing a LLVAR field and read '16' as the length prefix. The next bytes are '54321012345678901234'. What's wrong?
Nothing - read 16 bytes as the value
The length prefix should be BCD, not ASCII
The data is 20 bytes but length says 16 - possible corruption
LLVAR can only have 2-digit lengths
5. Your parser encounters field 52 (PIN Data). What's the correct way to handle and display it?
Decode as ASCII and display the PIN
Keep as binary, display hex representation
Keep as binary, display '[ENCRYPTED PIN DATA]' - never show actual bytes
Skip it entirely - PIN data shouldn't be in messages
6. Your parser is processing a message but runs out of data halfway through field 35. What should happen?
Return an error and fail completely
Return what was successfully parsed, add a warning about truncation
Pad the field with zeros and continue
Assume the remaining fields aren't present
7. The bitmap indicates field 99 is present, but your spec doesn't have a definition for field 99. What should the parser do?
Fail with 'unknown field' error
Skip the field and add a warning
Try to detect the field format (LLVAR/LLLVAR) and parse anyway
Assume it's a fixed 10-byte field
8. When displaying DE4 (Amount) = '000000010000', what should the decoded output show?
000000010000 (raw value)
10000 (strip leading zeros)
100.00 (add decimal, last 2 are cents)
$100.00 (add currency symbol)
9. You're building a parser configuration. Why is it better to make parsing logic data-driven (specs in a map) rather than hard-coded?
It's faster at runtime
Adding support for a new network means adding a new spec, not changing parser code
It uses less memory
It's required by the ISO8583 specification
10. Your parser reads a bitmap byte as 0x72. Using the formula byte=(N-1)/8, bit=7-((N-1)%8), which fields in positions 1-8 are present?
Fields 1, 2, 3, 4
Fields 1, 2, 4, 6
Fields 2, 3, 5, 6, 7
Fields 1, 2, 5, 6, 7
11. When comparing a request (0100) with its response (0110), which fields would you expect to remain identical?
All fields - response is just a copy with added DE39
DE2, DE3, DE4, DE11, DE32 - key transaction identifiers
Only DE11 (STAN) - everything else can change
DE37, DE38, DE39 - these are the response fields
12. Your parser needs to handle both BCD and ASCII length prefixes. Given bytes '15' (0x31 0x35 in ASCII), how do you interpret the length?
Always 15 - same in both encodings
ASCII: 15, BCD: 0x15 = 21 decimal
ASCII: 15, BCD: 15 (read as hex literal)
Check spec.LengthEncoding to determine interpretation
13. When validating a 0400 (reversal) message, which field is specifically required that wouldn't be in a 0100 (auth)?
DE38 (Authorization Code)
DE39 (Response Code)
DE90 (Original Data Elements)
DE64 (MAC)
14. Your JSON output mode needs to represent DE55 (ICC Related Data). What's the best approach?
Output as a single hex string
Output as base64 encoded
Parse the EMV TLV tags and output as nested objects
Skip it - binary data doesn't belong in JSON
15. You're debugging why your parser gives different results than a colleague's. The input is identical. What's the most likely cause?
Different CPU architectures
Different message specification (field definitions)
Random variation in parsing
Time-of-day affects parsing
Submit quiz
Auto-advance on pass
Join Discord
×