Meteor - JavaScript web framework MCQs

Meteor - JavaScript web framework MCQs

Our experts have gathered these Meteor - JavaScript web framework MCQs through research, and we hope that you will be able to see how much knowledge base you have for the subject of Meteor - JavaScript web framework by answering these multiple-choice questions.
Get started now by scrolling down!

1:
Tracker.Computation Object has the property named?
 

 

A.   .firstRun

B.   .lastRun

C.   .firstTime

D.   .isFirst

2:
Getting a Meteor method to return a function?
 

 

A.   Meteor.ClientCall.methods({ 'consoleLog': function(message) { console.log(message); }, });

B.   Deps.autorun(function() { Meteor.ClientCall.setClientId(Meteor.userId()); });

C.   Meteor.ClientCall.apply(userId, 'consoleLog', ['THIS MESSAGE SHOULD APPEAR IN THE CLIENT CONSOLE']);

D.   All of the above

3:
To get a current logged in user ID?
 

 

A.   this.userId;

B.   this.userID;

C.   this.loggedUserID;

D.   this.loggedUseId;

4:
How to get this.userId in function inside Meteor method?
 

 

A.   myMethod: function () { console.log(this.userId); function innerFunction() { console.log(this.userId); } innerFunction.bind(this); }

B.   myMethod: function () { console.log(this.userId); function innerFunction() { console.log(this.userId); }; innerFunction.apply(this); }

C.   myMethod: function () { var that = this; console.log(this.userId); function innerFunction() { console.log(that.userId); } innerFunction(); }

