Skip to content

Instantly share code, notes, and snippets.

@mbalex99
Last active April 12, 2017 19:49
Show Gist options
  • Save mbalex99/b89f760c2e544d8daf1770ae66d11b6e to your computer and use it in GitHub Desktop.
Save mbalex99/b89f760c2e544d8daf1770ae66d11b6e to your computer and use it in GitHub Desktop.
Realm Node Interview Questions

Coding Questions

  1. How would you explicity notify the node run loop to execute some code. For example, we have C++ calling JavaScript. C++ code is not aware of the JavaScript/Node event loop
  2. Show me your ways of getting rid of callback hell.
  3. How would you handle uncaught exceptions in node?
  4. This takes a long time in Chrome but not in Node why?
console.time("cycle")
for(var i = 0; i < 5000000; i++) {
  //nothing
}
console.timeEnd("cycle")
  1. What is the difference between import and require
  2. What are some benefits of @decorators
  3. Pseudo code a pubsub implementation using node, websockets and realm given the API below
// Observe Realm Notifications
var Realm = require('realm');

const TaskSchema = {
  name: 'Task',
  properties: {
    body:  'string',
    isDone: {type: 'bool', default: false},
    timestamp: {type: 'date', default: new Date()}
  }
};
// Initialize a Realm with Car and Person models
let realm = new Realm({schema: [TaskSchema]});

realm.objects('Task').filtered('isDone == true').addListener((tasks, changes) => {
  //changes.insertions
  //changes.deletions
  //changes.modifications
});

// Unregister all listeners
realm.removeAllListeners();

Open Source Questions

  1. Are you familiar with Webpack, JSX, Gulp, Babel and or TypeScript?
  2. How would you create middlewares for express that are independent, testable, and well documented,

Realm Questions

  1. What do you like about Realm
  2. What would you improve about the Dashboards
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment