From 3028a3ee8e9d8729377557bb9a68d56e3f6d3318 Mon Sep 17 00:00:00 2001 From: abregman Date: Mon, 21 Oct 2019 20:08:03 +0300 Subject: [PATCH] Fix python mutable vs. immutable answer Thanks to surister for explaining why using id() is not a valid answer. Also added a couple of questions. --- README.md | 41 +++++++++++++++++++++++++++++++++++------ 1 file changed, 35 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index bccc5f8..dc75ecc 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ :information_source:  This repository contains interview questions on various DevOps related topics -:bar_chart:  There are currently **338** questions +:bar_chart:  There are currently **343** questions :warning:  You don't need to know how to answer all the questions in this repo. DevOps is not about knowing all :) @@ -1001,7 +1001,7 @@ While an A record points a domain name to an IP address, a PTR record does the o
-What's happening in the following code?: +What does the following block do?: ``` open("/my/file") = 5 @@ -1009,7 +1009,7 @@ read(5, "file content") ```
-those are system calls for reading the file /my/file and 5 is the file descriptor number. +These system calls are reading the file /my/file and 5 is the file descriptor number.
@@ -1552,9 +1552,7 @@ The immutable data types are: Bool Tuple -The id function can be used to check if a given variable is mutable or not. -For example if you set a variable this way x = 2 and then run the id function this way id(x) you will get an ID which will be different once you change the variable x (like x = x + 5). -With mutable types, like list, you can modify the variable and the id will stay the same. Try to define a list and then append an item to it. +You can usually use the function hash() to check an object mutability, if it is hashable it is immutable, although this does not always work as intended as user defined objects might be mutable and hashable
@@ -1897,11 +1895,28 @@ This should be answered based on your usage but some examples are: * fmt - formatted I/O
+
+What is the problem with the following block of code? How to fix it? + +``` +func main() { + var x float32 = 13.5 + var y int + y = x +} +``` +
+
+ ## Mongo #### :baby: Beginner +
+What are the advantages of MongoDB? Or in other words, why choosing MongoDB and not other implementation of NoSQL?
+
+
What is the difference between SQL and NoSQL?
@@ -1921,6 +1936,20 @@ This should be answered based on your usage but some examples are: What is an aggregator?
+
+What is better? embedded documents or referenced?
+
+ +##### Queries + +
+Explain this query: db.books.find({"name": /abc/})
+
+ +
+Explain this query: db.books.find().sort({x:1})
+
+ ## OpenShift