Sign in
Home/Google Cloud/Professional Cloud Network Engineer (Google Cloud)/Free questions

Professional Cloud Network Engineer (Google Cloud) — Free Practice Questions

10 free sample questions from a bank of 228, with the correct answers and explanations. No signup required — start practising right now.

1You need to restrict access to your Google Cloud load-balanced application so that only specific IP addresses can connect. What should you do?
  • Create a secure perimeter using the Access Context Manager feature of VPC Service Controls and restrict access to the source IP range of the allowed clients and Google health check IP ranges.
  • Create a secure perimeter using VPC Service Controls, and mark the load balancer as a service restricted to the source IP range of the allowed clients and Google health check IP ranges.
  • Tag the backend instances "application," and create a firewall rule with target tag "application" and the source IP range of the allowed clients and Google health check IP ranges.
  • Label the backend instances "application," and create a firewall rule with the target label "application" and the source IP range of the allowed clients and Google health check IP ranges.
Answer: C

The short version

C — tag-targeted firewall rules filter LB backends by allowed sources plus probers. Tags bind policy to backend NICs while source ranges admit only approved clients. Including Google health-check ranges keeps the balancer healthy while all other internet sources stay blocked.

Key concepts in this question

  • Network tags: VM labels for firewall targeting that select which backends a rule applies to, distinct from mere inventory labels.
  • Firewall source ranges: CIDR allowlist defining who may initiate to backends, here the approved client IPs plus prober CIDRs.
  • Health-check necessity: load-balanced backends must still accept Google probers or they are marked unhealthy and serve nothing.
  • Service Controls scope: Access Context Manager perimeters govern API and data access, not per-IP admission to a web backend.
  • Labels versus tags: GCP labels organize billing and search but cannot serve as firewall targets in this pattern.

Why C is correct

C enforces IP restriction at the backend NIC layer without breaking load balancing. Tagging backends application and creating a firewall rule targeted to that tag limits ingress to the combined allowlist of client ranges and health-check ranges. Legitimate users and probers pass while all other sources are denied. It uses the native firewall targeting primitive rather than misapplying perimeters or non-enforcing labels.

Why the others are wrong

  • A. An Access Context Manager perimeter controls context-aware API access, not internet IP filtering to backends.
  • B. Marking the balancer as restricted under Service Controls does not create the needed IP-level firewall admission.
  • D. Targeting by label fails because labels are not valid firewall rule targets for VM traffic selection.

PCNE exam tip

IP-restrict a load-balanced app with tag-targeted firewall plus health-check sources included.

2Your end users are located in close proximity to us-east1 and europe-west1. Their workloads need to communicate with each other. You want to minimize cost and increase network efficiency. How should you design this topology?
  • Create 2 VPCs, each with their own regions and individual subnets. Create 2 VPN gateways to establish connectivity between these regions.
  • Create 2 VPCs, each with their own region and individual subnets. Use external IP addresses on the instances to establish connectivity between these regions.
  • Create 1 VPC with 2 regional subnets. Create a global load balancer to establish connectivity between the regions.
  • Create 1 VPC with 2 regional subnets. Deploy workloads in these subnets and have them communicate using private RFC1918 IP addresses.
Answer: D

The short version

D — one global VPC with two regional subnets carries coast-to-coast traffic privately. A single VPC spans regions natively, so us-east1 and europe-west1 workloads use private RFC1918 addresses with no tunnels or public IPs. It minimizes cost while keeping traffic on Google backbone.

Key concepts in this question

  • Global VPC: a single virtual network whose subnets can live in multiple regions yet route privately by default.
  • Regional subnets: per-region CIDRs hosting nearby users and workloads for locality and low latency.
  • Private RFC1918 exchange: intra-VPC routing that avoids internet egress charges and public exposure.
  • VPN duplication: two VPCs plus gateways would add tunnel cost and management for traffic Google already routes.
  • Load balancer misfit: a global balancer distributes front-end clients, it does not provide private workload-to-workload transport.

Why D is correct

D exploits VPC globality for the exact geography stated. Creating one VPC with a subnet near us-east1 and another near europe-west1 lets each user group attach locally while inter-subnet traffic stays private and efficient. No peering, VPN, or external addressing is needed, so cost and operational overhead stay minimal. Proximity plus single-domain routing delivers both efficiency and economy.

