Skip to content

Instantly share code, notes, and snippets.

@firstChairCoder
Last active April 19, 2022 03:24
Show Gist options
  • Save firstChairCoder/95c25a556d6ba53fce0a253cfd61a73d to your computer and use it in GitHub Desktop.
Save firstChairCoder/95c25a556d6ba53fce0a253cfd61a73d to your computer and use it in GitHub Desktop.
Just a couple interview questions that I am collecting. Please suggest more if you can!
  1. What is the InteractionManager and how is it used? Why is it important?

  2. Which node_modules will run in React Native? How can we test for this?

  3. What is wrong with this code for querying a native API?

class Gyros {
  setGyroPosition(pos) {
    if (pos=== null || typeof pos === "undefined") {
      throw new Error("The position must be defined");
    }
    this.pos = pos
  }
constructor(){
  const gyroscopePosition = NativeModules.MyGyroModule.gyroPosition();
  this.setGyroPosition(gyroscopePosition);
  }
}
  1. Write a reducer function that returns a newstate with isAuthorized set to true.
const initialState = {
  user: {
    isAuthorized: false,
  }
};

The reducer function has the following signature: (previousState = initialState, action) => newState, where the action has a payload containing a property isAuthorized set to true.

a) Write a pseudo-code that uses the fetch API which makes request to https://jsonplaceholder.typicode.com/users/

b) Render a list in the UI

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment