Docsity

PrepIQ Cloud Data Engineer Java Ultimate Exam, Exams of Technology

Toggle sidebar
bg1
PrepIQ Cloud Data Engineer Java
Ultimate Exam
**Question 1.** Which Apache Beam transform is used to apply a user-defined
function to each element in a PCollection?
A) GroupByKey
B) ParDo
C) CombinePerKey
D) Flatten
Answer: B
Explanation: ParDo (parallel Do) invokes a DoFn on each element, enabling
arbitrary processing.
**Question 2.** In Cloud Dataflow, which window type groups elements that
arrive within a fixed duration measured from the start of processing?
A) Sliding window
B) Fixed window
C) Session window
D) Global window
Answer: B
Explanation: Fixed windows have a constant size and do not overlap; they start
at the epoch and repeat every interval.
**Question 3.** When using side inputs in Apache Beam Java SDK, which
collection type can be supplied as a broadcast variable to a ParDo?
A) PCollectionView
B) PTransform
C) PCollectionTuple
D) PBegin
Answer: A
Explanation: PCollectionView is the handle for side inputs, allowing the DoFn to
read a materialized view of another PCollection.
**Question 4.** Which stateful processing feature in Beam Java allows a DoFn to
retain a running count per key across windows?
A) Timer
B) StateSpec
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b
pf3c
pf3d
pf3e
pf3f
pf40
pf41
pf42
pf43
pf44
pf45
pf46
pf47
pf48
pf49
pf4a
pf4b

Partial preview of the text

Download PrepIQ Cloud Data Engineer Java Ultimate Exam and more Exams Technology in PDF only on Docsity!

Ultimate Exam

Question 1. Which Apache Beam transform is used to apply a user-defined function to each element in a PCollection? A) GroupByKey B) ParDo C) CombinePerKey D) Flatten Answer: B Explanation: ParDo (parallel Do) invokes a DoFn on each element, enabling arbitrary processing. Question 2. In Cloud Dataflow, which window type groups elements that arrive within a fixed duration measured from the start of processing? A) Sliding window B) Fixed window C) Session window D) Global window Answer: B Explanation: Fixed windows have a constant size and do not overlap; they start at the epoch and repeat every interval. Question 3. When using side inputs in Apache Beam Java SDK, which collection type can be supplied as a broadcast variable to a ParDo? A) PCollectionView B) PTransform C) PCollectionTuple D) PBegin Answer: A Explanation: PCollectionView is the handle for side inputs, allowing the DoFn to read a materialized view of another PCollection. Question 4. Which stateful processing feature in Beam Java allows a DoFn to retain a running count per key across windows? A) Timer B) StateSpec

Ultimate Exam

C) CombineFn D) WindowFn Answer: B Explanation: StateSpec defines per-key state (e.g., ValueState) that persists across bundles, enabling counters or aggregates. Question 5. In Spark Structured Streaming with Java, which trigger processes data as soon as it arrives? A) Trigger.Once() B) Trigger.ProcessingTime("0 seconds") C) Trigger.Continuous("1 second") D) Trigger.Default() Answer: B Explanation: ProcessingTime with zero seconds means the engine checks for new data continuously, effectively “as-soon-as-available”. Question 6. Which Spark configuration property controls the fraction of heap that the JVM can use for garbage collection before triggering a Full GC? A) spark.memory.fraction B) spark.executor.memoryOverhead C) spark.storage.memoryFraction D) spark.sql.shuffle.partitions Answer: A Explanation: spark.memory.fraction defines the portion of JVM heap reserved for execution and storage; the remainder triggers GC. Question 7. When using the Cloud Pub/Sub Java client, which method ensures at-least-once delivery semantics? A) publishAsync() with exactly-once flag B) subscriber.startAsync() with AckDeadlineExtension C) publish() with orderingKey D) subscriber.receive() with enableExactlyOnceDelivery() Answer: B

Ultimate Exam