Why the others are wrong

  • A. Two VPCs plus VPN gateways pay for tunnels and management that a single global VPC avoids.
  • B. Two VPCs with external IPs exposes traffic publicly and incurs egress and security costs.
  • C. A global load balancer fronts services to clients but does not interconnect backend workloads privately.

PCNE exam tip

Two regions needing cheap private chatter usually means one global VPC, two subnets.

3Your organization is deploying a single project for 3 separate departments. Two of these departments require network connectivity between each other, but the third department should remain in isolation. Your design should create separate network administrative domains between these departments. You want to minimize operational overhead. How should you design the topology?
  • Create a Shared VPC Host Project and the respective Service Projects for each of the 3 separate departments.
  • Create 3 separate VPCs, and use Cloud VPN to establish connectivity between the two appropriate VPCs.
  • Create 3 separate VPCs, and use VPC peering to establish connectivity between the two appropriate VPCs.
  • Create a single project, and deploy specific firewall rules. Use network tags to isolate access between the departments.
Answer: C

The short version

C — three VPCs plus selective peering isolates one department while joining two. Separate VPCs create distinct administrative domains. Peering only the two that must communicate preserves isolation for the third without VPN overhead.

Key concepts in this question

  • Administrative domains: separate VPCs let each department control its own routes, firewalls, and IAM scope.
  • Selective peering: VPC Network Peering connects exactly the chosen pair, leaving the third with no private path.
  • Shared VPC centralization: a host project would interconnect all participants, defeating the required isolation.
  • VPN heaviness: Cloud VPN between VPCs adds gateways and tunnels for intra-Google reach that peering gives natively.
  • Single-project tags: firewall tags segment traffic but keep one shared control plane, not separate network administration.

Why C is correct

C satisfies connectivity plus isolation plus low overhead together. Creating three VPCs establishes the separate network domains the stem demands. Peering the two departments that require contact enables their private exchange while the third VPC remains unpeered and isolated. This avoids gateway deployment and keeps administration cleanly divided with minimal moving parts.

Why the others are wrong

  • A. Shared VPC host plus service projects shares one network domain and would connect rather than isolate the third.
  • B. Three VPCs with VPN adds gateway cost and tunnel management where simple peering suffices.
  • D. One project with tags and firewall rules isolates flows but does not create separate network administrative domains.

PCNE exam tip

Two must talk, one must stay alone, separate admins equals VPCs plus selective peering.

4You are migrating to Cloud DNS and want to import your BIND zone file. Which command should you use?
  • gcloud dns record-sets import ZONE_FILE --zone MANAGED_ZONE
  • gcloud dns record-sets import ZONE_FILE --replace-origin-ns --zone MANAGED_ZONE
  • gcloud dns record-sets import ZONE_FILE --zone-file-format --zone MANAGED_ZONE
  • gcloud dns record-sets import ZONE_FILE --delete-all-existing --zone MANAGED ZONE
Answer: C

The short version

C — BIND import needs the zone-file-format flag on record-sets import. Standard import expects another representation, so migrating a BIND file without declaring its format fails or misparses. Adding zone-file-format plus the managed-zone selector loads the file correctly.

Key concepts in this question

  • Cloud DNS managed zone: the authoritative container that will host the migrated records.
  • BIND zone file: legacy text format with SOA, NS, and record syntax that must be explicitly declared during import.
  • Zone-file-format flag: the CLI switch telling record-sets import to parse BIND syntax rather than default expectations.
  • Origin and overwrite options: replace-origin-ns or delete-all knobs alter NS handling or existing data, not file-format parsing itself.
  • Least-risk migration: declaring format preserves record fidelity without destructive mass deletion.

Why C is correct

C names the only command that both declares input type and targets the zone. The zone-file-format option instructs Cloud DNS to interpret the supplied file as a BIND zone, mapping its records into the managed zone named by the zone flag. Without that switch the importer cannot reliably parse BIND constructs. The other variants either omit format declaration or add unrelated destructive or NS-rewrite behavior.

Why the others are wrong

  • A. Plain import without format declaration does not correctly handle BIND file syntax.
  • B. Adding replace-origin-ns changes NS replacement behavior but still omits the required format declaration.
  • D. Delete-all-existing risks wiping current data and misspells zone selection while also missing format handling.

PCNE exam tip

BIND file to Cloud DNS equals record-sets import with zone-file-format plus zone.

