You start a Vertex AI Gemini Pro lab in Google Cloud. You open Cloud Shell and run gcloud auth list. The output shows only one account:
ACTIVE: *
ACCOUNT: student-01-xxxxxxxxxxxx@qwiklabs.net
What does this mean?
A. The project is not authenticated, and you must run gcloud auth login.
B. You are already authenticated with the student lab account.
C. You must manually set the PROJECT_ID using an environment variable.
D. The authentication is incomplete until you enable billing.
B
You are generating code using Vertex AI Studio. To ensure consistent results with Node.js code generation, which configuration should you verify before submitting your prompt?
A. That the model is set to gemini-1.5-pro
B. That Cloud Shell is set to the latest Node.js runtime
C. That prompt-sync is pre-installed in package.json
D. That gcloud CLI is authenticated with a service account
A
You want to prompt the user for loan details from the command line in Node.js. Gemini suggests using the prompt-sync library. What must you do to add it to your project?
A. Write the code const prompt = require(‘prompt-sync’)(); only
B. Add “prompt-sync”: “^4.2.0” manually to package.json
C. Run npm install prompt-sync in your project directory
D. Copy the dependency from another Node.js project
C
Gemini generates the following Node.js function:
function calculatePayments(amount, downPayment, interestRate, term) {
const monthlyInterestRate = interestRate / 100 / 12;
const principal = amount - downPayment;
const numberOfPayments = term * 12;
const monthlyPayment =
(principal * monthlyInterestRate * Math.pow(1 + monthlyInterestRate, numberOfPayments)) /
(Math.pow(1 + monthlyInterestRate, numberOfPayments) - 1);
return monthlyPayment;
}
If you input:
Loan amount = 250,000
Down payment = 25,000
Annual interest rate = 7.6%
Term = 30 years
What is the expected monthly payment?
A. $1,250.00
B. $1,388.55
C. $1,588.67
D. $1,750.23
C
You are developing a Node.js application in Google Cloud Shell using Gemini Pro to assist with code generation.
You generated a loan calculator function.
You installed prompt-sync using npm.
You created a package.json file with all dependencies.
Now, you want to deploy this app to run in a production environment on Google Cloud, but you want to minimize management overhead. Which option is the best fit?
A. Run the script directly in Cloud Shell when needed.
B. Package the app in a Docker container and deploy it to Cloud Run.
C. Deploy it to Compute Engine with a custom startup script.
D. Use Vertex AI Pipelines to run the Node.js script.
B
You are tasked with building a regression model for loan payment prediction using Google Cloud tools. Which Vertex AI feature enables you to train, deploy, and monitor an AutoML model directly from the console without writing code?
A) BigQuery ML
B) Vertex AI AutoML
C) AI Platform Notebooks
D) Cloud Shell
B
When using Gemini Pro via Vertex AI Studio to auto-generate code for a machine learning workflow, what is the correct way to prompt the model to generate code specifically in Node.js rather than Python?
A) Select ‘Node.js’ as the code language in the prompt options.
B) Explicitly specify “Generate all code in Node.js” in the prompt.
C) Use a YAML configuration in Vertex AI Studio.
D) Change model version to Gemini-1.5-flash.
B
Why is Cloud Shell recommended when working with Google Cloud resources in Vertex AI Studio for machine learning tasks?
A) Cloud Shell is required for model deployment.
B) Cloud Shell provides command-line access with pre-installed development tools and persistent storage, ensuring secure and separated sessions.
C) Cloud Shell automatically manages billing for AI services.
D) Cloud Shell can only be used for GPU-accelerated workloads.
B
While setting up a Node.js application for an ML prototype in Google Cloud, what command should be used to initialize the project and create the package.json file?
A) npm start
B) npm install
C) npm init
D) node create
C
Before training and deploying ML models in Vertex AI, which step must be performed to access all core features?
A) Enable all recommended APIs through the Vertex AI Dashboard.
B) Set up a custom VPC network.
C) Grant IAM access to all users.
D) Register a dataset in BigQuery.
A
What is a recommended practice for collecting user inputs for ML applications running as command-line tools in Node.js?
A) Use the prompt-sync Node.js module to prompt for user inputs.
B) Build a web interface with Flask.
C) Use Cloud Functions to collect input.
D) Store input data in Cloud SQL.
A
What is the main purpose of the package.json file in a Node.js ML application prototype?
A) Document the application’s security controls.
B) Enumerate dependencies, application metadata, and main entry point for package management.
C) Manage cloud billing and quotas.
D) Enable user authentication for ML endpoints.
B
Why is Cloud Shell recommended for running Google Cloud labs and development tasks?
A. It provides a browser-based VM with pre-installed tools and persistent storage.
B. It is a simulation environment that mimics Google Cloud locally.
C. It requires manual authentication for every session.
D. It only supports Python development.
A
You are building a Node.js application in Cloud Shell that requires user input from the command line. Which step ensures the dependency is properly managed?
A. Add the dependency manually in index.js.
B. Install the dependency with npm install so it is added to package.json.
C. Use gcloud add dependency to register the library.
D. Store the dependency in a .env file.
B
You want to integrate user input into your Node.js application that calls a Vertex AI model. Which approach is most appropriate?
A. Use prompt-sync to capture input, pass it to your function, and then call the Vertex AI API.
B. Hardcode the values in index.js for testing.
C. Use gcloud auth list to capture user input.
D. Store inputs in package.json.
A
When prompting a large language model in Vertex AI Studio for code generation, what is the best practice?
A. Always provide vague prompts to let the model decide.
B. Be explicit about the programming language and function requirements.
C. Use only one-word prompts to reduce confusion.
D. Avoid specifying the model version.
B
After building your Node.js loan calculator, which command correctly runs the application in Cloud Shell?
A. gcloud run loan-calculator
B. npm start
C. node index.js
D. gcloud ai models predict
C
In Vertex AI Studio’s Chat interface, you need to generate a Node.js function that calculates monthly payments for an amortized loan. What is the recommended setting to toggle on above the Submit button to improve the formatting of the generated code?
A. Code Mode
B. Syntax Highlighting
C. Markdown
D. Verbose Output
C
When prompting Gemini in Vertex AI Studio to create a function for amortized loan payments, the initial response generates code in an incorrect language. How should you refine the prompt to ensure the code is produced in Node.js?
A. Add “Use JavaScript syntax” at the end of the prompt.
B. Prefix the prompt with “Generate all code in Node.js.”
C. Specify “Output in ECMAScript format.”
D. Include “Avoid Python or other languages.”
B
You are developing a Node.js application in Cloud Shell and need to create a directory for your project. Which command should you use after navigating to the home directory?
A. cd loan-calculator
B. mkdir loan-calculator
C. touch loan-calculator
D. npm init loan-calculator
B
In Vertex AI Studio, after enabling the necessary APIs, you navigate to the Chat feature to generate code. What is the default location in the left-hand navigation menu for accessing Chat under the Vertex AI Studio group?
A. Generative AI Tools > Chat
B. Vertex AI Studio > Chat
C. Dashboard > Prompt Management
D. Freeform > Code Generation
B
You have generated a Node.js function using Gemini that calculates amortized payments with parameters like amount, downPayment, interestRate, and term. What formula element is used to compute the monthly payment in the amortization calculation?
A. principal * interestRate / numberOfPayments
B. (principal * monthlyInterestRate * Math.pow(1 + monthlyInterestRate, numberOfPayments)) / (Math.pow(1 + monthlyInterestRate, numberOfPayments) - 1)
C. amount - downPayment / (term * 12)
D. interestRate / 100 * principal
B
To incorporate user input from the command line in a Node.js application generated with Gemini, which module does the model recommend for prompting the user, and how is it installed?
A. readline, installed via npm install readline
B. inquirer, installed via npm install inquirer
C. prompt-sync, installed via npm install prompt-sync
D. console-prompt, installed via npm install console-prompt
C
You are in Cloud Shell Editor and need to create a new file for your Node.js code within a specific subfolder. After opening the folder, what icon should you click to create the file?
A. Open Terminal
B. Create New File
C. Upload File
D. New Folder
B