Test AP Computer Science Principles
- 15 questions
- Environ 15 min
- Gratuit
Les questions du test restent en anglais.
A student's program that averages three test scores runs without any error message, but it always reports an average that is too high. The code adds the three scores and divides by 2 instead of 3. What kind of error is this?
Tu révises avec tes propres notes ? Créer mon propre test
Continue à t'entraîner
- Test d'entraînementTest AP Statistics : unités 1 à 515 questions
- Test d'entraînementTest AP Precalculus : unités 1 à 315 questions
- Test d'entraînementTest d'entraînement APUSH : périodes 1 à 915 questions
- Test d'entraînementTest d'entraînement AP Psychology15 questions
- Tous les quiz en Lycée et admission46 quiz
- Voir tous les quiz d'entraînement gratuits
À propos de ce test
Voici un échantillon gratuit de 15 questions dans le style de la section à choix multiple d'AP Computer Science Principles, rédigé par l'équipe StudyPDF à partir des cinq Big Ideas (grandes idées) que le College Board publie pour le cours. Il couvre le développement créatif, les données, les algorithmes et la programmation en pseudocode de style examen, les systèmes informatiques et les réseaux, et l'impact de l'informatique, à peu près dans les proportions de l'examen. Tu y trouveras du choix multiple, des réponses multiples et des textes à trous. Réponds aux 15 questions, puis regarde ton score et lis l'explication de chaque question.
Les 15 questions en un coup d'œil
Tu préfères lire avant de jouer ? Toutes les questions de l'échantillon sont listées ci-dessous. Les réponses et les explications restent repliées tant que tu ne les ouvres pas.
1.A student's program that averages three test scores runs without any error message, but it always reports an average that is too high. The code adds the three scores and divides by 2 instead of 3. What kind of error is this?
- A. Syntax error
- B. Logic error
- C. Overflow error
- D. Run-time error
Réponse : B. Logic error
A logic error is a mistake in the algorithm: the program runs and produces a result, but the result is wrong. A syntax error breaks the rules of the language, so the program will not run at all. A run-time error stops the program while it is running, for example by dividing by zero, and an overflow error happens when a value is too large for the number of bits the computer uses to store it. Logic errors are the hardest to find because nothing crashes, which is why testing with inputs whose answer you already know matters.
2.Which practices are part of an iterative, collaborative way to develop a program?
Coche toutes les bonnes réponses.
- A. Building a small working version, testing it with users and revising it
- B. Having teammates review each other's code to catch errors and bring different perspectives
- C. Writing the whole program before running it even once, so nothing half-finished confuses the team
- D. Writing comments and documentation that explain what a code segment is for
- E. Keeping the design secret from users until the final version is done
Réponse : A. Building a small working version, testing it with users and revising it, B. Having teammates review each other's code to catch errors and bring different perspectives, D. Writing comments and documentation that explain what a code segment is for
Iterative development means building, testing and refining in small steps, so mistakes show up early and feedback shapes the next version. Collaboration brings in other viewpoints, and people with different backgrounds notice different problems and needs. Documentation helps teammates, and your future self, understand what code was meant to do. Writing everything before the first run lets errors pile up, and hiding the design from users removes the feedback the process depends on.
3.Complete the sentence.
In binary, the number 1011 equals _____ in decimal, and a sequence of 8 bits can represent _____ different values.
Options pour le trou 1 : 9, 11, 13, 15
Options pour le trou 2 : 16, 128, 255, 256
Réponse : 11, 256
Each binary place is worth twice the one to its right: 8, 4, 2, 1. So 1011 is 8 + 0 + 2 + 1 = 11. With n bits there are 2 to the power n different patterns, and 2^8 = 256, so 8 bits can represent 256 different values, from 0 through 255. The 255 option is the largest number that fits in 8 bits, not the count of values, and that off-by-one is a classic trap.
4.A museum is compressing scans of old documents and must be able to rebuild every original pixel exactly. Which approach should it use?
- A. Lossless compression
- B. Lossy compression with the quality set to high
- C. Lossy compression after deleting every second row of pixels
- D. Any compression, since a rebuilt file always matches the original
Réponse : A. Lossless compression
Lossless compression reduces file size in a way that lets the original data be reconstructed exactly, which is what an archive needs. Lossy compression gets smaller files by throwing information away for good, and even at high quality the original cannot be rebuilt. Lossy is a sensible trade for streaming video or casual photos, where small differences are hard to see. The cost of lossless is that files stay larger.
5.A phone photo file includes the date, the GPS location and the camera model along with the image itself. Which statement is correct?
- A. Metadata is the part of the image that is lost when the photo is compressed
- B. Metadata can only be created by the person who views the file
- C. Metadata changes the pixels of the image every time the photo is copied
- D. Metadata is data about other data, and it can reveal private details even if you only share the photo
Réponse : D. Metadata is data about other data, and it can reveal private details even if you only share the photo
Metadata describes a piece of data without being the data itself: when a photo was taken, where, with what device. It helps people organize and search large collections, and it can be changed or deleted without changing the image. It can also expose things the sender never meant to share, such as a home location, so many apps remove it on upload. Metadata is not lost by compression and does not alter the pixels.
6.total ← 0. FOR EACH item IN [3, 8, 12, 5, 10], IF (item MOD 2 = 0), then total ← total + item. After the loop, DISPLAY(total). What is displayed?
- A. 8
- B. 10
- C. 30
- D. 38
Réponse : C. 30
item MOD 2 is the remainder when item is divided by 2, so the test is true only for even numbers. The even items are 8, 12 and 10, and 8 + 12 + 10 = 30. The 38 answer adds every item, as if the test were missing, and 8 is the sum of the odd items, 3 + 5. When you trace a loop, write the value of total after each pass, so the one skipped odd number is easy to see.
7.nums ← [4, 8, 15, 16]. Then INSERT(nums, 2, 23), REMOVE(nums, 1) and APPEND(nums, 42) run in that order. List positions start at 1. What does DISPLAY(nums[3]) show?
- A. 8
- B. 15
- C. 16
- D. 23
Réponse : B. 15
Trace the list after each step. Start with [4, 8, 15, 16]. INSERT at position 2 puts 23 there and shifts the rest right: [4, 23, 8, 15, 16]. REMOVE position 1 deletes the 4: [23, 8, 15, 16]. APPEND adds 42 at the end: [23, 8, 15, 16, 42]. Position 3 holds 15. The 8 answer comes from forgetting that INSERT shifts items, and 16 comes from counting positions from 0 instead of 1.
8.Complete the sentence.
Suppose p is true and q is false. Then p AND (NOT q) evaluates to _____, and NOT (p OR q) evaluates to _____.
Options pour le trou 1 : true, false
Options pour le trou 2 : true, false
Réponse : true, false
Work from the inside out. NOT q is true because q is false, so p AND (NOT q) is true AND true, which is true. For the second one, p OR q is true OR false, which is true, and NOT true is false. AND is true only when both sides are true, OR is true when at least one side is, and NOT flips the value. Writing each sub-result on its own line prevents most mistakes.
9.Which statements about algorithms are true?
Coche toutes les bonnes réponses.
- A. Every algorithm can be built from sequencing, selection and iteration
- B. A faster computer can make any undecidable problem solvable
- C. Two different algorithms can solve the same problem while using very different numbers of steps
- D. A heuristic can be used when finding the best solution would take an unreasonable amount of time
- E. An algorithm whose steps double with every added input is the best choice for very large inputs
Réponse : A. Every algorithm can be built from sequencing, selection and iteration, C. Two different algorithms can solve the same problem while using very different numbers of steps, D. A heuristic can be used when finding the best solution would take an unreasonable amount of time
Sequencing, selection and iteration are enough to express any algorithm. Different algorithms for one problem can differ hugely in efficiency, which is why comparing step counts matters. A heuristic gives a good-enough answer in reasonable time when the exact answer is out of reach. An undecidable problem has no algorithm that works for every input, however fast the machine, and a step count that doubles with each added input quickly becomes unusable, since it is not a reasonable-time algorithm.
10.A city engineer uses a computer simulation of rush-hour traffic to test new traffic light timing before changing the real intersection. Which statement about the simulation is accurate?
- A. It is always more reliable than watching the real intersection, because a simulation never leaves anything out
- B. It cannot be used until the real intersection has been rebuilt
- C. It removes the need for any data about real traffic
- D. It lets the city test changes without cost or risk, but the results depend on what the model left out
Réponse : D. It lets the city test changes without cost or risk, but the results depend on what the model left out
A simulation is an abstraction: it keeps the details that matter for the question and leaves the rest out. That makes it cheap and safe to try ideas, such as many timings in an afternoon, which would be impractical on a real street. The limit is that the results are only as good as the model and the data behind it, so a factor left out, such as a road closure, can make the real outcome differ. That is why simulation results are checked against real observations.
11.A school network connects each building to at least two others, so students can still reach the Internet if one cable is cut. Which statement best describes this design?
- A. It is fault tolerant, because redundant paths keep the network working after a failure
- B. It has higher bandwidth, because each cable carries more data
- C. It has lower latency, because messages always take the shortest path
- D. It is encrypted, because messages cannot be read in transit
Réponse : A. It is fault tolerant, because redundant paths keep the network working after a failure
The Internet is built to be fault tolerant: there are usually several paths between two points, so routing can send data around a broken link. Extra connections do not by themselves raise bandwidth, which is how much data can move per second, and an alternate path can even be longer. Encryption is about privacy, not about surviving a failure. Redundancy is the key word for this kind of question.
12.Complete the sentence.
The Domain Name System (DNS) looks up a _____ such as example.org and returns the matching _____, which routers use to deliver packets.
Options pour le trou 1 : packet, domain name, protocol, password
Options pour le trou 2 : IP address, bit rate, file format, encryption key
Réponse : domain name, IP address
People use names such as example.org because they are easy to remember, but routers move data by IP address. DNS is the lookup service that translates a domain name into the IP address of the server. Without it you would have to type numbers to visit a site. A packet is a small chunk of data that travels the Internet, and a protocol is an agreed set of rules, such as TCP and IP.
13.A company trains a program to screen job applications using the records of people it hired over the past 20 years, most of whom came from a few similar backgrounds. Which concern is most likely?
- A. The program will be fair, because computers cannot have bias
- B. The program cannot run, because applications are not binary data
- C. The program may repeat the pattern in the old hiring data, which is a form of computing bias
- D. The program will only improve if the old records are deleted after training
Réponse : C. The program may repeat the pattern in the old hiring data, which is a form of computing bias
Computing bias can come from the data a program learns from or from choices its designers make. A model trained on past decisions can copy their patterns, including unfair ones, and it can do so at scale and with an air of objectivity. Computers do not make bias impossible, and all digital data, including text, is stored in binary. Reducing bias takes steps such as checking results across groups and using more representative data, not deleting records.
14.Which actions help protect an online account from being taken over?
Coche toutes les bonnes réponses.
- A. Turning on multifactor authentication
- B. Reusing one strong password on every site so it is easy to remember
- C. Treating a message that asks you to log in through a link with suspicion, since phishing tries to trick you into giving up your login
- D. Using a different, long password for each account, ideally with a password manager
- E. Sharing the one-time login code with anyone who says they work for support
Réponse : A. Turning on multifactor authentication, C. Treating a message that asks you to log in through a link with suspicion, since phishing tries to trick you into giving up your login, D. Using a different, long password for each account, ideally with a password manager
Multifactor authentication requires a second proof besides the password, so a stolen password alone is not enough. Phishing is an attempt to trick people into entering credentials on a fake page, so going to the site directly beats clicking a link in a message. Unique passwords limit the damage if one site is breached, and a password manager makes them practical. Reusing a password lets one breach open many accounts, and a one-time code is meant for you alone, so no legitimate support team asks for it.
15.Maria publishes her public key. Devon wants to send her a message that only she can read, using public-key encryption. Which key does Devon use to encrypt it?
- A. Devon's private key
- B. Devon's public key
- C. Maria's private key
- D. Maria's public key
Réponse : D. Maria's public key
In public-key encryption each person has a pair of keys. Anyone can use Maria's public key to encrypt a message to her, but only her private key can decrypt it, so only she can read it. Devon's own keys are not involved in this direction. The private key must never be shared, which is the whole point of the pair. Public keys are what let a browser start a secure connection with a site it has never met.
À quoi ressemble l'examen AP CSP et comment les Big Ideas sont pondérées
L'examen AP Computer Science Principles est noté de 1 à 5 et comporte deux parties. Selon le College Board, l'examen de fin de cours est entièrement numérique, dans l'application Bluebook. La section I compte 70 questions à choix multiple en 120 minutes et vaut 70 pour cent de ta note, avec quatre options de réponse chacune : 57 sont à réponse unique, 5 sont à réponse unique et s'appuient sur un texte consacré à une innovation informatique, et 8 sont à réponses multiples, où tu choisis 2 réponses. La section II vaut les 30 pour cent restants. Elle associe la Create performance task (la tâche pratique Create) à 2 questions à réponse rédigée, soit 4 consignes en tout, auxquelles tu réponds pendant une partie de 60 minutes le jour de l'examen et qui portent sur ton propre programme.
Le College Board découpe le cours en cinq Big Ideas et publie la part de la note de l'examen que chacune représente. Algorithmes et programmation pèse le plus, avec 30 à 35 pour cent. L'impact de l'informatique représente 21 à 26 pour cent, les données 17 à 22 pour cent, les systèmes informatiques et les réseaux 11 à 15 pour cent, et le développement créatif 10 à 13 pour cent. Environ un tiers de l'examen porte donc sur les algorithmes et la programmation, en grande partie de la lecture et du traçage de code, et environ un quart sur l'impact de l'informatique sur les gens, la partie que les élèves laissent le plus souvent pour la fin.
Le College Board fixe l'examen 2027 au vendredi 14 mai, en Session 1, et la Create performance task doit être remise comme version finale dans l'AP Digital Portfolio avant vendredi 30 avril à 23 h 59, heure de l'Est. Les dates changent d'une année à l'autre, alors consulte la page du College Board pour ton année d'examen. Ce que vaut une note dépend de chaque université, alors renseigne-toi sur la politique des établissements qui t'intéressent.
Comment utiliser cet échantillon, et ce qu'il laisse de côté
Les 15 questions se répartissent entre les Big Ideas à peu près dans les mêmes proportions que l'examen : cinq sur les algorithmes et la programmation, trois sur les données, trois sur l'impact de l'informatique, deux sur les systèmes informatiques et les réseaux et deux sur le développement créatif. Elles demandent le raisonnement derrière une réponse plus qu'un terme appris par cœur : pourquoi un programme qui tourne peut quand même être faux, pourquoi la compression sans perte est le bon outil quand chaque pixel compte, pourquoi une simulation est utile tout en restant limitée, pourquoi un modèle entraîné sur d'anciennes données peut reproduire d'anciennes injustices.
Les questions de code utilisent du pseudocode en texte brut, dans le style de l'examen. Une flèche veut dire affecter : x ← 3 range 3 dans x. Les listes commencent à la position 1, pas à 0, et MOD donne le reste d'une division. L'examen a son propre pseudocode, ce n'est ni du Python ni du Java, tu peux donc t'y entraîner même si ta classe travaille dans un autre langage. Fais-le d'une traite avec du brouillon, trace chaque programme en notant la valeur de chaque variable après chaque ligne, puis lis l'explication de chaque question, y compris celles que tu as réussies.
Cet échantillon ne t'entraîne pas à la Create performance task. C'est le programme que tu construis en classe pendant environ 9 heures, avec le code, une courte vidéo qui le montre en marche et un Personalized Project Reference (document de référence de ton projet), et tes réponses écrites le jour de l'examen portent sur ce même programme. Travaille-la avec ton enseignant et les documents pour élèves du College Board, et prends les questions d'ici comme un entraînement à la section à choix multiple seulement. Les questions sont originales et écrites d'après le plan de cours publié. Ce ne sont pas des questions d'examen publiées.
Comment StudyPDF crée des tests AP CSP à partir de tes notes de cours
Quinze questions peuvent te montrer quelle Big Idea est fragile. Elles ne suffisent pas à te préparer, et une banque générique correspond rarement au vocabulaire, aux exemples et au pseudocode que ton enseignant utilise vraiment.
StudyPDF part plutôt de ton matériel. Importe tes notes de cours, les diapos de ton enseignant, une série d'exercices corrigés ou ton dossier de révision, appuie sur Nouveau contenu, et StudyPDF crée des tests d'entraînement à partir de ces pages précises. Chaque question s'appuie sur ton matériel et chaque explication indique d'où vient la réponse, tu peux donc retourner directement à la page quand une étape ne te parle pas.
Tu n'as rien à importer pour commencer. Nomme plutôt un thème, par exemple Internet et le DNS, ou les listes et l'itération, et Bo le prépare avec ses concepts clés pour que tu puisses créer des quiz et des cartes mémo dessus. Tes résultats suivent les concepts que tu rates sans arrêt, et le prochain test d'entraînement peut les cibler. Commencer est gratuit.
Rédigé par l'équipe StudyPDF. Mis à jour le 19 août 2026.
Bon à savoir
Ce test AP Computer Science Principles est-il vraiment gratuit ?
Oui. Les 15 questions, l'écran de score et chaque explication sont gratuits à jouer dans ton navigateur, et il n'y a aucun mur payant sur cette page.
Comment l'examen AP CSP est-il structuré ?
Selon le College Board, la section I compte 70 questions à choix multiple en 120 minutes et vaut 70 pour cent de ta note. La section II vaut 30 pour cent et associe la Create performance task, que tu construis en classe pendant environ 9 heures, à 2 questions à réponse rédigée pendant une partie de 60 minutes le jour de l'examen. L'examen se passe dans l'application Bluebook. Consulte la page du College Board pour la date actuelle de l'examen.
Qui a écrit ces questions, et couvrent-elles la tâche Create ?
L'équipe StudyPDF a rédigé chaque question et chaque explication à partir des Big Ideas que le College Board publie pour le cours. Ce ne sont pas des questions d'examen publiées et elles ne viennent de la banque d'aucun organisme de préparation. La Create performance task n'est pas travaillée ici, puisque c'est un programme que tu construis toi-même. StudyPDF n'est pas affilié au College Board, et AP est une marque du College Board.
Puis-je avoir plus de questions comme celles-ci à partir de mes propres notes de cours ?
Oui. Importe tes notes de cours, tes diapos ou ton dossier de révision dans StudyPDF, et Bo crée des tests d'entraînement complets à partir de ces pages précises, avec des explications qui citent l'origine de chaque réponse. Si tu n'as qu'un exemplaire papier, nomme plutôt un thème, par exemple les listes et l'itération, et Bo écrit un test dessus.
Il te faut plus qu'un échantillon ?
Importe ton propre manuel, tes diapos ou tes notes et Bo crée des tests d'entraînement complets à partir de tes documents, suit les concepts que tu rates et cible tes points faibles. Commence gratuitement.