5You created a VPC network named Retail in auto mode. You want to create a VPC network named Distribution and peer it with the Retail VPC. How should you configure the Distribution VPC?
  • Create the Distribution VPC in auto mode. Peer both the VPCs via network peering.
  • Create the Distribution VPC in custom mode. Use the CIDR range 10.0.0.0/9. Create the necessary subnets, and then peer them via network peering.
  • Create the Distribution VPC in custom mode. Use the CIDR range 10.128.0.0/9. Create the necessary subnets, and then peer them via network peering.
  • Rename the default VPC as "Distribution" and peer it via network peering.
Answer: B

The short version

B — peer-safe Distribution uses custom mode with 10.0.0.0 slash 9 to complement auto-mode Retail. Auto VPCs occupy 10.128.0.0 slash 9, so only the lower half avoids overlap. Building Distribution custom in 10.0.0.0 slash 9 then peering satisfies the non-overlap rule.

Key concepts in this question

  • Auto mode ranges: automatically created subnets in every region from 10.128.0.0 slash 9, fixing half the 10.0.0.0 slash 8 space.
  • Peering overlap rule: peered VPCs must have no overlapping CIDRs or peering fails and routing becomes ambiguous.
  • Custom mode control: lets architects choose exact CIDRs and subnets instead of accepting auto allocations.
  • Complementary half: 10.0.0.0 slash 9 is the only 10-space half that avoids the auto half, enabling clean peering.
  • Rename fallacy: renaming a default network creates no new addressing and cannot fix overlap.

Why B is correct

B engineers around the fixed auto allocation. Since Retail in auto mode already claims 10.128.0.0 slash 9 across regions, Distribution must avoid that half. Creating it custom with 10.0.0.0 slash 9 plus explicit subnets yields disjoint addressing, after which network peering can establish. It is the sole design that respects the overlap prohibition while keeping both names and intents.

Why the others are wrong

  • A. Auto plus auto reuses 10.128.0.0 slash 9 on both sides, guaranteeing overlap and peering failure.
  • C. Custom with 10.128.0.0 slash 9 duplicates the auto half, so overlap persists despite custom mode.
  • D. Renaming the default VPC changes only a name and does not create valid non-overlapping peering topology.

PCNE exam tip

Auto VPC owns 10.128 slash 9, so peer it with custom 10.0 slash 9 for no overlap.

6You are using a third-party next-generation firewall to inspect traffic. You created a custom route of 0.0.0.0/0 to route egress traffic to the firewall. You want to allow your VPC instances without public IP addresses to access the BigQuery and Cloud Pub/Sub APIs, without sending the traffic through the firewall. Which two actions should you take? (Choose two.)
  • Turn on Private Google Access at the subnet level.
  • Turn on Private Google Access at the VPC level.
  • Turn on Private Services Access at the VPC level.
  • Create a set of custom static routes to send traffic to the external IP addresses of Google APIs and services via the default internet gateway.
  • Create a set of custom static routes to send traffic to the internal IP addresses of Google APIs and services via the default internet gateway.
Answer: A, D

The short version

AD — enable subnet Private Google Access and add more-specific API routes via the internet gateway. A 0.0.0.0 slash 0 to the firewall would otherwise drag Google API calls through inspection. Subnet PGA plus targeted static routes keeps BigQuery and PubSub on Google edge while egress still uses the firewall.

Key concepts in this question

  • Default-route shunt: custom 0.0.0.0 slash 0 to the third-party firewall captures all egress, including API traffic by default.
  • Private Google Access: subnet-level setting letting no-public-IP VMs reach Google APIs over internal paths.
  • More-specific win: static routes for Google API external addresses via default gateway beat the 0.0.0.0 slash 0 on longest match.
  • VPC versus subnet scope: PGA is enabled per subnet that hosts the private VMs, not as a single VPC toggle here.
  • Bypass intent: the goal is to exempt only API traffic from inspection, not to remove the firewall from general egress.

Why AD is correct

A supplies API reachability from private VMs and D supplies the routing exception. Subnet PGA permits BigQuery and PubSub access without public IPs. Custom routes for API external addresses via the default gateway outrank the firewall default, so only that traffic bypasses inspection.

Why the others are wrong

  • B. Enabling PGA at VPC level misstates the operative scope, the effective control is per subnet for these VMs.
  • C. Private Services Access provisions service networking for managed services, not PGA routing around a firewall default.
  • E. Routing internal addresses via the gateway mis-targets the API front ends, which are reached as external API addresses here.

PCNE exam tip