A) Reduces storage cost B) Enables automatic partitioning C) Improves query performance by pruning data blocks D) Allows real-time streaming inserts Answer: C Explanation: Clustering orders data on disk by the clustered column, allowing the engine to skip irrelevant blocks during query execution. Question 12. Which SCD type captures only the most recent change and overwrites previous values? A) Type I B) Type II C) Type III D) Type IV Answer: A Explanation: Slowly Changing Dimension Type I simply updates the existing record, keeping no history. Question 13. In a Medallion Architecture, which layer typically contains raw, uncleaned data? A) Bronze B) Silver C) Gold D) Platinum Answer: A Explanation: Bronze is the landing zone for raw ingestion; Silver refines data, and Gold provides curated, business-ready datasets. Question 14. Which open-source storage format enables ACID transactions on object storage like S3 when used with Apache Spark? A) ORC B) Parquet C) Delta Lake

Ultimate Exam

D) Avro Answer: C Explanation: Delta Lake adds a transaction log and versioning on top of Parquet files, delivering ACID guarantees on cloud storage. Question 15. In Apache Iceberg, what is the purpose of a “snapshot”? A) Stores a compressed copy of the table for backup B) Represents a consistent view of the table at a point in time C) Defines the file format for the table D) Enables row-level security Answer: B Explanation: A snapshot records the metadata of all data files that belong to the table at a specific moment, enabling time-travel queries. Question 16. Which Java library would you use to call a Vertex AI model for online predictions? A) Google Cloud Storage client B) Vertex AI Prediction client (v1) C) AutoML Tables client D) Dataflow SDK Answer: B Explanation: The Vertex AI Prediction client provides methods like predict() to send feature payloads to a deployed model endpoint. Question 17. When building a feature engineering pipeline in Java, which Apache Beam transform is best suited for extracting a field from a JSON string? A) MapElements B) Filter C) FlatMapElements D) GroupByKey Answer: A Explanation: MapElements applies a simple one-to-one transformation, ideal for parsing JSON and returning a specific field.

Ultimate Exam

B) datasets.setIamPolicy() C) tables.patch() with encryptionConfiguration D) jobs.insert() with encryptionSpec Answer: C Explanation: The tables.patch() method accepts an EncryptionConfiguration object that references the CMEK. Question 22. Which DLP API transformation is appropriate for redacting credit-card numbers in a Java data pipeline? A) DeidentifyConfig with CryptoDeterministicConfig B) DeidentifyConfig with InfoTypeTransformation and ReplaceWithInfoTypeConfig C) DeidentifyConfig with PrimitiveTransformation and ReplaceWithCustomInfoTypeConfig D) DeidentifyConfig with PrimitiveTransformation and ReplaceWithInfoTypeConfig Answer: D Explanation: ReplaceWithInfoTypeConfig replaces detected PII (e.g., CREDIT_CARD_NUMBER) with the info-type label, effectively redacting it. Question 23. In Cloud Logging, which severity level indicates a non-critical error that should be investigated? A) INFO B) DEBUG C) ERROR D) NOTICE Answer: C Explanation: ERROR denotes a problem that caused a request to fail and requires attention. Question 24. Which Java profiling tool integrates with Cloud Profiler to capture CPU and heap usage of a Dataflow job? A) JVisualVM B) Java Flight Recorder (JFR) C) YourKit

Ultimate Exam

D) Cloud Profiler Agent (gcloud-profiler) Answer: D Explanation: The Cloud Profiler agent automatically instruments Java processes running on GCP, sending profiles to Cloud Profiler. Question 25. What is the primary advantage of using Preemptible VMs for batch Spark jobs? A) Higher network bandwidth B) Guaranteed uptime C) Lower cost per CPU hour D) Unlimited runtime Answer: C Explanation: Preemptible VMs are cheaper (up to 80% discount) but may be terminated; they are ideal for fault-tolerant batch workloads. Question 26. In Spark Java, which API call creates a Dataset from a JSON file stored in Cloud Storage? A) spark.read().json("gs://bucket/file.json") B) spark.read().format("json").load("gs://bucket/file.json") C) spark.read().option("path", "gs://bucket/file.json").json() D) spark.read().parquet("gs://bucket/file.json") Answer: A Explanation: The json() shortcut reads JSON directly from the given URI into a Dataset. Question 27. Which Beam windowing strategy is best for grouping user activity that ends after a period of inactivity? A) Fixed windows B) Sliding windows C) Session windows D) Global windows Answer: C Explanation: Session windows close after a gap of inactivity, making them ideal for user-session analysis.

Ultimate Exam

