yoklainterview sim

Mobile Rn Networking Persistence Offline Interview Questions

75 verified Mobile Rn Networking Persistence Offline interview questions — solve with answers, learn from explanations, test yourself in a real simulation.

Try the real simulation →

Sample questions

Rn Networking Persistence OfflineDifficulty 1
In React Native, what does fetch() return?
  • aA callback function that fires when the request finishes
  • bA synchronous Response object
  • cA Promise that resolves to a Response object
  • dAn observable stream that must be subscribed to
Explanation:fetch() is Promise-based: it returns a Promise that resolves with a Response object once headers arrive, regardless of the HTTP status code.
Rn Networking Persistence OfflineDifficulty 2
const res = await fetch('https://api.example.com/user/404');
console.log(res.ok);

If the server returns HTTP 404, what does res.ok log?
  • atrue, because the network request itself succeeded
  • bundefined, because 4xx responses do not set the ok flag
  • cIt throws before reaching this line
  • dfalse, because ok is only true for status codes 200-299
Explanation:fetch only rejects on network-level failures (DNS, no connectivity). A 404 is a normal resolved Response; res.ok is simply status >= 200 && status < 300, so it is false here.
Rn Networking Persistence OfflineDifficulty 1
Why might a team choose axios over the built-in fetch in a React Native project?
  • aAxios ships request/response interceptors and automatic JSON parsing out of the box
  • bAxios is the only library capable of making HTTP requests on Android
  • cfetch cannot send POST requests with a JSON body
  • dAxios requests run on the native UI thread instead of the JS thread
Explanation:Both can make any HTTP request; the practical draw of axios is convenience features like interceptors, automatic JSON transform, and built-in request cancellation, not raw capability.
Rn Networking Persistence OfflineDifficulty 1
import AsyncStorage from '@react-native-async-storage/async-storage';

await AsyncStorage.setItem('token', 'abc123');
const value = await AsyncStorage.getItem('token');

What type is value?
  • astring, because AsyncStorage only stores string values
  • bnumber, because AsyncStorage coerces primitives
  • cAn object with a .value property
  • dA Buffer object
Explanation:AsyncStorage's API only accepts and returns strings; to store objects or numbers you must JSON.stringify before setItem and JSON.parse after getItem.
Rn Networking Persistence OfflineDifficulty 2
Why are all AsyncStorage methods (getItem, setItem, ...) asynchronous even for tiny values?
  • aBecause React Native forbids any synchronous native module call
  • bBecause values are always encrypted before being written
  • cBecause JavaScript itself has no synchronous file API
  • dThey cross the bridge into native I/O
Explanation:AsyncStorage is backed by native storage (SQLite on Android, a key-value store on iOS). Every call has to hop to the native side and touch disk, so it is designed as async regardless of payload size.
Rn Networking Persistence OfflineDifficulty 1
What is MMKV, in the context of React Native persistence?
  • aA cloud database service maintained by the React Native core team
  • bA wrapper around fetch that automatically queues and retries requests while offline
  • cA fast, synchronous key-value storage library built on JSI/native code
  • dThe default storage engine bundled with React Native since 0.60
Explanation:MMKV (originally from Tencent, popularized in RN via react-native-mmkv) is a native, JSI-backed key-value store known for synchronous access and low overhead. It is not bundled by default and is not a cloud service.

Test yourself against the 2400-question Mobile bank.

Start interview