Bird
Raised Fist0
React Nativemobile~20 mins

React Native architecture (bridge, new architecture) - Practice Problems & Coding Challenges

Choose your learning style10 modes available
Challenge - 5 Problems
🎖️
React Native Architecture Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
What is the role of the React Native Bridge?
In React Native's classic architecture, what does the Bridge do?
AIt manages the app's navigation stack and screen transitions automatically.
BIt allows JavaScript and native code to communicate asynchronously by sending serialized messages.
CIt compiles JavaScript code directly into native machine code for faster execution.
DIt handles styling and layout calculations on the native side only.
Attempts:
2 left
💡 Hint
Think about how JavaScript talks to native modules in React Native.
❓ ui_behavior
intermediate
2:00remaining
How does the new React Native architecture improve UI updates?
Compared to the classic Bridge, how does the new React Native architecture handle UI updates more efficiently?
AIt uses a synchronous bridge that blocks JavaScript until UI updates finish.
BIt uses a JavaScript-driven UI thread that directly manipulates native views without serialization.
CIt removes the need for JavaScript by writing UI entirely in native code.
DIt introduces a Fabric renderer that allows concurrent and asynchronous UI updates with fine-grained control.
Attempts:
2 left
💡 Hint
Think about how the new Fabric renderer changes UI rendering.
❓ lifecycle
advanced
2:00remaining
What lifecycle change occurs with TurboModules in the new React Native architecture?
TurboModules replace classic native modules. How does their lifecycle differ in the new architecture?
ATurboModules run on the UI thread instead of the native module thread.
BTurboModules are eagerly initialized at app launch, increasing memory usage.
CTurboModules are lazily initialized only when first used, reducing startup time.
DTurboModules require manual memory management unlike classic modules.
Attempts:
2 left
💡 Hint
Consider how startup performance is improved in the new system.
❓ navigation
advanced
2:00remaining
How does the new React Native architecture affect navigation libraries?
With the new architecture, what is a key consideration for React Native navigation libraries?
AThey must be rewritten to use TurboModules and Fabric to avoid the Bridge.
BThey no longer need to interact with native code at all.
CThey can only use JavaScript-based navigation without native integration.
DThey must use synchronous Bridge calls for screen transitions.
Attempts:
2 left
💡 Hint
Think about how native modules and UI rendering changed.
🔧 Debug
expert
3:00remaining
Why might a React Native app freeze under the classic Bridge but not with the new architecture?
A React Native app using the classic Bridge sometimes freezes during heavy UI updates. Why does this happen less in the new architecture?
AThe classic Bridge is single-threaded and serializes all messages, causing blocking; the new architecture uses concurrent threads and asynchronous rendering.
BThe classic Bridge uses too many native threads causing deadlocks; the new architecture uses only one thread.
CThe classic Bridge compiles JavaScript slower; the new architecture uses a faster JavaScript engine.
DThe classic Bridge requires manual memory management; the new architecture uses automatic garbage collection.
Attempts:
2 left
💡 Hint
Consider how message passing and threading differ between architectures.

Practice

(1/5)
1. What is the main role of the bridge in React Native architecture?
easy
A. It manages the app's navigation stack.
B. It compiles JavaScript into native machine code.
C. It connects JavaScript code with native platform code.
D. It handles styling and layout of components.

Solution

  1. Step 1: Understand the bridge concept

    The bridge acts as a communication layer between JavaScript and native code in React Native.
  2. Step 2: Identify the bridge's role

    It allows JavaScript to send commands and receive data from native modules, enabling cross-platform functionality.
  3. Final Answer:

    It connects JavaScript code with native platform code. -> Option C
  4. Quick Check:

    Bridge = Connect JS and native [OK]
Hint: Bridge links JS and native code in React Native [OK]
Common Mistakes:
  • Thinking bridge compiles JavaScript
  • Confusing bridge with navigation or styling
  • Assuming bridge handles UI rendering directly
2. Which of the following is the correct way to describe the new React Native architecture?
easy
A. It removes the need for native code entirely.
B. It replaces JavaScript with a new language.
C. It uses a webview to render all components.
D. It improves performance by reducing bridge overhead.

Solution

  1. Step 1: Recall the new architecture goal

    The new React Native architecture aims to make apps faster by optimizing communication.
  2. Step 2: Understand how it improves performance

    It reduces the overhead caused by the bridge, making interactions between JS and native code more efficient.
  3. Final Answer:

    It improves performance by reducing bridge overhead. -> Option D
  4. Quick Check:

    New architecture = less bridge overhead [OK]
Hint: New architecture reduces bridge overhead for speed [OK]
Common Mistakes:
  • Believing it removes native code completely
  • Thinking it replaces JavaScript language
  • Confusing it with webview-based rendering
3. Given the following code snippet, what will happen when the JavaScript calls NativeModules.ExampleModule.getData() in React Native's old architecture?
medium
A. The call is sent over the bridge asynchronously.
B. The call goes directly to native code without delay.
C. The call causes a syntax error in JavaScript.
D. The call is handled by a webview component.

Solution

  1. Step 1: Understand NativeModules call behavior

    In old React Native, calls to native modules go through the bridge asynchronously.
  2. Step 2: Identify the effect of the bridge

    The bridge queues and sends messages between JS and native code, causing asynchronous behavior.
  3. Final Answer:

    The call is sent over the bridge asynchronously. -> Option A
  4. Quick Check:

    Old architecture calls = async bridge [OK]
Hint: Old architecture uses async bridge calls [OK]
Common Mistakes:
  • Assuming direct synchronous native calls
  • Thinking it causes syntax errors
  • Confusing with webview handling
4. You notice your React Native app is slow due to many bridge calls. Which change can help fix this performance issue?
medium
A. Rewrite all JavaScript code in TypeScript.
B. Switch to the new architecture with TurboModules and Fabric.
C. Remove all native modules and use only JavaScript.
D. Use a webview to render the entire app.

Solution

  1. Step 1: Identify cause of slowness

    Many bridge calls cause overhead and slow down the app.
  2. Step 2: Choose the right fix

    The new architecture uses TurboModules and Fabric to reduce bridge overhead and improve speed.
  3. Final Answer:

    Switch to the new architecture with TurboModules and Fabric. -> Option B
  4. Quick Check:

    New architecture reduces bridge calls [OK]
Hint: Use new architecture to reduce bridge calls [OK]
Common Mistakes:
  • Thinking TypeScript improves bridge performance
  • Removing native modules breaks functionality
  • Using webview slows app further
5. How does the new React Native architecture improve UI rendering performance compared to the old bridge system?
hard
A. By using Fabric to directly manage UI components on the native side.
B. By compiling JavaScript into native code at build time.
C. By removing the need for any native code in the app.
D. By rendering UI inside a webview for faster updates.

Solution

  1. Step 1: Understand Fabric's role

    Fabric is the new rendering system that manages UI components natively.
  2. Step 2: Compare with old bridge system

    Old system sent UI updates over the bridge causing delays; Fabric reduces this by direct native management.
  3. Final Answer:

    By using Fabric to directly manage UI components on the native side. -> Option A
  4. Quick Check:

    Fabric improves UI by native management [OK]
Hint: Fabric manages UI natively for speed [OK]
Common Mistakes:
  • Thinking JavaScript is compiled to native code
  • Believing native code is removed
  • Confusing Fabric with webview rendering
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