In the 42 curriculum, exams are milestones that unlock higher-level projects.
stdio.h functions unless you write them yourself).printf, malloc, or any standard library functions unless you write your own versions from scratch..c file via a system called grademe.For the malloc exercises (Level 2+), the grading script checks for memory leaks.
malloc needs a free.malloc a string and return it, the caller (the grader) handles the free, but if you allocate temp memory inside your function, you must free it before returning.Before diving into GitHub repositories, let’s define the beast.
In the 42 curriculum, exams are progressive. Rank 00 and 01 are relatively gentle introductions. Rank 02 is where the difficulty spikes significantly. The exam typically covers: exam rank 02 github
strlen, strcpy, strdup).ft_lstnew, ft_lstadd_back, ft_lstmap).malloc and free.get_next_line (the infamous function to read a file descriptor line by line) and ft_printf (recreating the standard printf).The exam uses a grading shell that tests your functions automatically. You are given 4–5 levels of exercises. Passing the exam usually requires completing enough exercises to reach a certain level (e.g., completing Level 3 or higher). The catch? If you fail a test, you go back to the beginning of that level.
Print this checklist out. One day before the exam, verify:
tmp nodes, not null-terminating strings, not handling malloc failures).fsanitize=address and valgrind (most GitHub testers include these flags).get_next_line with BUFFER_SIZE set to 1, 42, and 9999.ft_printf can handle at least %c, %s, %p, %d, %i, %u, %x, %X, and %%.README.md of my chosen repo entirely, including the troubleshooting section.Here lies the ethical dilemma. 42 has a strict -42 honor code. Copy-pasting code from GitHub during the exam is a surefire way to get expelled. The exam terminals are monitored, and the automatic grader detects plagiarism. Level Required: Usually Level 3 or 4
So, how do you use these resources legitimately?
Before diving into the GitHub ecosystem, let’s break down the exam itself.
Exam Rank 02 is the second of five ranked exams in the 42 common core curriculum. It tests your ability to write small-to-medium C functions and programs — from string manipulation to linked lists — under strict time pressure (usually 4 hours). Unlike school projects, no external code is allowed. No internet. No man pages (except for authorized functions). Just you, a terminal, and a handful of randomly drawn exercises. Create issues for each weak topic
The twist? You’re judged entirely by an automated system. One wrong memory allocation, one forgotten '\0', and you fail the exercise. Passing requires near-perfect command of C fundamentals and a calm, methodical mindset.
Search on GitHub with these queries:
"exam rank 02" 42
or
"rank 02" exam 42
Some popular repos:
Also check the 42 Born2Code or 42-Cursus repositories.