1. Difficult MongoDB interview questions:
► What is your greatest fear?
► Give an example of risk that you had to take. Why did you decide to take the risk?
► What would you say are your strong points?
► How did you get work assignments at your most recent employer?
► How would you decide on your objectives?
► Who else have you applied to/got interviews with?
How to answer these MongoDB interview questions: Think positively. Think of what you have learn from this experience. Don't stress yourself with the idea of winning or losing. Show that you are willing to take on the necessary job functions. Describe your weaknesses as strengths.
What can you bring to the company? Speak out as if you are hired by the company.
2. MongoDB interview questions for Phone interview:
► Do you have any questions for MongoDB management?
► What kinds of situations do you find most stressful?
► Situation in which you had to arrive at a compromise.
► What are your weaknesses?
► Would you rather write a report or give it verbally?
► What is your personal mission statement?
► What is the most difficult thing about working with you?
In addition to appearance, demonstrate a cheerful and outgoing personality.
Don't spend a lot of time on this question.
Just confine your words to better opportunities. Answer all MongoDB interview questions honestly and stay focused throughout the hiring process. Your answer should be focused on what you can bring to the role that will be of benefit to the employer
3. MongoDB interview questions for Case job interview:
► How much preparation on files for trial do you do?
► Describe some ideas that were implemented.
► What are your salary requirements at MongoDB?
► How did you go about making assignments?
► Situation in which you had to arrive at a compromise.
► What do you think, would you be willing to travel for work?
4. MongoDB interview questions for Structured job interview:
► Example when you went above and beyond the call of duty.
► Time when you had to make an important decision.
► Give examples of ideas you've had or implemented.
► How would you describe the experience of working at MongoDB?
► What would you say are your strong points?
► What are your salary increases?
► What salary are you seeking at MongoDB?
5. MongoDB interview questions for Face to Face interview:
► What was your most difficult decision?
► Example of a time you have placed yourself in a leadership position.
► What can you contribute to MongoDB?
► What's your salary history?
► What is more important to you: the money or the work at MongoDB?
► What are your career plans at MongoDB?
Be sure to discuss a very specific example.
Answer MongoDB interview questions honestly and to the best of your ability. For some, this is the most challenging question to answer. As interviewers may ask you to elaborate on certain issues, you may want to read some articles about such issues.
Make sure the experience is relevant.
6. MongoDB interview questions for General interview:
► Do you have any questions for MongoDB management?
► What type of management style do you thrive under?
► Could you describe a difficult problem and how you dealt with it?
► Give me an example of a high-pressure situation.
► Why do you believe you are qualified for this job?
► How do you think I rate as an interviewer?
► How did you assemble the information?
7. What is the role of analyzer in MongoDB?
MongoDB includes a display the operating property database each database analyzer. Through this analyzer you can find the slower than expected query (or write); using this information, for example, to determine whether there is a need to add index.
8. What are the subtle distinction between the 32 bit system?
Journaling activates the memory mapped file additional. This will further suppress the size of the database is a 32 bit version. Therefore, journaling is now the 32 bit system is disabled by default.
9. How do you compareMongoDB, CouchDB and CouchBase?
MongoDB and CouchDB are document oriented database. MongoDB and CouchDB are the most typical representative of the open source NoSQL database. They have nothing in common other than are stored in the document outside. MongoDB and CouchDB, the data model interface, object storage and replication methods have many different.
10. Explain what is the basic difference between 3 MySQL and MongoDB?
Both MySQL and MongoDB are free open source database. MySQL and MongoDB have many fundamental differences including data representation (data representation), query, relationship, business, design and definition of schema, the standard (normalization), speed and performance. Through the comparison of MySQL and MongoDB, we are in fact more relational and non relational database.
11. What types of 2 NoSQL database?
For example: MongoDB, Cassandra, CouchDB, Hypertable, Redis, Riak, Neo4j, HBASE, Couchbase, MemcacheDB, RevenDB and Voldemort are the examples of NoSQL databases.
13. Explain if a moveChunk fails do I need to cleanup the partially moved docs?
No, chunk moves are consistent and deterministic; the move will retry and when completed the data will only be on the new shard.
14. How to see the connections used by mongos?
db._adminCommand("connPoolStats");
15. Tell me can I remove old files in the moveChunk directory?
Yes, these files are made as backups during normal shard balancing operations. Once the operations are done then they can be deleted. The cleanup process is currently manual so please do take care of this to free up space.
16. Explain what if a shard is down or slow and I do a query?
If a shard is down, the query will return an error unless the "Partial" query options is set. If a shard is responding slowly, mongos will wait for it.
17. Explain what happens if I try to update a document on a chunk that is being migrated?
The update will go through immediately on the old shard, and then the change will be replicated to the new shard before ownership transfers.
18. Tell me when will data be on more than one shard?
MongoDB sharding is range based. So all the objects in a collection get put into a chunk. Only when there is more than 1 chunk is there an option for multiple shards to get data. Right now, the default chunk size is 64mb, so you need at least 64mb for a migration to occur.
19. Explain how does sharding work with replication?
Each shard is a logical collection of partitioned data. The shard could consist of a single server or a cluster of replicas. We recommmend using a replica set for each shard.
20. Tell me should I start out with sharded or with a non-sharded MongoDB environment?
We suggest starting unsharded for simplicity and quick startup unless your initial data set will not fit on single servers. Upgrading to sharding from unsharded is easy and seamless, so there is not a lot of advantage to setting up sharding before your data set is large.
21. Explain do I have to call getLastError to make a write durable?
No. If you don't call getLastError (aka "Safe Mode") the server does exactly the same behavior as if you had. The getLastError call simply lets one get confirmation that the write operation was successfully committed. Of course, often you will want that confirmation, but the safety of the write and its durability is independent.
22. What is a secondary or slave?
A secondary is a node/member which applies operations from the current primary. This is done by tailing the replication oplog (local.oplog.rs).
Replication from primary to secondary is asynchronous, however the secondary will try to stay as close to current as possible (often this is just a few milliseconds on a LAN).
23. What is a master or primary?
This is a node/member which is currently the primary and processes all writes for the replica set. In a replica set, on a failover event, a different member can become primary.
24. Explain how long does replica set failover take?
It may take 10-30 seconds for the primary to be declared down by the other members and a new primary elected. During this window of time, the cluster is down for "primary" operations – that is, writes and strong consistent reads. However, you may execute eventually consistent queries to secondaries at any time (in slaveOk mode), including during this window.
25. Tell me why are my data files so large?
MongoDB does aggressive preallocation of reserved space to avoid file system fragmentation.
26. How to do transactions/locking?
MongoDB does not use traditional locking or complex transactions with rollback, as it is designed to be lightweight and fast and predictable in its performance. It can be thought of as analogous to the MySQL MyISAM autocommit model. By keeping transaction support extremely simple, performance is enhanced, especially in a system that may run across many servers.
27. Does an update fsync to disk immediately?
No, writes to disk are lazy by default. A write may hit disk a couple of seconds later. For example, if the database receives a thousand increments to an object within one second, it will only be flushed to disk once. (Note fsync options are available though both at the command line and via getLastError_old.)
28. Explain are null values allowed?
For members of an object, yes. You cannot add null to a database collection though as null isn't an object. You can add {}, though.
30. Suppose if you remove an object attribute is it deleted from the store?
Yes, you remove the attribute and then re-save() the object.
MongoDB stores BSON objects in collections. The concatenation of the database name and the collection name (with a period in between) is called a namespace.
32. What is role of Profiler in MongoDB?
MongoDB includes a database profiler which shows performance characteristics of each operation against the database. Using the profiler you can find queries (and write operations) which are slower than they should be; use this information, for example, to determine when an index is needed.
Each journal (group) write is consistent and won't be replayed during recovery unless it is complete.
34. Do you know what is 32 bit nuances?
There is extra memory mapped file activity with journaling. This will further constrain the limited db size of 32 bit builds. Thus, for now journaling by default is disabled on 32 bit systems.
35. Tell me what makes MongoDB best?
Following features of MongoDB make it best NoSQL database:
Document-oriented
High performance
High availability
Easy scalability
Rich query language