Firewall default plus private API bypass equals subnet PGA plus specific API routes.

7All the instances in your project are configured with the custom metadata enable-oslogin value set to FALSE and to block project-wide SSH keys. None of the instances are set with any SSH key, and no project-wide SSH keys have been configured. Firewall rules are set up to allow SSH sessions from any IP address range. You want to SSH into one instance. What should you do?
  • Open the Cloud Shell SSH into the instance using gcloud compute ssh.
  • Set the custom metadata enable-oslogin to TRUE, and SSH into the instance using a third-party tool like putty or ssh.
  • Generate a new SSH key pair. Verify the format of the private key and add it to the instance. SSH into the instance using a third-party tool like putty or ssh.
  • Generate a new SSH key pair. Verify the format of the public key and add it to the project. SSH into the instance using a third-party tool like putty or ssh.
Answer: A

The short version

A — use Cloud Shell gcloud compute ssh to inject ephemeral access despite blocked project keys. With OS Login off and project-wide keys blocked plus no instance keys, third-party SSH has no credential to offer. Cloud Shell mediated SSH provisions what is needed and respects firewall openness.

Key concepts in this question

  • Metadata SSH model: Compute Engine admits SSH when a valid public key is present in project or instance metadata.
  • Blocked project keys: the instance setting rejects project-wide keys, closing the usual shared-key path.
  • OS Login disabled: FALSE means Unix identity comes from metadata keys rather than IAM-mapped login, narrowing options.
  • Empty key state: no instance key plus no project key leaves hand-rolled clients with nothing to authenticate.
  • Cloud Shell mediation: gcloud compute ssh from Cloud Shell generates and pushes a short-lived key and tunnels correctly.

Why A is correct

A works within the stated lockdown without manual key surgery. Opening Cloud Shell and running gcloud compute ssh creates a fresh keypair as needed and places the public half where the instance honors it, even while project-wide keys remain blocked. Firewall already allows SSH from any range, so the mediated session connects. It avoids flipping OS Login or hand-editing metadata that the policy intends to restrict.

Why the others are wrong

  • B. Flipping enable-oslogin to TRUE changes identity plumbing and still needs provisioning before third-party SSH works.
  • C. Adding a private key to the instance misunderstands key placement, the instance needs the public half in metadata.
  • D. Adding a public key at project level is explicitly blocked by the instance setting, so it would still be ignored.

PCNE exam tip

Blocked project keys plus no instance keys equals use gcloud compute ssh mediation.

8You work for a university that is migrating to GCP. These are the cloud requirements: "¢ On-premises connectivity with 10 Gbps "¢ Lowest latency access to the cloud "¢ Centralized Networking Administration Team New departments are asking for on-premises connectivity to their projects. You want to deploy the most cost-efficient interconnect solution for connecting the campus to Google Cloud. What should you do?
  • Use Shared VPC, and deploy the VLAN attachments and Interconnect in the host project.
  • Use Shared VPC, and deploy the VLAN attachments in the service projects. Connect the VLAN attachment to the Shared VPC's host project.
  • Use standalone projects, and deploy the VLAN attachments in the individual projects. Connect the VLAN attachment to the standalone projects' Interconnects.
  • Use standalone projects and deploy the VLAN attachments and Interconnects in each of the individual projects.
Answer: A

The short version

A — centralize VLAN attachments and Interconnect in the Shared VPC host project. Ten-gigabit plus lowest latency points to Dedicated Interconnect, while centralized administration points to Shared VPC. Host-level circuits shared to new departments minimize per-team interconnect spend.

Key concepts in this question

  • Throughput and latency: 10 Gbps with minimal latency favors Dedicated Interconnect over VPN or partner options.
  • Shared VPC: host project owns the network and interconnect, service projects consume connectivity without owning circuits.
  • Centralized administration: one networking team manages attachments and BGP once for the whole campus.
  • Cost efficiency: a shared physical footprint amortizes ports and attachments across departments versus per-project builds.
  • Standalone sprawl: per-project circuits duplicate ports, LOAs, and operations for every new department.

Why A is correct

A pairs the right wire with the right sharing model. Deploying VLAN attachments and Interconnect in the host project delivers dedicated 10-Gbps low-latency paths while letting each new department attach as a service project with no new physical build. Central administration stays with the networking team and incremental onboarding costs little. It is the most cost-efficient topology that still meets performance and governance needs.

