1/49
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai | Chat |
|---|
No analytics yet
Send a link to your students to track their progress
Which keyword should you use by default for a value you will not reassign?
a) const b) let c) var d) static
a
Complete the arrow function so it adds two numbers: const add = (a, b) => \_\_\_\_;
a) a - b b) a + b c) a * b d) a / b
b
Complete the template literal so it prints "Score: 95%": `Sore: ${\_\_\_\_}%`
a) "score" b) value c) score d) ${score}
c
What does const {className, probability} = prediction; do?
a) Creates a new prediction object b) Adds className and probability to prediction c) Deletes className and probability from prediction d) Extracts className and probability from the prediction object
d
What is the DOM?
a) The browser's live, tree-structured representation of the HTML page b) A JavaScript library for making HTTP requests c) A data format for exchanging data between web apps d) A browser API for running machine learning models
a
Complete the code to select the first element with id "result": const out = document.\_\_\_\_('#result');
a) getElementById b) querySelector c) querySelectorAll d) selectElement
b
What is a Promise?
a) A function that executes immediately b) A callback function c) An object representing a value that will be available later d) A built-in browser API for HTTP requests
c
Why do we need await twice in the model-loading example?
a) Because one await is for syntax, the other is for runtime b) Because model.classify() requires two awaits c) Because both calls return Promises that must be resolved separately d) Because loading the model and running the model are two separate slow operations, each returning its own Promise
d
What does await response.json() do?
a) Parses JSON into a JavaScript object b) Sends JSON to the server c) Checks if the response is valid JSON d) Throws an error on a 404 response
a
What is Web AI?
a) A cloud-based AI service b) Running ML models directly in the browser using JavaScript c) A server-side AI framework d) A Python library for machine learning
b
Which library is maintained by Hugging Face for running pre-trained transformer models client-side?
a) TensorFlow.js b) MediaPipe Tasks c) Transformers.js d) ONNX Runtime Web
c
Which library is maintained by Microsoft for running models exported in the ONNX open format?
a) TensorFlow.js b) Transformers.js c) MediaPipe Tasks d) ONNX Runtime Web
d
Which library is best for ready-made, highly-optimized real-time perception like hands, faces, and gestures?
a) MediaPipe Tasks b) TensorFlow.js c) Transformers.js d) ONNX Runtime Web
a
Which library is best for training AND running models in JavaScript?
a) MediaPipe Tasks b) TensorFlow.js c) Transformers.js d) ONNX Runtime Web
b
What is a pre-trained model?
a) A model currently being trained b) A model with no weights c) A model already trained by someone else on a large dataset d) A model that must be trained before use
c
What is inference?
a) Creating a new model b) Adjusting a model's weights c) Collecting training data d) Running a trained model on new input to get a prediction
d
What is a backend in the context of Web AI?
a) The low-level technology a Web AI library uses to do its math b) A server that hosts AI models c) A JavaScript framework d) A database that stores predictions
a
Which backend repurposes the browser's 3D-graphics API to do matrix math on the GPU?
a) WASM b) WebGL c) CPU d) WebGPU
b
Which backend runs near-native-speed code on the CPU inside the browser sandbox?
a) WebGL b) WebGPU c) WASM d) CPU
c
Which backend is the modern browser GPU API, designed for compute rather than just graphics?
a) WebGL b) WASM c) CPU d) WebGPU
d
Complete the code to log the active backend: console.log(tf.\_\_\_\_());
a) getBackend b) backend c) activeBackend d) currentBackend
a
Why does on-device AI have a strong privacy advantage?
a) It encrypts all data b) Data never leaves the user's machine c) It uses a private server d) It deletes data after processing
b
Why can a webcam pose-detection game not be built on a cloud API alone?
a) Cloud APIs are too expensive b) Cloud APIs cannot process images c) The network delay (latency) makes real-time frame-by-frame processing unusable d) Cloud APIs are less accurate
c
Which architecture is free to operate and scales to any number of users at zero server cost?
a) Cloud AI b) Hybrid AI c) Server-based AI d) On-device AI
d
Complete the fetch code so it parses the response into a JavaScript object: const data = await response.\_\_\_\_();
a) json() b) parse() c) text() d) data()
a
What did the Fetch API replace?
a) The DOM b) AJAX/XMLHttpRequest c) WebGL d) Promises
b
Complete the code to select an element by its id: const img = document.\_\_\_\_('photo');
a) querySelector b) selectById c) getElementById d) getById
c
In the instructor's analogy, what does the backend represent?
a) The chef b) The recipe c) The restaurant d) The kitchen equipment
d
What is the difference between inference and training?
a) Inference runs a trained model on new input; training creates or adjusts the model b) Inference creates the model; training uses it c) Inference and training are the same thing d) Inference is done in the cloud; training is done on-device
a
What format are model files, API responses, and datasets in this course delivered as?
a) XML only b) JSON or binary alongside JSON metadata c) CSV only d) YAML
b
Which library is used for gesture and landmark detection in this course?
a) Transformers.js b) ONNX Runtime Web c) MediaPipe Tasks d) TensorFlow.js
c
Which library is used for sentiment analysis, summarization, and Whisper speech-to-text?
a) TensorFlow.js b) MediaPipe Tasks c) ONNX Runtime Web d) Transformers.js
d
Complete the destructuring so it extracts className and probability from a prediction: const \_\_\_\_ = prediction;
a) {className, probability} b) [className, probability] c) (className, probability) d) className, probability
a
What is the purpose of a model hub?
a) To train models b) To provide an online repository of shareable pre-trained models c) To deploy models to the cloud d) To convert models between formats
b
Why are the four Web AI libraries described as complementary, not competitors?
a) Because they all do the same thing b) Because they are all made by Google c) Because a professional picks per task: MediaPipe for perception, Transformers.js for language/speech, TensorFlow.js for custom training, ONNX Runtime for PyTorch models d) Because they are all free
c
Complete the code that logs the model's predictions to the console: console.log(\_\_\_\_);
a) model b) img c) classify d) predictions
d
Which frameworks can ONNX Runtime Web run models from?
a) Any framework that exports to the ONNX open format, such as PyTorch b) Only TensorFlow c) Only Keras d) Only scikit-learn
a
Why is WebGPU important for in-browser transformer models?
a) It reduces file size b) It makes in-browser transformer models practical because it's the fastest backend c) It replaces JavaScript d) It eliminates the need for a model
b
What does async/await do?
a) Makes code run faster b) Blocks the browser c) Pauses an async function until a Promise resolves, keeping code readable d) Prevents errors
c
Why might the same model be fast on one laptop and slow on another?
a) Because the model file size differs b) Because the HTML differs c) Because the browser version differs d) Because the backend chosen depends on the available hardware (GPU vs CPU)
d
Every AI library call in this course returns a Promise.
True
On-device AI requires a constant internet connection to run inference.
False
Arrow functions are heavily used as callbacks in AI code.
True
Model outputs are almost always objects, which is why destructuring appears constantly.
True
The Fetch API is a newer alternative to the DOM.
False
WebGL is the newest backend and makes transformer models practical.
False
Cloud AI provides access to frontier models like Claude, Gemini, and GPT that are too large for a browser.
True
On-device AI is limited by the user's device to small-to-medium models only.
True
Inference and training are the same operation.
False
Transformers.js is maintained by Google.
False