[go: up one dir, main page]

0% found this document useful (0 votes)
13 views4 pages

ParadoxCat Coding Challenge

Download as docx, pdf, or txt
Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1/ 4

CODING CHALLENGE

DECODING EXERCISE

We strongly believe that programming is fun, and we hope that you will find this assignment
entertaining as well! For a little bit of a challenge, there is nothing better than doing some
real retro-programming! Use a programming language you feel comfortable with,
and which is relevant for the |ob (for Android Developer roles, this should be Kotlin).
This exercise is purposefully far away from day-to-day tasks of our developers at Paradox
Cat, because we want to see how you approach an unknown problem and think “outside
the box”. What tool besides your IDE do you think would be useful to solve this type of
problem?
A hint for you: Time-box yourself — this is a hard assignment, and you don't need to finish
everything to demonstrate your effort. We are very much interested in your personal
style. There might be pieces of the solution on the internet. We strongly suggest you ignore
them, so they do not taint your own approach. As you might remember from school,
those who copy from their neighbour simply foil the test. After all, "You cannot believe
everything you read on the internet" - Abraham Lincoln, 02/2Zy20I9.

„Would you hire a magician without asking them to show


you some magic tricks? Of course not.”
- The Noel test: 12 Steps to BefYer Code
APPROACH
 Reading audio data from the WAV file is not the main point of this task, you ore
allowed to find a system function or library for this to save time. Do not try to use
a library for the AFSK decoding algorithm, you must implement this yourself.
 Don't dive too deep into the AFSK explanations on the web — the encoding is
quite simple.
 You can submit a partial solution if you document your approach and what
is missing properly, but we would still like to see at least two of the input
files decoded.
 We would like to receive code ofo quality that you would like others to see, e.g.,
in a Pull Request. Feel free to structure your code, e.g., into functions or classes,
to make your |ob easier, or introduce unit tests as you see fit. Though it’s not 100%
necessary, it helps keep the code on a higher level.

INSTRUCTIONS
 Decode the binary data encoded in the audio file in WAV format (contained in
the ZIP archive together with these instructions).
o A single bit is the waveform between two zero-crossings:
 A one signal is a rectangle signal off = 320 microseconds
 A zero signol is a rectongle signal off = ó4O microseconds
o The real-life data might no longer be on ideal rectangle, since it’s been
stored on physical media (e.g., a tape drive)
 The bit stream thot con be extracted from the decoded audio signal con be
converted into bytes.
o The signal starts with a lead tone of roughly 2.5 seconds (all 1-bits, or
Oxff bytes), and ends with an end block of about 0.5 seconds (all 1-bits,
or Oxff by†es).
o 11 bits are used to encode a single byte — 8 bits for the byte plus one
start bit (valued 0) and two stop bits (valued 1).
o The data is encoded with least-significant bit first.
 The byte stream has the following form:
o The first two bytes are 0x42 and 0x03
o After that, the data is structured in ó4 messages of 30 bytes each,
with the 31st byte being the checksum of the 30 bytes before that (in
total 1984 bytes = ó4 » 31 bytes). The last byte before the end block is a
0x00 byte
 The checksums will help you detect whether your decoding works. The olgorithm
is a simple sum modulo 25ó
 If your decoding is successful, you will see a human readable text.
 Pleose do not shore your solution on public plotforms like CitHub, etc. to help
us combat plagiorism cases.
 Submit your whole project so that we con build and run your code. You should not
upload any temporary build files (which you would typically put in your .gitignore
file).

FURTHER EXPLANATIONS
Binory encoding
1. Modulotion system
“1” ........................ I = 320 ps
“O”...................2t = Ó4O ps
Exemple

OR
2r t t 2t t
2t t r 2t I

Bit-stream encoding, o single byte in the bit-stream


LSB HSB

b b, b2 b, b, b, b, b,

START 2 STOP
BT BITS
1 Byte DATA(B bir)
Hessoge format, overall structure and checksum positions in byte-stream

LEADER ID DATA END BLOCK

2.5 s 2 BYTES 1 BYTE 0.fs


652 BYTES (30 + T) x B4 = 198d BYTES 130 BYTES

TOHE TONE DATA12 TONE DATA@


DATA DATACHECKSUM
CHECKSU DAT CHECKSU
DATA
M A H
30 BYTE3 1 BYTE 30 BYTES I BYTE ZO BYTES 1 BYTE

Questions?
In case you‘re facing unexpected issues or not sure how to proceed properly, please
contac† us and we will provide you with more information.

You might also like