B) spark.default.parallelism C) spark.sql.autoBroadcastJoinThreshold D) spark.executor.cores Answer: A Explanation: spark.sql.shuffle.partitions determines how many tasks are created for shuffle stages; tuning it reduces overhead. Question 32. In a Java Dataflow DoFn, which annotation marks a method that runs once per bundle for setup tasks? A) @Setup B) @StartBundle C) @FinishBundle D) @Teardown Answer: A Explanation: @Setup is invoked once before processing begins, allowing expensive initializations. Question 33. Which Pub/Sub subscription type guarantees ordering of messages with the same ordering key? A) Pull subscription B) Push subscription C) Exactly-once subscription D) Ordered subscription (Enable message ordering) Answer: D Explanation: Enabling message ordering on a subscription preserves order for messages sharing an ordering key. Question 34. Which Java class is used to sign JWTs for OAuth 2. service-account authentication? A) GoogleCredentials B) ServiceAccountJwtAccessCredentials C) JwtHelper D) OAuth2Credentials

Ultimate Exam

Answer: B Explanation: ServiceAccountJwtAccessCredentials creates signed JWTs that can be exchanged for access tokens. Question 35. In Delta Lake, what is the purpose of the “_delta_log” directory? A) Stores raw parquet files B) Contains the transaction log for ACID semantics C) Holds metadata for column statistics D) Provides backup snapshots Answer: B Explanation: _delta_log tracks JSON and checkpoint files that represent the table’s transaction history. Question 36. Which Cloud Data Fusion plugin would you use to read from Cloud Pub/Sub in a Java-based pipeline? A) Pub/Sub Source B) Kafka Source C) BigQuery Source D) GCS Source Answer: A Explanation: The Pub/Sub source plugin connects to a Pub/Sub topic and streams data into Data Fusion pipelines. Question 37. When using Cloud Composer, which environment variable provides the location of the Airflow home directory? A) AIRFLOW_HOME B) COMPOSER_HOME C) GCP_AIRFLOW_HOME D) DAG_FOLDER Answer: A Explanation: AIRFLOW_HOME is the standard environment variable used by Airflow to locate its configuration and DAG files.

Ultimate Exam

C) outputMode("console") D) foreachBatch(consoleSink) Answer: A Explanation: writeStream().format("console") creates a console sink that prints each micro-batch to stdout. Question 42. Which Beam feature allows a DoFn to emit elements to multiple output PCollections? A) MultiOutputDoFn B) TupleTag C) SideOutput D) PCollectionTuple Answer: B Explanation: TupleTag identifies each side output; the DoFn can output to the main and side PCollections using context.output(tag, value). Question 43. Which Spark optimizer rule can be disabled to prevent predicate pushdown on Parquet files? A) SparkSQLPushDownFilter B) ParquetPredicatePushdown C) ColumnPruning D) WholeStageCodegen Answer: B Explanation: Setting spark.sql.parquet.filterPushdown = false disables predicate pushdown for Parquet sources. Question 44. Which Google Cloud service provides a unified metadata catalog for data assets across BigQuery, Pub/Sub, and Cloud Storage? A) Data Catalog B) Dataplex C) Cloud Asset Inventory D) Cloud Composer Answer: A

Ultimate Exam

Explanation: Data Catalog is a fully managed metadata service that indexes assets from multiple GCP services. Question 45. In Java, which annotation marks a method that should be executed after all bundles have been processed in a DoFn? A) @Setup B) @StartBundle C) @FinishBundle D) @Teardown Answer: C Explanation: @FinishBundle runs once after the DoFn finishes processing a bundle, useful for flushing buffers. Question 46. Which of the following is a recommended practice for minimizing GC pauses in large Spark executors? A) Increase spark.executor.memory to 1 TB B) Use G1GC with -XX:+UseG1GC C) Disable serialization D) Set spark.sql.shuffle.partitions to 1 Answer: B Explanation: G1GC is designed for low-pause garbage collection, making it suitable for large heap sizes. Question 47. Which Dataflow runner option enables streaming engine mode for low-latency pipelines? A) --streaming=true B) --useStreamingEngine=true C) --enableStreamingEngine=true D) --streamingEngine=true Answer: B Explanation: The flag --useStreamingEngine=true activates the managed streaming engine, improving autoscaling and latency.

Ultimate Exam