D.   myMethod: function () { var userId = this.userId; console.log(this.userId); function innerFunction(userId) { console.log(userId); innerFunction(); }

E.   All of the above

5:
How can a Meteor method be invoked?
 

 

A.   if(Meteor.isServer) { Meteor.invoke(‘sampleMethod'); }

B.   if(Meteor.isClient) { Meteor.invoke(‘sampleMethod'); }

C.   if(Meteor.isServer) { Meteor.call(‘sampleMethod'); }

D.   if(Meteor.isClient) { Meteor.call(‘sampleMethod'); }

6:
Which of the following methods using to setup access in Collections?
 

 

A.   access

B.   deny

C.   allow

D.   allows -WORNG ANDS

7:
A method is simply a remote function - a function that is run on the server. The benefits are that you know it's more secure and reliable, as the user can't mess with it. We've already been using methods unknowingly are methods?

 

A.   create()

B.   update()

C.   remove()

D.   All of the above

8:
Which of the following is a correct way of using method?
 

 

A.   Meteor.function('pack.add', text);

B.   Meteor.apply('pack.add', text);

C.   Meteor.call('pack.add', text);

D.   All of the above

9:
Your HTML has following: {{myHelper "Hello"}} What one of the following will set output to "Hello"?

 

A.   Template.fooTemplate.helpers({ myHelper: function(myString) { output = myString; } });

B.   Template.fooTemplate.helpers({ myHelper: function(Parameters) { output = Parameters.hash.myString } });

C.   Template.fooTemplate.helpers({ myHelper: function(Parameters) { output = Parameters.myString } });

10:
How to use Meteor methods inside of a template helper?
 

 

A.   Template.helloWorld.helpers({ txt: function () { return Template.instance().myAsyncValue.get(); } }); Template.helloWorld.add = function (){ var self = this; self.myAsyncValue = new ReactiveVar("Waiting for response from server..."); Meteor.call('getAsyncValue', function (err, asyncValue) { if (err) console.log(err); else self.myAsyncValue.set(asyncValue); }); }

B.   Template.helloWorld.helpers({ txt: function () { return Template.instance().myAsyncValue.get(); } }); Template.helloWorld.created = function (){ var self = this; self.myAsyncValue = new ReactiveVar("Waiting for response from server..."); Meteor.call('getAsyncValue', function (err, asyncValue) { if (err) console.log(err); else self.myAsyncValue.set(asyncValue); }); }

C.   Both of the above

D.   None

11:
How many arguments supports Meteor methods?
 

 

A.   1

B.   2

C.   3

D.   Infinite

12:
Why do you think the client couldn't render the author name? Meteor.publish("getComments", function(){ var comments = Comments.find(); var userIds = comments.map(function(comment){ return comment.author; }); return [ comments, Users.find({_id: {$in: userIds}}) ]; })

 

A.   There is a bug in the client code.

B.   When a new user added a comment, his user information wasn't sent to the client.

C.   The publication shown above never sends user information to the client.

D.   The publication shown above is wrong

13:
Which one is used to search data in the collection MyCollection?
 

 

A.   MyCollection.find();

B.   MyCollection.fetch();

C.   MyCollection.search();

D.   MyCollection.get();

14:
Add a rule that matches against a stream of events describing method or subscription attempts. Each event is an object with the following properties?

 

A.   userId

B.   userName

C.   connectionId

D.   clientAddress

15:
Which of the following is correct syntax to provide target (server) environment for route (iron router)?

 

A.   Router.route('/files/:name_of_file', function() { //action }, { run: 'server'});

B.   Router.route('/files/:name_of_file', function() { //action }, { where: 'server'});

C.   Router.route('/files/:name_of_file', function() { //action }, { route: 'server'});

D.   Router.route('/files/:name_of_file', function() { //action }, { at: 'server'});

16:
Which of the following statement True, Using Reactive MySQL Databases in Meteor?
 

 

A.   Use SQL Sintax in client side: Get rid of minimongo limitations on grouping and unions. Use Alasql on the client and normalize mongo collections.

B.   Use a SQL Connector: Try numltel's MySql and PG connectors, or meteor-stream PG connector. The disadvantage is that they break deployments to meteor.

C.   Use mongo as a slave for relational database, keeping them in synch. MySql Shadow uses this. Also you might want to look at symmetric.ds to set mongo bidirectional replication with a lot of Sql engines.

D.   All of the above

17:
Which oe of the following is correct way to insert a template named "layout" in HTML file?
 

 

A.   {{layout}}

B.   {{#layout}}

C.   {{% layout %}}

D.   {{> layout}}

18:
Provided that markdown package is already added to your app, which one of the following is correct way to use it in template?

 

A.   template name="home"> {{#markdown}} ##Welcome to my Site {{/markdown}}

B.   template name="home"> {{markdown}} ##Welcome to my Site {{/markdown}}

C.   template name="home"> {markdown} ##Welcome to my Site {/markdown}

19:
Which of the following command created a meteor app named myApp?
 

 

A.   meteor create myApp

B.   meteor app myApp

C.   meteor -create myApp

D.   meteor -app myApp

20:
This group of callbacks is most useful for cleaning up or undoing any external effects of __ or __ groups?
 

 

A.   created

B.   onCreated

C.   onDestroyed

D.   rendered

21:
Which of the following can be used to stop the reactivity of the autorun()?
 

 

A.   Tracker.Computation.stop();

B.   Tracker.Autorun.stop();

C.   Tracker.Computation.halt();

D.   Tracker.autorun.end();

22:
Which one of the following meteor packages provides meteor template {{> loginButton}} helper?

 

A.   meteor add accounts accounts-password

B.   meteor add user accounts-password

C.   meteor add accounts-ui accounts-password

D.   meteor add user user-password

23:
Meteor find() in publish returns data despite empty selector key, read the below example code?
 

 

A.   Meteor.publish('lists', function() { var user = Meteor.users.findOne(this.userId); return Lists.find({group: user.profile.group}); });

B.   Meteor.publish('lists', function() { var user = Meteor.users.findOne(this.userId); if ( user && user.profile && user.profile.group ) return Lists.find({group: user.profile.group}); this.ready(); });

C.   Both of the above

D.   None of the above

24:
Which of the following packages are exists for reactivity?
 

 

A.   reactive-json

B.   reactive-dict

C.   reactive-var

D.   All of these. -WRONG ANS

25:
Which of the following methods in Meteor is equivalent of Jquery $(document).ready(function() { ... }); ?

 

A.   loaded

B.   rendered

C.   ready

D.   init

26:
How to make reactive UI when variable is changed in Meteor?
 

A.   Session.set('counter', 0); Template.simple.counter = function () { return Session.get('counter'); } Template.simple.events({ 'click button': function () { Session.set('counter', Session.get('counter') + 1); } });

B.   Template.set('counter', 0); Template.simple.counter = function () { return Session.get('counter'); } Template.simple.events({ 'click button': function () { Template.set('counter', Template.get('counter') + 1); } });

C.   Template.get('counter', 0); Template.simple.counter = function () { return Session.set('counter'); } Template.simple.events({ 'click button': function () { Session.set('counter', Session.get('counter') + 1); } });

D.   All of the above

27:
Which one of the following rule allow user to edit 'roles' property?
 

 

A.   Meteor.account.allow()

B.   Meteor.permission.allow()

C.   Meteor.roles.allow()

D.   Meteor.users.allow()

28:
Which of the following is not a valid HTTP request?
 

 

A.   HTTP.post(“http://someUrl”, postData, …);

B.   HTTP.get(“http://someUrl”, … );

C.   HTTP.request("GET", “http://someUrl”, … );

D.   HTTP.call("GET", “http://someUrl”, … );

29:
From the list below, select the option that is not satisfied with Regular Expression searching?
 

 

A.   Regular Expression Search is real-time

B.   Regular Expression Search can match partial words

C.   Regular Expression Search is very efficient

D.   Regular Expression Search does not support wildcard searches

30:
What's the correct way to get this value on the client, Choose from the following options? { "public": { "facebook": { "token": "he882939201kl28819302" } } }

 

A.   Meteor.settings.facebook.token

B.   Meteor.settings.public.token

C.   Meteor.public.facebook.token

D.   Meteor.settings.public.facebook.token

31:
Which of the following examples will set usernames instead of email in accounts?
 

 

A.   Accounts.ui.config({ username: true, email: false });

B.   Accounts.ui.config({ passwordSignupFields: 'USERNAME_ONLY', });

C.   Accounts.ui.config({ userNameOnly: true });

D.   Accounts.ui.config({ email: false });

32:
How can access the name of the current route in when using router?
 

 

A.   Handlebars.registerHelper('ifRouteIs', function (routeName) { return Meteor.Router.page() === routeName; });

B.   Handlebars.registerHelper('ifRouteIs', function (routeName, options) { if (Meteor.Router.page() === routeName) { return options.fn(this); } return options.inverse(this); });

C.   Handlebars.registerHelper.helper('ifRouteIs', function (routeName, options) { if (Meteor.Router.page() === routeName) { return options.fn(this); } return options.inverse(this); });

D.   All of the above

33:
Which of the following is correct to not allow users to create account?
 

 

A.   Accounts.config({ closeClientAccountCreation: true });

B.   Accounts.config({ forbidAccountCreation: true });

C.   Accounts.config({ forbidClientAccountCreation: true });

D.   Accounts.config({ closeAccountCreation: true });

34:
To restrict the database updates so that no client can simply make changes to database?
 

 

A.   meteor add secure

B.   meteor add password

C.   meteor remove insecure

D.   meteor add policy

35:
Which of the following API is correct to use for prevent the user login?
 

 

A.   Accounts.validateLoginAttempt

B.   Accounts.validateLogin

C.   Accounts.loginAttempt

D.   Accounts.validateLoginAttempts

36:
To add an admin role to user which one of the following is correct?
 

 

A.   Meteor.users.add(userId, {$set: { roles: {admin: true}, }});

B.   Meteor.users.create(userId, {$set: { roles: {admin: true}, }});

C.   Meteor.users.update(userId, {$set: { roles: {admin: true}, }});

D.   Meteor.users.permission(userId, {$set: { roles: {admin: true}, }});

37:
Where I can find the current Meteor build version?
 

 

A.   Simple, open Chrome console and type: Meteor.release() , you can also use it in code.

B.   Simple, open Chrome console and type: Meteor.update() , you can also use it in code.

C.   Simple, open Chrome console and type: Meteor.soon() , you can also use it in code.

D.   All of the above

38:
Which of the following are the flows of accounts-password package?
 

 

A.   User enrollment

B.   Email verification

C.   Reset password

D.   All of these.

39:
Which of the following packages using for creating different user account functionalities in Meteor?

 

A.   satelizer

B.   accounts-base

C.   auth-strategy

D.   auth-base

40:
Using the following code, How to detect if users authenticated?
 

 

A.   var loginRun; Template.bar.rendered = function() { loginRun = Deps.autorun(function() { if(Meteor.user()) { //Stuff to run when logged in } }); } Template.bar.destroyed = function() { loginRun.stop(); }

B.   var loginRun; Templates.bar.rendered = function() { loginRun = Deps.autorun(function() { if(Meteor.user()) { //Stuff to run when logged in } } } Template.bar.destroyed = function() { loginRun.stop(); }

C.   var loginRun; loginRun = Deps.autorun(function() { if(Meteor.user()) { //Stuff to run when logged in } }); Template.bar.destroyed = function() { loginRun.stop(); }

D.   All of the above

41:
Which of the following templates shows login dropdown?
 

 

A.   {{> loginButtons}}

B.   {{> loginDropDown}}

C.   {{> login}}

D.   {{> loginForm}}

42:
Which of the following packages using for login forms?
 

 

A.   login-forms

B.   accounts-forms

C.   accounts-ui-unstyled

D.   accounts-ui -WRONG ANS

43:
Which of the following is correct defining of route?
 

 

A.   Router.route = {register: 'register'}

B.   Router.route('register');

C.   Router.route('/register');

D.   Router.route('/&?register');

44:
Which of the following meteor function makes every function pass to it reactive?
 

 

A.   Tracker.reactive()

B.   Template.autorun()

C.   Tracker.autorun()

D.   Template.execute()

45:
Meteor takes modern web apps to the next level, It enhances and builds upon the nested MVC design pattern by implementing key features?

 

A.   Data On The Wire through the Distributed Data Protocol (DDP)

B.   Latency Compensation with Mini Databases

C.   Full Stack Reactivity with Blaze and Tracker

D.   All of the above

46:
This solution works, but it has an issue. What is it? Meteor.subscribe("getCommets"); var userSubs = new SubsManager(); Template.comments.helpers({ getComments: function(){ return Comments.find(); }, author: function(){ var user = Users.findOne(this.author); if(user){ return user.name; }else{ userSubs.subscribe("getUser", this.author); } } })

 

A.   There will be a lot of "getComments" subscriptions just after we add a comment

B.   There will be a lot of "getComments" subscriptions just after the page loads

C.   There will be a lot of "getUser" subscriptions just after we add a comment

D.   There will be a lot of "getUser" subscriptions just after the page loads

47:
Meteor show objects only if logged in reactive?
 

 

A.   {{#if currentUser}} <button id="submit-btn">Click me</button> {{else}} <p id="submit-text">Please log in to submit</p> {{/if}}

B.   Template.newPost.rendered= function(){ if(Meteor.user()){ $('#submit-btn').show(); $('#submit-text').hide(); } else{ $('#submit-btn').hide(); $('#submit-text').show(); } }

C.   Template.newPost.rendered= function(){ if(Meteor.user()){ $('#submit-btn').show(); $('#submit-text').hide(); } }

D.   All of the above

48:
How can a variable type validate?
 

 

A.   patternMatch(myVar, String);

B.   test(myVar, String);

C.   match(myVar, String);

D.   check(myVar, String);

49:
Using iron router which one of the following is correct syntax for route?
 

 

A.   Router.map(function() { this.router('Home', { route: '/' template: 'home' }); });

B.   Router.mapper(function() { this.router('Home', { path: '/', template: 'home' }); });

C.   Router.map(function() { this.route('Home', { path: '/', template: 'home' }); });

50:
Meteor reactive subscriptions, study the following code and choose the right answer?
 

 

A.   $meteorUtils.autorun($scope, function() { $meteorSubscribe.subscribe('aPublication', $scope.getReactively('parameter')) .then(function(){ alert("You subscribed !"); }); });

B.   Meteor.publish("aPublication", function (parameter) { ACollection.find({'aProperty':'parameter'}) $subscribe.subscribe('aPublication',$scope.parameter).then(function(){ alert("You subscribed !"); });

C.   Both of the above

D.   None of the above