Bird
Raised Fist0
Hadoopdata~20 mins

NiFi for data flow automation in Hadoop - Practice Problems & Coding Challenges

Choose your learning style10 modes available
Challenge - 5 Problems
🎖️
NiFi Data Flow Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
1:30remaining
Understanding NiFi FlowFiles

In Apache NiFi, what is a FlowFile?

AA container that holds data and attributes moving through NiFi
BA data record stored in HDFS for batch processing
CA script that automates data ingestion in NiFi
DA configuration file for NiFi processors
Attempts:
2 left
💡 Hint

Think about what moves inside NiFi between processors.

❓ Predict Output
intermediate
1:30remaining
NiFi Expression Language Output

What is the output of this NiFi Expression Language snippet if the attribute 'filename' is 'data_2024.csv'?

${filename:substring(5,9)}
A024.
B2024
C202
Ddata
Attempts:
2 left
💡 Hint

Substring(start, end) extracts characters from start index up to but not including end index.

❓ data_output
advanced
2:00remaining
NiFi Data Provenance Query Result

You run a NiFi Data Provenance query filtering events by a specific processor and time range. The query returns 3 events. What does this output represent?

AThree processors active during the time range
BThree configuration changes made to NiFi
CThree errors logged by NiFi in that time range
DThree FlowFiles processed by that processor in the time range
Attempts:
2 left
💡 Hint

Data Provenance tracks FlowFile events like creation, modification, and transfer.

🔧 Debug
advanced
2:00remaining
Troubleshooting NiFi Processor Failure

Given this NiFi processor configuration snippet, which option explains why the processor fails to start?

Properties:
Input Directory: /data/input
File Filter: *.csv
Scheduling Strategy: Timer-driven
Run Schedule: 0 sec
AInput Directory path must be absolute, '/data/input' is relative
BFile Filter '*.csv' is invalid syntax and causes failure
CRun Schedule set to 0 seconds causes invalid scheduling interval error
DScheduling Strategy 'Timer-driven' is deprecated and causes failure
Attempts:
2 left
💡 Hint

Check if the run schedule value is valid for timer-driven scheduling.

🚀 Application
expert
3:00remaining
Designing a NiFi Flow for Real-Time Data Filtering

You need to design a NiFi flow that reads streaming data from Kafka, filters records where 'status' equals 'error', and writes them to HDFS. Which sequence of processors correctly implements this?

AConsumeKafka -> QueryRecord (filter status=='error') -> PutHDFS
BGetFile -> UpdateAttribute (status=='error') -> PutHDFS
CConsumeKafka -> RouteOnAttribute (status=='error') -> PutHDFS
DListenHTTP -> RouteOnContent (status=='error') -> PutFile
Attempts:
2 left
💡 Hint

Consider processors that can consume Kafka and filter records by content.

Practice

(1/5)
1. What is the main purpose of Apache NiFi in data flow automation?
easy
A. To create visual dashboards for data analysis
B. To store large amounts of data permanently
C. To write complex SQL queries for databases
D. To automate moving and transforming data between systems

Solution

  1. Step 1: Understand NiFi's role

    NiFi is designed to automate data movement and transformation between different systems.
  2. Step 2: Compare options

    Options B, C, and D describe other tools or functions not related to NiFi's core purpose.
  3. Final Answer:

    To automate moving and transforming data between systems -> Option D
  4. Quick Check:

    NiFi = Data flow automation [OK]
Hint: NiFi moves and changes data automatically [OK]
Common Mistakes:
  • Confusing NiFi with data storage tools
  • Thinking NiFi is for database querying
  • Assuming NiFi creates dashboards
2. Which of the following is the correct way to connect processors in NiFi?
easy
A. By writing code to link processors
B. By configuring database connections manually
C. By dragging arrows between processors in the UI
D. By exporting data to CSV files

Solution

  1. Step 1: Recall NiFi interface

    NiFi uses a visual drag-and-drop interface where processors are connected by arrows.
  2. Step 2: Eliminate incorrect options

    Options A, C, and D do not describe NiFi's method of connecting processors.
  3. Final Answer:

    By dragging arrows between processors in the UI -> Option C
  4. Quick Check:

    NiFi UI connections = drag arrows [OK]
Hint: NiFi connections are visual, not coded [OK]
Common Mistakes:
  • Thinking connections require coding
  • Confusing with database setup
  • Assuming data export links processors
3. Consider this NiFi flow snippet:
Processor A -> Processor B -> Processor C

If Processor B fails, what happens to the data flow?
medium
A. Data flows normally through all processors
B. Data stops at Processor B and does not reach Processor C
C. Data skips Processor B and goes directly to Processor C
D. Processor A stops working immediately

Solution

  1. Step 1: Understand processor dependencies

    Data flows sequentially; if Processor B fails, it blocks data from moving forward.
  2. Step 2: Analyze options

    Data cannot skip processors, so Data skips Processor B and goes directly to Processor C is wrong. Processor A continues working, so Processor A stops working immediately is wrong.
  3. Final Answer:

    Data stops at Processor B and does not reach Processor C -> Option B
  4. Quick Check:

    Processor failure blocks downstream flow [OK]
Hint: Failed processor blocks next steps [OK]
Common Mistakes:
  • Assuming data skips failed processors
  • Thinking upstream processors stop immediately
  • Believing flow continues despite failure
4. You created a NiFi flow but data is not moving between processors. Which is the most likely cause?
medium
A. Processors are not connected by arrows
B. NiFi server is running
C. Data format is correct
D. Processors are scheduled to run

Solution

  1. Step 1: Check processor connections

    Data moves only if processors are connected by arrows in NiFi.
  2. Step 2: Evaluate other options

    Options B, C, and D describe normal conditions that allow data flow, so they are not causes of no movement.
  3. Final Answer:

    Processors are not connected by arrows -> Option A
  4. Quick Check:

    Missing connections stop data flow [OK]
Hint: Check arrows connect processors [OK]
Common Mistakes:
  • Ignoring missing connections
  • Assuming server status causes no flow
  • Confusing data format with flow control
5. You want to automate a data flow that reads files from a folder, filters only CSV files, and sends them to HDFS. Which NiFi processors should you use in order?
hard
A. ListFile -> RouteOnAttribute -> PutHDFS
B. PutHDFS -> ListFile -> RouteOnAttribute
C. RouteOnAttribute -> PutHDFS -> ListFile
D. ListFile -> PutHDFS -> RouteOnAttribute

Solution

  1. Step 1: Identify processor roles

    ListFile reads files from a folder, RouteOnAttribute filters files by attributes (like file type), PutHDFS writes files to HDFS.
  2. Step 2: Determine correct order

    First list files, then filter CSV files, then send filtered files to HDFS.
  3. Final Answer:

    ListFile -> RouteOnAttribute -> PutHDFS -> Option A
  4. Quick Check:

    Read -> Filter -> Write = D [OK]
Hint: Read files, filter, then write [OK]
Common Mistakes:
  • Putting PutHDFS before filtering
  • Filtering before listing files
  • Wrong processor order
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard