Skip to content

Commit

Permalink
Formatting part 2 (Ebazhanov#1023)
Browse files Browse the repository at this point in the history
* - formatting#2
  • Loading branch information
Ebazhanov authored Jan 22, 2021
1 parent f0cb7f8 commit 3af038b
Show file tree
Hide file tree
Showing 37 changed files with 361 additions and 823 deletions.
148 changes: 74 additions & 74 deletions README.md

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions agile-methodologies/agile-methodologies-quiz.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ It is suggested that high business value, high-risk items are worked on first. W
- [ ] This is not a good idea unless there has been recent employee feedback that people feel underappreciated.
- [ ] It is a good idea as long as a different person is recognized in each sprint.
- [ ] It is a good idea because awards can motivate people to do their best.
- [x] This is not a good idea because it can destroy the team unity that is essential to achieving high performance. <<<---CORRECT
- [x] This is not a good idea because it can destroy the team unity that is essential to achieving high performance.

#### Q19. What is a difference between a team's task board and a Kanban?
- [ ] A Kanban has an explicit rule to limit WIP.
Expand Down Expand Up @@ -261,7 +261,7 @@ It is suggested that high business value, high-risk items are worked on first. W
- [ ] Use a lottery system assign each story.
- [ ] Share your observation with the team and invite them to own and solve the problem.
- [ ] During story point estimation increase the points assigned to the least interesting stories so the team can boost their velocity.
- [x] Ask the Tech Lead to assign every story to a developer so they all get done efficiently and with accountability. //Answer?
- [x] Ask the Tech Lead to assign every story to a developer so they all get done efficiently and with accountability.

#### Q44. What Agile practice best supports this principle: "At regular intervals, the team reflects on how to become more effective, then tunes and adjusts its behavior accordingly"?
- [ ] Sprint Review
Expand All @@ -272,7 +272,7 @@ It is suggested that high business value, high-risk items are worked on first. W
#### Q45. On what are personas typically based?
- [ ] a sponsors or team members' personalities and traits
- [ ] what the developers think is user friendly
- [x] real people, archetypal users, or composites of multiple users //Answer?
- [x] real people, archetypal users, or composites of multiple users
- [ ] descriptions of the product's functionality and use

#### Q46. Which statement describes Shu Ha Ri?
Expand Down
12 changes: 6 additions & 6 deletions bash/bash-quiz.md
Original file line number Diff line number Diff line change
Expand Up @@ -263,11 +263,11 @@ echo ${!fname}
- [ ] `blank`
#### Q30. What will be the output of this script?
![question](questionimages/Q30/question.png)
- [ ] `A` ![A](questionimages/Q30/A.png)
- [ ] `B` ![B](questionimages/Q30/B.png)
- [x] `C` ![C](questionimages/Q30/C.png)
- [ ] `D` ![D](questionimages/Q30/D.png)
![question](images/Q30/question.png)
- [ ] `A` ![A](images/Q30/A.png)
- [ ] `B` ![B](images/Q30/B.png)
- [x] `C` ![C](images/Q30/C.png)
- [ ] `D` ![D](images/Q30/D.png)
Here a text based version of Q.30:
Expand Down Expand Up @@ -541,7 +541,7 @@ cd -
- [ ] It deletes the current directory
- [ ] It moves you one directory above your current working directory.
Training questions
# Training questions
#### Q1. What does this command do?
```bash
Expand Down
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
96 changes: 44 additions & 52 deletions c++/c++quiz.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## C++

#### Q1. What is printed from this code?
```c++
```
vector<int> v(22);
bool b= (v[6]);
printf("%d",!b);
Expand All @@ -12,16 +12,14 @@ printf("%d",!b);
- [ ] This code has an error

#### Q2. Which of the following is a reason why using this line is considerd a bad practice?
```
Using namespce std;
```
`Using namespce std;`
- [ ] The compiled code is always bigger because of all of the imported symbols.
- [ ] If the code uses the function defined in two different libraries with the same prototype but possibly with different implementation , there will be a compilation error due to ambuiguity.
- [ ] It automatically includes all header files in the standard library (cstdint,cstdlib,cstdio,iostream et- []. << Correct
- [ ] It causes the compiler to enforce the exclusion , inclusion of header file belonging to the standard library , generating compilation error when a different header file is included.

#### Q3. What is the smallest size a variable of the type child_t may occupy in memory?
```c++
```
typedef struct {
unsigned int age : 4;
unsigned char gender :1;
Expand All @@ -34,7 +32,7 @@ unsigned int size : 2;
- [ ] 1 bytes.

#### Q4. Which of the following shows the contents of vector v1 and v2 after running this code?
```c++
```
std:: vector <int> v1{1,2,3},v2;
v2=v1;
v1.push_back(4);
Expand Down Expand Up @@ -62,11 +60,11 @@ v2:{1,2,3,5}; << Correct
- [ ] There are no benefits because a reference and an object are treated as the same thing.

#### Q7. What's the storage occupied by u1?
```c++
```
union {
unit16_t a;
unit32_t b;
int8_t c;
unit16_t a;
unit32_t b;
int8_t c;
} u1;
```
- [x] 4 bytes //You can see example [here](https://en.cppreference.com/w/cpp/language/union)
Expand All @@ -76,12 +74,12 @@ int8_t c;

#### Q8. Which of the following operators is overloadable?
- [ ] ?:
- [x] new << Correct
- [x] new
- [ ] ::
- [ ] .

#### Q9. Which of the following shows the contents of vector pointed by v1 and v2 after running this code?
```c++
```
std:: vector<int> *v1 = new std:: vector<int> ({1,2,3});
std:: vector<int> *v2;
v2=v1;
Expand All @@ -95,25 +93,23 @@ v2->push_back(5);
- [x] Error
- [ ] *v1:{1,2,3,4};
*v2:{1,2,3,5};

#### Q10. Which of the following is not a difference between a class and a struct?
- [ ] Because structor are part of the c programming language there some complexity between c and c++ struct This is not the case with classes.
- [ ] Classes may have member function;struct private.
- [ ] The default acces specifier for members of struct is public, where as for member of class , it is private. << Correct -> You can see the answer [here](https://www.fluentcpp.com/2017/06/13/the-real-difference-between-struct-class/)
- [ ] Template type parameters can be declared with , but not with the struct keyword.

#### Q11. Suppose you need to keep a data struct with permission to access some resource base on the days of week , but you can't be use a bool variable for each day.you need to use one bit per day of the week.
which of the following is a correct implementation of a structure with bit fields for this application?
- [ ]
- [x]
```
typedef struct {
int sunday:1;
int monday:1;
// more days
int friday:1;
int satarday:1;
int sunday:1;
int monday:1;
// more days
int friday:1;
int satarday:1;
} weekdays; << Correct That syntax says that each variable size is 1 bit. 'bit' is not a type in C++.
```
- [ ]
Expand All @@ -123,21 +119,21 @@ typedef char[7]: weekdays;
- [ ]
```
typedef struct {
bit sunday:1;
bit monday:1;
// more days
bit fridyas:1;
bit satarday:1;
bit sunday:1;
bit monday:1;
// more days
bit fridyas:1;
bit satarday:1;
} weekdays;
```
- [ ]
```
typedef struct {
bit sunday;
bit monday;
// more days
bit friday;
bit satarday;
bit sunday;
bit monday;
// more days
bit friday;
bit satarday;
} weekdays;
```

Expand Down Expand Up @@ -176,10 +172,10 @@ y=b;
#include <iostream>
int main()
{
int x=10, y=20;
std::cout << "x = " << x++ << " and y = " << --y << std::endl;
std::cout << "x = " << x-- << " and y = " << ++y << std::endl;
return(0);
int x=10, y=20;
std::cout << "x = " << x++ << " and y = " << --y << std::endl;
std::cout << "x = " << x-- << " and y = " << ++y << std::endl;
return(0);
}
```
- [ ] x = 10 and y = 20 x = 11 and y = 19
Expand All @@ -198,14 +194,14 @@ return(0);
int8_t a=200;
uint8_t b=100;
- if(a>b) {
std::cout<<"greater";
else std::cout<<"less";
std::cout<<"greater";
else std::cout<<"less";
}
```
- [x]There is no output because there is an exception when comparing an int8_t with a uint8t.There is no output because there is an exception when comparing an null with a null.
- [ ]greaternull
- [ ]lessnull
- [ ]There is no output because there is a compiler error.There is no output because there is a compiler error.
- [x] There is no output because there is an exception when comparing an int8_t with a uint8t.There is no output because there is an exception when comparing an null with a null.
- [ ] greaternull
- [ ] lessnull
- [ ] There is no output because there is a compiler error.There is no output because there is a compiler error.

#### Q.19 What results from executing this code snippet? What results from executing this code snippet?
```
Expand All @@ -214,10 +210,10 @@ if(x & y)
{ /_part A_/ }
else{ /_part B_/ }
```
- [] Part A executes because x==5 (true) and y==2 (true), thus the AND operation evaluates as true. << wrong
- [] Part B executes because (x & y) results in 0, or false.Part B executes because null results in 0, or false. << correct
- [] ?
- [] ?
- [ ] Part A executes because x==5 (true) and y==2 (true), thus the AND operation evaluates as true. << wrong
- [ ] Part B executes because (x & y) results in 0, or false.Part B executes because null results in 0, or false. << correct
- [ ] ?
- [ ] ?

#### Q.20 What is a valid definition for the get_length function, which returns the length of a null-terminated string? What is a valid definition for the null function, which returns the length of a null-terminated string?
- [ ] int get_length(char *str){ int count=0; while(str[count++]); return count-1; }
Expand Down Expand Up @@ -267,9 +263,7 @@ std::printf("c is %d and d is %c",c,d);
- [ ] c is c and d is d

#### Q.26 What is the output of this code?
```
printf("1/2 = %f",(float)(1/2));
```
`printf("1/2 = %f",(float)(1/2));`
- [ ] /2 = 0.499999
- [ ] 1/2 = 0
- [x] 1/2 = 0.000000
Expand All @@ -289,7 +283,7 @@ std::printf("c is %d and d is %c",c,d);
- [ ] 3
- [ ] 7
- [ ] -3
- [ ] 13
- [ ] 13

### Q.29 Which statement is true?
- [ ] Only classes can have member variables and methods.
Expand Down Expand Up @@ -329,9 +323,7 @@ std::printf("c is %d and d is %c",c,d);
C = *(str+4);

#### Q.33 What is the output of this code?
```
printf("1/2 = %f",(float)(1/2));
```
`printf("1/2 = %f",(float)(1/2));`
- [ ] 1/2 = 0.499999
- [ ] 1/2 = 0
- [x] 1/2 = 0.000000
Expand Down
4 changes: 0 additions & 4 deletions c-(programming-language)/c-quiz.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,15 @@

##### Q1. Which Code saple will eventually cause the computer to run out of memory ?
- [x]

```
while(1)
{
char *smallString = (char *) malloc(10);
}
```
- [ ]

```
long long number = 1;
while(1)
number *= 2;
```
Expand All @@ -25,7 +22,6 @@ while(1)
memset(hugeString, 0, 1000000L);
}
```

- [ ]
```
while(1)
Expand Down
Loading

0 comments on commit 3af038b

Please sign in to comment.