Why the others are wrong

  • B. Service-project attachments tied to host networking fragments ownership and complicates centralized control.
  • C. Standalone projects with per-project attachments duplicate interconnects and lose sharing economies.
  • D. Full per-project Interconnect per department maximizes ports, cost, and administrative burden.

PCNE exam tip

Ten gigabits plus central team plus many departments equals Shared VPC host Interconnect.

9You have deployed a new internal application that provides HTTP and TFTP services to on-premises hosts. You want to be able to distribute traffic across multiple Compute Engine instances, but need to ensure that clients are sticky to a particular instance across both services. Which session affinity should you choose?
  • None
  • Client IP
  • Client IP and protocol
  • Client IP, port and protocol
Answer: B

The short version

B — Client IP affinity keeps both HTTP and TFTP on the same backend. Cross-protocol stickiness requires ignoring ports and protocols in the hash. Hashing only client IP pins all of a client flows to one instance across both services.

Key concepts in this question

  • Session affinity: load-balancer hashing that directs related connections to a consistent backend instance.
  • Client IP mode: hashes solely on client address, so different protocols and ports from one client land together.
  • Protocol-adding modes: adding protocol or port narrows the hash, splitting TFTP and HTTP from one client apart.
  • None mode: distributes each connection independently with no stickiness guarantee.
  • Multi-service stickiness: internal HTTP plus TFTP needs the broadest affinity key to span UDP, TCP, and ports.

Why B is correct

B uses the widest stable key that covers both services. Because the requirement spans HTTP and TFTP, likely across protocols and ports, any hash including protocol or port would place the two service flows on different backends. Client IP mode hashes only the source address, so every connection from one on-premises host sticks to the same Compute Engine instance. That delivers the requested cross-service affinity with native load balancing.

Why the others are wrong

  • A. None provides no stickiness, so HTTP and TFTP from one client spray across backends.
  • C. Client IP and protocol splits by protocol, separating TFTP from HTTP for the same client.
  • D. Client IP, port and protocol is the narrowest hash and further separates flows by ports as well.

PCNE exam tip

Sticky across different ports and protocols means choose Client IP only.

10You created a new VPC network named Dev with a single subnet. You added a firewall rule for the network Dev to allow HTTP traffic only and enabled logging. When you try to log in to an instance in the subnet via Remote Desktop Protocol, the login fails. You look for the Firewall rules logs in Stackdriver Logging, but you do not see any entries for blocked traffic. You want to see the logs for blocked traffic. What should you do?
  • Check the VPC flow logs for the instance.
  • Try connecting to the instance via SSH, and check the logs.
  • Create a new firewall rule to allow traffic from port 22, and enable logs.
  • Create a new firewall rule with priority 65500 to deny all traffic, and enable logs.
Answer: D

The short version

D — the implied deny is not logged, so add an explicit deny-all with logging. RDP to 3389 is dropped silently today while only the HTTP allow has logging enabled. A priority-65500 deny with logs enabled surfaces blocked traffic for diagnosis.

Key concepts in this question

  • Firewall logging scope: logs emit only for rules with logging enabled, not for the invisible implied deny.
  • Implied deny behavior: unmatched ingress is dropped without a log entry, hiding RDP blocks from Stackdriver view.
  • Explicit deny with logging: a low-priority deny-all that matches remaining traffic and records each denial.
  • Priority 65500: lower than app allows yet higher than implied deny, ideal for catch-all visibility.
  • Wrong-port checks: SSH or HTTP tests do not reveal RDP 3389 handling and misdirect troubleshooting.

Why D is correct

D creates the missing visibility the stem asks for. Because the Dev network has only an HTTP allow with logging, RDP attempts hit the unlogged implied deny and leave no entries. Adding a new rule that denies all with priority 65500 and enables logs captures those RDP drops while preserving the HTTP allow above it. Operators can then see blocked traffic in logging and confirm port 3389 is the failure cause.

Why the others are wrong

  • A. Flow logs show VPC sampling, not firewall decisions, and do not enable blocked-traffic firewall entries.
  • B. Trying SSH tests another port and still leaves the deny path unlogged for RDP diagnosis.
  • C. Allowing port 22 with logs helps SSH only and never reveals why RDP remains blocked.

PCNE exam tip

No logs for blocked traffic usually means add explicit deny-all with logging enabled.

Want the full bank of 228 questions for Professional Cloud Network Engineer (Google Cloud)? See all practice exams.