C) The DoFn receives the default value specified in the view D) The element is filtered out automatically Answer: C Explanation: asSingleton() can be configured with a default value that is emitted when the side input collection is empty. Question 52. Which Spark SQL function can be used to generate a monotonically increasing 64-bit integer for each row? A) uuid() B) monotonically_increasing_id() C) row_number() D) rand() Answer: B Explanation: monotonically_increasing_id() returns a unique, increasing identifier that is not guaranteed to be contiguous. Question 53. In a Java Dataflow pipeline, which method is used to set the watermark for a custom source? A) withTimestampFn() B) withWatermarkEstimator() C) withAllowedLateness() D) withTimestampPolicy() Answer: B Explanation: withWatermarkEstimator() supplies a WatermarkEstimator that tells the system the current event-time progress. Question 54. Which Cloud service provides automated data lineage tracking for BigQuery tables? A) Cloud Data Fusion B) Dataplex C) Data Catalog (lineage feature) D) Cloud Composer Answer: C

Ultimate Exam

Explanation: Data Catalog’s lineage feature captures upstream and downstream relationships for BigQuery datasets. Question 55. Which Java library is the official client for interacting with Google Cloud DLP? A) google-cloud-dlp B) google-dlp-client C) gcloud-dlp-sdk D) cloud-dlp-java Answer: A Explanation: The Maven artifact “com.google.cloud:google-cloud-dlp” provides the DLP client classes. Question 56. In Spark Structured Streaming, what does the “outputMode” of “complete” indicate? A) Only new rows are written B) The entire result table is written each trigger C) No output is produced D) Only updated rows are written Answer: B Explanation: Complete mode rewrites the full aggregation result on every micro-batch, suitable for small result sets. Question 57. Which Cloud Spanner DDL statement adds a column with a default value without rewriting the entire table? A) ALTER TABLE ADD COLUMN … DEFAULT … B) ALTER TABLE ADD COLUMN … NOT NULL C) ALTER TABLE ADD COLUMN … OPTIONS (allow_commit_timestamp=true) D) ALTER TABLE ADD COLUMN … ENCRYPTED WITH … Answer: A Explanation: Adding a column with DEFAULT populates existing rows automatically without a full table copy.

Ultimate Exam

C) Exactly-once delivery D) Dead-letter topic Answer: A Explanation: Flow control settings let the subscriber specify maxOutstandingMessages to prevent overwhelming the client. Question 62. In BigQuery, which clause is required to query a table that uses the “TIME_TRAVEL” feature? A) FOR SYSTEM_TIME AS OF B) FOR SNAPSHOT AT C) FOR VERSION AS OF D) FOR TIME_TRAVEL AT Answer: A Explanation: The FOR SYSTEM_TIME AS OF clause enables time-travel queries to a specific timestamp. Question 63. Which Java annotation is used to mark a method that should run after all pipeline teardown steps in Beam? A) @Teardown B) @AfterPipeline C) @Shutdown D) @Cleanup Answer: A Explanation: @Teardown is invoked once after the pipeline finishes, allowing resource cleanup. Question 64. Which GCP service provides a managed, serverless environment for executing Apache Beam pipelines without managing clusters? A) Cloud Dataflow B) Cloud Dataproc C) Cloud Run D) Cloud Functions Answer: A

Ultimate Exam

Explanation: Cloud Dataflow is the fully managed service for Beam pipelines. Question 65. Which Spark SQL function can be used to extract the year from a TIMESTAMP column? A) YEAR() B) EXTRACT(YEAR FROM column) C) date_part('year', column) D) year(column) Answer: D Explanation: The built-in function year(column) returns the year component of a timestamp. Question 66. When using the Pub/Sub Lite Java client, which concept replaces the traditional topic/subscription model? A) Partition B) Stream C) Reservation and Topic D) Channel Answer: C Explanation: Pub/Sub Lite separates the storage (Topic) from the delivery contract (Reservation), allowing independent scaling. Question 67. Which Dataflow option enables the use of a custom coder for a specific type? A) --customCoder=MyCoder B) --coderRegistry=MyRegistry C) --extraJavaOptions="-Dbeam.coders.MyType=MyCoder" D) --sdkContainerImage=custom-coder-image Answer: C Explanation: Passing a system property via extraJavaOptions lets the pipeline register a custom coder for a type. Question 68. In Cloud Spanner, what does the “interleaved” table feature provide?