From 8f797e2cb473dab69470cf2f76942e1cbcbb6621 Mon Sep 17 00:00:00 2001
From: Marco Biedermann
Date: Tue, 10 Nov 2020 09:18:21 +0100
Subject: [PATCH] Feature: Format files using Prettier code formatter (#737)
* chore: Prettier
Add Prettier to format files
* chore: Pre-commit
Format staged files using pre-commit hook
* style: Format
Format files using Prettier code formatter
Co-authored-by: Evgenii
---
.github/workflows/greetings.yml | 10 +-
.gitignore | 1 +
.huskyrc | 5 +
.prettierrc | 5 +
AngularJS/angularjs-quiz.md | 382 +++++-----
CONTRIBUTING.md | 14 +-
README.md | 120 ++--
_config.yml | 2 +-
adobe-illustrator/adobe-illustrator-quiz.md | 7 +-
adobe-photoshop/adobe-photoshop-quiz.md | 88 ++-
.../agile-methodologies-quiz.md | 146 +++-
android/android-quiz.md | 29 +-
aws-lambda/aws-lambda-quiz.md | 62 +-
aws/aws-quiz.md | 48 +-
bash/bash-quiz.md | 91 +--
c (programming language)/c quiz.md | 82 ++-
c#/c-sharp-quiz.md | 105 +--
c++/c++quiz.md | 344 +++++----
css/css-quiz.md | 178 ++---
django/django-quiz.md | 386 +++++-----
dotnet-framework/dotnet-framework-quiz.md | 313 ++++-----
git/git-quiz.md | 33 +-
google-analytics/google-analytics-quiz.md | 70 +-
google-cloud-platform/gcp-quiz.md | 52 +-
hadoop/hadoop-quiz.md | 48 +-
html/html-quiz.md | 193 ++---
html/images/html-images-folder.md | 2 +-
java/java-quiz.md | 72 +-
javascript/codesandbox.js | 14 +-
javascript/javascript-quiz.md | 301 ++++----
jquery/jquery-quiz.md | 207 ++----
json/json-quiz.md | 261 +++----
machine-learning/machine-learning-quiz.md | 229 +++---
maven/maven-quiz.md | 3 +-
microsoft-azure/microsoft-azure-quiz.md | 123 ++--
microsoft-excel/microsoft-excel-quiz.md | 121 ++--
microsoft-power-bi/microsoft-power-bi-quiz.md | 36 +-
.../microsoft-power-point-quiz.md | 27 +-
microsoft-project/microsoft-project-quiz.md | 170 +++--
microsoft-word/microsoft-word-quiz.md | 5 +-
mongodb/mongodb-quiz.md | 218 +++---
mysql/mysql-quiz.md | 13 +-
node.js/node.js-quiz.md | 146 ++--
nosql/nosql-quiz.md | 184 ++---
objective-c/objective-c_quiz.md | 72 +-
oop/object-oriented-programming-quiz.md | 99 ++-
package-lock.json | 657 ++++++++++++++++++
package.json | 10 +-
php/php-quiz.md | 291 ++++----
python/python-quiz.md | 150 +++-
r/r-quiz.md | 4 +-
react/reactjs-quiz.md | 140 ++--
rest-api/rest-api-quiz.md | 2 +-
ruby-on-rails/ruby-on-rails-quiz.md | 9 +-
scala/scala-quiz.md | 70 +-
seo/search-engine-optimization-quiz.md | 95 ++-
sharepoint/sharepoint-quiz.md | 112 ++-
swift/swift-quiz.md | 71 +-
t-sql/t-sql-quiz.md | 69 +-
windows-server/windows-server-quiz.md | 150 ++--
wordpress/wordpress-quiz.md | 133 ++--
xml/xml-quiz.md | 10 +-
62 files changed, 4218 insertions(+), 2872 deletions(-)
create mode 100644 .huskyrc
create mode 100644 .prettierrc
create mode 100644 package-lock.json
diff --git a/.github/workflows/greetings.yml b/.github/workflows/greetings.yml
index 6e63712807..fdd0946f98 100644
--- a/.github/workflows/greetings.yml
+++ b/.github/workflows/greetings.yml
@@ -7,8 +7,8 @@ jobs:
name: Hello new contributor
runs-on: ubuntu-latest
steps:
- - uses: actions/first-interaction@v1
- with:
- repo-token: ${{ secrets.GITHUB_TOKEN }}
- # pr-message: 'Hello @${{ github.actor }} , thank you for submitting a pull request, we appreciate it a lot! If you feel this repository helped you to achieve your goals, warm us with a cup of :coffee:. 🙂'
- issue-message: 'Hello @${{ github.actor }} , thank you for submitting an issue! đź‘Ť We highly appreciate if you work on it as well.'
+ - uses: actions/first-interaction@v1
+ with:
+ repo-token: ${{ secrets.GITHUB_TOKEN }}
+ # pr-message: 'Hello @${{ github.actor }} , thank you for submitting a pull request, we appreciate it a lot! If you feel this repository helped you to achieve your goals, warm us with a cup of :coffee:. 🙂'
+ issue-message: 'Hello @${{ github.actor }} , thank you for submitting an issue! đź‘Ť We highly appreciate if you work on it as well.'
diff --git a/.gitignore b/.gitignore
index ad43be0cc7..08835bc225 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,4 @@
.idea
.DS_Store
*.bak
+node_modules
\ No newline at end of file
diff --git a/.huskyrc b/.huskyrc
new file mode 100644
index 0000000000..bb8301700f
--- /dev/null
+++ b/.huskyrc
@@ -0,0 +1,5 @@
+{
+ "hooks": {
+ "pre-commit": "pretty-quick --staged"
+ }
+}
\ No newline at end of file
diff --git a/.prettierrc b/.prettierrc
new file mode 100644
index 0000000000..5e2863a11f
--- /dev/null
+++ b/.prettierrc
@@ -0,0 +1,5 @@
+{
+ "printWidth": 100,
+ "singleQuote": true,
+ "trailingComma": "all"
+}
diff --git a/AngularJS/angularjs-quiz.md b/AngularJS/angularjs-quiz.md
index d61ffe9bb1..53432ea3ba 100644
--- a/AngularJS/angularjs-quiz.md
+++ b/AngularJS/angularjs-quiz.md
@@ -1,191 +1,191 @@
-## AngularJs LinkedIn Assessment Questions Answers (Left)
-
-Q1. What is the purpose of the ViewChild decorator in this component class?
-
- @Component({
- . . .
- template: ''
- })
- export class UserDetailsComponent {
- @ViewChild('bio') bio;
- }
-
- a) It provides access from within the component class to the ElementRef object for the
tag that has the bio template reference variable in the component's template view. It provides access from within the component class to the null object for the null tag that has the null template reference variable in the component's template view.
- b) It indicates that the
tag be rendered as a child of the parent view that uses this component. It indicates that the null tag be rendered as a child of the parent view that uses this component.
- c) It makes the
tag in the template support content projection. It makes the null tag in the template support content projection.
- d) It makes the
tag visible in the final render. If the #bio was used in the template and the @ViewChild was not used in the class, then Angular would automatically hide the
tag that has #bio on it.
-
-Q2. What method is used to wire up a FormControl to a native DOM input element in reactive forms? What method is used to wire up a null to a native DOM input element in reactive forms?
-
- a) Add the string name given to the FormControl to an attribute named controls on the
#### Q9. You have classified the features in your backlog according to risk and value. Which features should the development team work on first?
+
- [ ] low-value and high-risk
- [x] high-value and high-risk
- [ ] high-value and low-risk
@@ -67,397 +76,462 @@ It is suggested that high business value, high-risk items are worked on first. W
#### Q10. In the Scaled Agile Framework, what is the role of Enablers?
+
- [x] They help extend the Architectural Runway.
- [ ] They connect vision to mission so the organization can be successful.
- [ ] They support team building.
- [ ] They remove the impediments to quality.
#### Q11. Which outcome is not expected of a Sprint Review?
+
- [ ] The team demonstrates its completed work.
- [x] The team reflects on how to improve its performance.
- [ ] Items in the backlog may be reprioritized.
- [ ] Stakeholders give feedback about the work completed.
#### Q12. What is not a technique used for splitting user stories?
+
- [ ] split by line-of-business
- [x] split compound user stories
- [ ] split by alternative paths
- [ ] split by interface
#### Q13. Who decides what the team will work on?
+
- [ ] the Scrum Master
- [x] a self-organizing team
- [ ] the Product Owner
- [ ] the Product Manager
#### Q14. Which choice is not a Scrum value?
+
- [ ] focus
- [x] integrity
- [ ] courage
- [ ] commitment
#### Q15. What should happen if the Product Owner does not accept a story by the end of the iteration?
+
- [ ] The team does not get credit for the story's points in its velocity calculation.
- [ ] The story should be sliced to reflect the work completed.
- [ ] The acceptance criteria should be adjusted to reflect the work completed.
- [x] The story should be shown to stakeholders for their feedback.
#### Q16. Which statement is not true about the product backlog?
+
- [x] It is a list of work items that are behind schedule.
- [ ] The items are maintained in priority order.
- [ ] Anyone on the team can propose an item for it.
- [ ] It includes all of the work to be done.
#### Q17. A project has some major risks that the team wants to mitigate. What is the best way to monitor how well this effort is going?
+
- [ ] risk-based spike
- [ ] risk-adjusted backlog
- [ ] risk velocity chart
- [x] risk burndown graph
#### Q18. The VP of engineering wants to start a Team Member of the Sprint Award to recognize a top performer in each group. What would you advise the VP?
+
- [ ] 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
#### Q19. What is a difference between a team's task board and a Kanban?
+
- [ ] A Kanban has an explicit rule to limit WIP.
- [ ] A Kanban shows the backlog of work.
- [ ] A Kanban does not use a Definition of Done.
- [x] A Kanban shows the status of the work items.
#### Q20. The team complains that "things have been falling through the cracks lately." What should you do?
+
- [ ] Ask the team's manager to make role assignments so the team can catch up.
- [x] Conduct a workshop to identify all of the things that need to be done and see who can help with each.
- [ ] Refer to the team's RACI (Responsible, Accountable, Consulted, Informed) assignments.
- [ ] Meet with the Tech Lead and Product Owner to try to identify what can be done.
#### Q21. In Large-Scale Scrum, what is the recommended ratio of Scrum Masters to teams?
+
- [ ] One Scrum Master can support up to five teams.
- [ ] Large teams should have two Scrum Masters.
- [ ] There should be one Scrum Master per team.
- [x] One Scrum Master can support one to three teams.
#### Q22. In the Cynefin framework, where are "best practices" most appropriate?
+
- [ ] in the Complex regime
- [ ] in the Complicated regime
- [ ] in the Chaotic regime
- [x] in the Obvious regime
#### Q23. A manager informs you that a developer from another team is between assignments, and she wants to place the developer on your team for a few sprints. What should you do?
+
- [x] Explain to the manager that this will be disruptive to the team and ask that another assignment be found.
- [ ] Explain the situation to the team and ask them to go with the flow.
- [ ] Explain the situation to your manager and ask them to resolve it.
- [ ] When the temporary developer shows up, assign them to write documentation.
-
#### Q24. The Product Owner complains to you that the team is not working hard enough and they need to increase their velocity by at least 50%. Which action should you not take?
+
- [x] Share the feedback from the PO and challenge the team to increase their velocity.
- [ ] Ask the PO to explain the business context to the team.
- [ ] Explain the impact of technical debt to the PO and the benefits of devoting some capacity to reducing it.
- [ ] Hold a Value Stream Mapping workshop to identify and reduce waste.
#### Q25. What is the name of the practice in which a cross-functional team collaborates intensively to develop a new product idea?
+
- [x] Hackathon
- [ ] Scrum at Scale
- [ ] Innovation and Planning
- [ ] Magnum Focus
#### Q26. The team's manager wants to attend the Sprint Retrospective. What should you do?
+
- [ ] Agree to the manager's request and notify the team.
- [ ] Propose that the manager attend only every other retrospective.
- [x] Propose a different forum for the manager to meet with the team.
- [ ] Ask the team if it is okay with them that the manager attend.
#### Q27. Who is responsible for a Scrum team's performance?
+
- [x] the team
- [ ] the Scrum Master
- [ ] the Product Owner
- [ ] the Engineering Manager
#### Q28. Which statement concerning small, frequent releases of software is true?
+
- [ ] The chance for rollback is high.
- [x] It typically requires a high degree of automation.
- [ ] The administrative costs are high.
- [ ] Backward compatibility may be jeopardized.
#### Q29. What is the activity of clarifying and expanding user stories called?
+
- [ ] story point estimating
- [ ] Definition of Done
- [ ] user story expansion
- [x] backlog refinement
#### Q30. Which strategy is preferred for development teams?
+
- [ ] Optimize for most work done.
- [x] Maximize output and maximize outcome.
- [ ] Maximize outcome while minimizing output.
- [ ] Optimize for resource utilization.
#### Q31. Which statement is true about the actor in a user story?
+
- [ ] The actor does not have to be a specified role in the solution.
- [ ] There must be multiple personas for each actor.
- [x] The actor can be the system itself.
- [ ] The system cannot be the actor.
#### Q32. Which statement is true about Agile?
+
- [ ] Agile requires a high degree of up-front planning.
- [ ] Once the requirements are agreed to, the team can complete work.
- [x] Agile requires a high degree of discipline.
- [ ] Agile works best when there is no contract.
#### Q33. Which statement about burndown and burnup charts is not true?
+
- [ ] Burndown charts show the work remaining to be done.
- [ ] Burnup charts show the work completed.
- [x] Burndown charts are more useful than burnup charts.
- [ ] Agile project management tools can produce these automatically.
#### Q34. What is the name for the practice of going to see a process in use at the point of value delivery?
+
- [ ] Six Sigma
- [x] Gemba walk
- [ ] Total Quality Management
- [ ] Kaizen
#### Q35. When the team needs to make a decision, what is the best course of action?
-- [x] Try to achieve concensus.
+
+- [x] Try to achieve concensus.
- [ ] Take a vote and the majority rules.
- [ ] Identify the person who is most knowledgeable and ask them to decide.
- [ ] Let the most senior member of the team decide.
#### Q36. Which action is something the Team Facillitator should NOT do?
+
- [ ] Embrace servant leadership.
-- [x] Estimate story points.
+- [x] Estimate story points.
- [ ] Celebrate successes.
- [ ] Remove impediments
#### Q37. A team needs to do research, design, prototyping. What is this type of story called?
+
- [x] Exploratory spike
- [ ] Backlog refinement
- [ ] Functional decomposition
- [ ] R&D
#### Q38. Which story about technical debt is true?
+
- [ ] Technical debt is another name for bugs
- [ ] It is at the Product Owner's description to allocate effort to reduce technical debt.
-- [x] Adding technical debt should be avoided at all costs.
+- [x] Adding technical debt should be avoided at all costs.
- [ ] Technical debt is what the Product Owner owes to the developers if they work a lot of overtime to complete the sprint.
#### Q39. Which statement about estimating is not true?
+
- [ ] Absolute estimating is more reliable than relative estimating.
- [ ] Relative estimating is more reliable than absolute estimating.
-- [x] In estimating, accuracy is more important than precision.
+- [x] In estimating, accuracy is more important than precision.
- [ ] In estimating, the effort is more important than the time required.
#### Q40. Which ceremony should the Product Owner not attend?
+
- [ ] daily stand-ups
- [ ] Sprint Retrospectives
- [ ] story point estimating
-- [x] code reviews
+- [x] code reviews
#### Q41. Which task is not the Product Owners responsibility?
+
- [ ] estimating story points
- [ ] refining acceptance criteria
-- [x] giving feedback to developers about the user stories
+- [x] giving feedback to developers about the user stories
- [ ] demonstrating the work to stakeholders
-#### Q42. Which choice is *not* considered during Sprint Planning?
-- [x] stories that meet the Definition of Done
+#### Q42. Which choice is _not_ considered during Sprint Planning?
+
+- [x] stories that meet the Definition of Done
- [ ] team velocity
-- [ ] stories that meet the Definition of Ready
+- [ ] stories that meet the Definition of Ready
- [ ] team capacity
#### Q43. You have noticed a pattern that the most interesting stories on the Sprint Backlog get started right away, and the least interesting stories languish or don't get done. What should you do?
+
- [ ] 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?
#### 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
- [x] Sprint Retrospective //Answer?
- [ ] daily stand-up
- [ ] Sprint Demo
#### 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?
- [ ] descriptions of the product's functionality and use
#### Q46. Which statement describes Shu Ha Ri?
+
- [ ] It is a library of coding patterns.
- [ ] It is a software testing strategy.
- [ ] It is a standard for interface design.
-- [x] It is a model for skill development and mastery.
+- [x] It is a model for skill development and mastery.
#### Q47. What does the Agile Manifesto indicate?
-- [x] Responding to change is more valuable than following a plan.
+
+- [x] Responding to change is more valuable than following a plan.
- [ ] Documenting requirements up front is more valuable than at the end.
- [ ] Following the plan is essential for not going over budget.
- [ ] Contract negotiation should be used to settle disputes.
#### Q48. What is the main benefit of a working agreement?
+
- [ ] It specifies core working hours.
- [ ] It clarifies the reporting relationships on the team.
-- [x] It defines the culture that the team aspires to achieve.
+- [x] It defines the culture that the team aspires to achieve.
- [ ] It compiles everyone's information.
#### Q49. What is the name of the information radiator that has multiple columns used to visualize the flow of work?
+
- [ ] Work Flow Indicator
- [ ] Value Stream Map
- [ ] Story Map
- [x] Kanban Beard //Answer?
#### Q50. Which is the best definition of story points?
-- [x] They are a relative measure of the effort needed to complete a story.
+
+- [x] They are a relative measure of the effort needed to complete a story.
- [ ] They a measure of development time only, test time is considered separately.
- [ ] They are a relative measure of the value of a story.
- [ ] They are a measure of time to complete a story.
#### Q51. What is a Scrum of Scrums?
-- [x] It is technique for two or more teams working together coordinate their efforts.
+
+- [x] It is technique for two or more teams working together coordinate their efforts.
- [ ] It is another name for the Scrum Master Community of Practice.
- [ ] It is an information radiator used to compare the velocity of several teams.
- [ ] It is the system demo for teams on the same release train.
#### Q52. What is the Product Owner's role regarding the product backlog?
+
- [ ] The PO must identify the intended users of the features on the backlog.
- [ ] The PO is responsible for estimating the size of the total.
-- [x] The PO must identify the dependencies that impact the backlog.
+- [x] The PO must identify the dependencies that impact the backlog.
- [ ] The PO decides what to include in the backlog and what to exclude.
#### Q53. Why should a team do refactoring?
+
- [ ] It assigns developers to other teams in order to eliminate personality conflicts.
- [ ] It improves the functionality of the product,
- [ ] It recalibrates the success criteria for the product in the marketplace.
-- [x] It improves the design, which can lead improved development efficiency and maintainability.
+- [x] It improves the design, which can lead improved development efficiency and maintainability.
#### Q54. Which choice is not a benefit generally associated with product demonstrations?
+
- [ ] Learn about new requirements.
- [ ] Learn feature suitability.
- [ ] Learn about feature usability.
-- [x] Learn about feature estimates.
+- [x] Learn about feature estimates.
#### Q55. What is an information radiator?
+
- [ ] a list of KPIs for the team
- [ ] a list of overdue action items
-- [x] the task board
+- [x] the task board
- [ ] a highly visible display of key performance data
-#### Q56. According to the Agile Manifesto, your highest priority is to ______.
+#### Q56. According to the Agile Manifesto, your highest priority is to **\_\_**.
+
- [ ] minimize change requests
-- [x] satisfy the customer
+- [x] satisfy the customer
- [ ] get the job done on time
- [ ] achieve the desired ROI
#### Q57. Product development organizations sometimes use descriptions of archetypal users and their values so that developers can design the system to meet their needs and wants. What are these descriptions called?
+
- [ ] actors
- [ ] roles
- [ ] agents
-- [x] personas
+- [x] personas
#### Q58. The Product Owner is focused on testing a new system concept in the marketplace as quickly and inexpensively as possible. What is this first-generation product called?
+
- [ ] preproduction version
- [ ] focus group demonstrator
- [ ] Generation 1 product
-- [x] minimum viable product
+- [x] minimum viable product
#### Q59. To whom should the Product Owner report?
+
- [ ] the Quality Manager
-- [x] the Product Manager
+- [x] the Product Manager
- [ ] the Scrum Master
- [ ] the Engineering Manager
#### Q60. What happens in Splint 0?
+
- [ ] The team delivers no story points in that sprint.
- [ ] The team does regression testing prior to release to production.
-- [x] The team prepares to work on the product backlog.
+- [x] The team prepares to work on the product backlog.
- [ ] This is the time to inspect and adapt.
#### Q61. What does the Definition of Done mean?
+
- [ ] The story meets the INVEST criteria.
-- [ ] The team has completed all of the work in its Sprint.
+- [ ] The team has completed all of the work in its Sprint.
- [ ] The story has been handed off to the DevOps team.
-- [x] The team has agreed on the criteria for story completion.
+- [x] The team has agreed on the criteria for story completion.
#### Q62. Which element is most important when describing your product?
+
- [ ] its cost
- [ ] its licensing terms and conditions
-- [x] its benefits
-- [ ] its features
+- [x] its benefits
+- [ ] its features
#### Q63. Which choice best describes the Team Facilitator?
+
- [ ] a meeting scheduler
- [ ] a record keeper
- [ ] a project manager
-- [x] an Agile coach
+- [x] an Agile coach
#### Q64. What is the name of the technique that divides a story into smaller pieces?
+
- [ ] mitosis
- [ ] story slicing
-- [x] disaggregation
+- [x] disaggregation
- [ ] Divide and Conquer
#### Q65. A team member comes to you with a complaint about another team member. What should you do?
+
- [ ] Bring the complaint to the other person and try to resolve the issue.
- [ ] Ask them to talk to the other person and try to work it.
- [ ] Notify HR of the problem and ask them to handle it.
- [x] Invite both people a meeting and try mediate the conflict.
#### Q66. What is the forming-storming-norming, performing model of team development known as?
-- [x] the Tuckman model
+
+- [x] the Tuckman model
- [ ] the Standard Team model
- [ ] Moore's Team Framework
- [ ] the Siebert model
#### Q67. What is the name of the ceremony in which you inspect the work completed during the sprint?
+
- [ ] Sprint Retrospective
- [x] Sprint Review //Answer?
- [ ] Next-Sprint Planning
- [ ] Velocity Confirmation
#### Q68. Which choice best describes an Agile Release Train (ART)?
-- [x] continuous delivery
+
+- [x] continuous delivery
- [ ] comprised of the teams within a program
- [ ] DevOps Center of Excellence
- [ ] Scrum of Scrums
#### Q69. As an Agile coach, what should be your attitude toward your team members individual goals and motivations?
+
- [ ] Understand them—try align personal motivations with the team's progress toward the project goals.
- [ ] Nurture them-goals are the reason why people want to be at work.
- [ ] Disregard them—personal views have no bearing on reaching the project goals.
-- [x] Leverage them—use personal goals encourage team members raise their performance levels.
+- [x] Leverage them—use personal goals encourage team members raise their performance levels.
#### Q70. Which phrase best describes an Agile team?
+
- [ ] self-directed
- [ ] self-managed
- [ ] self-sustaining
-- [x] self-organizing
+- [x] self-organizing
#### Q71. Which technique does not help prioritize the backlog?
+
- [ ] MoSCow
- [ ] Kano
- [ ] WSJF
-- [x] Kaizen
+- [x] Kaizen
#### Q72. What does the Definition of Ready mean?
+
- [ ] The story has been tested end is ready for release to production.
- [x] The story is ready to be brought into a sprint. //Answer?
- [ ] The stakeholders are ready to discuss their requirements for story.
- [ ] The team has completed sprint 0 and is ready to work.
#### Q73. Which is NOT a principle of the Scaled Agile Framework?
+
- [ ] Centralize decision-making
- [ ] Apply systems thinking
- [ ] Take an economic view
- [x] Unlock the intrinsic motivation of knowledge workers
#### Q74. Which statement concerning small, frequent releases of software is true?
+
- [ ] The chance for rollback is high
- [x] It typically requires a high degree of automation
- [ ] Backward compatibility may be jeopardized
- [ ] The administrative costs are high
#### Q75. What is the definition of capacity?
+
- [ ] It is an inventory of the team's knowledge and skills that is used to plan the work that they do.
- [ ] It is the number of teams that a Team Facilitator can support concurrently.
- [ ] It is an adjustment to velocity, used in Spring Planning, to account for reduced availability of team members during the upcoming sprint.
diff --git a/android/android-quiz.md b/android/android-quiz.md
index c4ba1116e0..1ab8b886c3 100644
--- a/android/android-quiz.md
+++ b/android/android-quiz.md
@@ -1,6 +1,5 @@
#### Q1. To add features, components, and permissions to your Android app, which file needs to be edited?
-
- [x] AndroidManifest.xml
- [ ] Components.xml
- [ ] AppManifest.xml
@@ -42,7 +41,6 @@
RecyclerView.ViewHolder
LinearLayoutManager
```
-
```
RecycleView
@@ -50,7 +48,7 @@
RecyclerView.ViewHolder
LinearLayoutManager
```
-
+
#### Q6. The Android system kills process when it needs to free up memory. The likelihood of the system killing a given process depends on the state of the process and the activity at the time. With combination of process and activity state is most likely to be killed?
- [x] Process:In the background;Activity:Is stopped
@@ -65,7 +63,7 @@
startActivity(intent)
}
```
-
+
```kotlin
Intent(this, NextActivity::class.java).apply {
put(EXTRA_NEXT, "some data")
@@ -90,16 +88,14 @@
}
```
-
-#### Q8. You want to include about and setting modules in your project. Which files accurately reflects their inclusion?
+#### Q8. You want to include about and setting modules in your project. Which files accurately reflects their inclusion?
- [ ] in build.gradle:include ':app',':about' ':settings'
- [x] in settings.gradle:include ':app',':about' ':settings'
- [ ] in settings.gradle:include ':about',':settings'
- [ ] in gradle.properties:include ':app',':about' ':settings'
-
#### Q9. What is the benifit of using @VisibleForTesting annotation?
- [x] to denote that a class, methos, or field has its visibility relaxed to make code testable
@@ -122,7 +118,7 @@
...
targetSdkVersion 21
testSdkVersion 28
- }
+ }
```
```gradle
@@ -140,7 +136,7 @@
targetSdkVersion 28
}
```
-
+
#### Q11. When will an activity's onActivityResult()be called?
- [ ] when calling finish()in the parent activity
@@ -158,7 +154,7 @@
fun deleteEvent(@Path("id") id: Long): Call
- [ ] @DELETE("events/{id}")
fun deleteEvent(@Path("id") id: Long): Call (correct)
-
+
#### Q13. When would you use a product flavour in your build setup?
- [ ] when you need to have the app's strings present in multiple lanuages
@@ -178,7 +174,7 @@
return root
}
```
-
+
- [ ] root.getById(R.id.text_home)
- [ ] findViewByID(R.id.text_home)
- [x] root.findViewById(R.id.text_home)
@@ -186,7 +182,6 @@
#### Q15. Why do you use the Android JUnitRunner when runnig UI tests?
-
- [x] The test facilitates loading your test package and the app under test onto a device or emulator, runs the test, and report the results.
- [ ] The test runner creating screenshots of each screen that displayed while tests are executed.
- [ ] The test runner facilitates parallelization of test classes by providing for each test class.
@@ -206,7 +201,7 @@
- [ ] root.getById(R.id.text_home)
- [x] root.findViewById(R.id.text_home)
-#### Q18. IF the main thread is blocked for too long, the system displays the___dialog?
+#### Q18. IF the main thread is blocked for too long, the system displays the\_\_\_dialog?
- [ ] Thread Not Responding
- [ ] Application Paused
@@ -238,7 +233,6 @@
![img](image/shape.png)
-
```xml
@@ -275,7 +269,7 @@
```
-
+
#### Q22. To persist a small collection of key-value data, what should you use?
- [ ] external file storage
@@ -287,16 +281,13 @@
- [ ] @GET("photo/{id}"}
fun listPhotos(@Path("id") id:Long?) : Call
-
- [ ] @LIST("photo")
fun listPhotos() : Call>
-
- [ ] @GET("photo")
fun listPhotos() : Call
-
- [x] @GET("photo")
fun listPhotos() : Call>
-
+
#### Q23. Given the test class below, which code snippet would be a correct assertion?
- [ ] assertThat(resultAdd).is(2.0)
diff --git a/aws-lambda/aws-lambda-quiz.md b/aws-lambda/aws-lambda-quiz.md
index a338d3d691..c6ceb0e005 100644
--- a/aws-lambda/aws-lambda-quiz.md
+++ b/aws-lambda/aws-lambda-quiz.md
@@ -1,260 +1,288 @@
-AWS LAMBDA Assessment
----------------------
+## AWS LAMBDA Assessment
#### Q1. How can you increase the CPU resources for your Lambda?
+
- [ ] `Increase the configured CPU value`
-- [ ] `Increase the configured timeout value`
+- [ ] `Increase the configured timeout value`
- [x] `Increase the configured memory value`
- [ ] `Increase the configured concurrency value`
#### Q2. How can additional code or content can be provided for Lambda?
+
- [ ] `blocks`
- [x] `layers`
- [ ] `aliases`
- [ ] `handlers`
#### Q3. How can Step Functions call Lambdas?
+
- [ ] `in sequence`
- [x] `both of these answers`
- [ ] `neither of these answers`
- [ ] `in parallel`
#### Q4. Which AWS CLI command invokes a function?
+
- [ ] `aws lambda invoke --function ReturnBucketName outputfile.txt`
- [ ] `aws lambda execute --function-name ReturnBucketName outputfile.txt`
- [x] `aws lambda invoke --function-name ReturnBucketName outputfile.txt`
- [ ] `aws lambda execute --function ReturnBucketName outputfile.txt`
#### Q5. What adds tracing capabilities to a Lambda?
+
- [ ] `AWS Trace`
- [ ] `CloudStack`
- [ ] `CloudTrail`
- [x] `AWS X-Ray`
#### Q6. You need to build a continuous integration/deployment pipeline for a set of Lambdas. What should you do?
+
- [ ] `Create configuration files and deploy them using AWS CodePipeline.`
- [ ] `Create CloudFormation templates and deploy them using AWS CodeBuild`
- [ ] `Create configuration file and deploy using AWS CodeBuild`
- [x] `Create CloudFormation templates and deploy them using AWS CodePipeline.`
#### Q7. What can you use to monitor function invocations?
+
- [ ] `API Gateway`
- [ ] `S3`
- [ ] `SAS`
- [x] `CLoudTrail`
#### Q8. It is AWS best practice to enable Lambda logging by which of these methods.
+
- [ ] `Use S3 metrics and CloudWatch alarms`
- [ ] `Create custom metrics within your Lambda code.`
- [ ] `Create custom metrics within your CloudWatch code.`
- [x] `Use Lambda metrics and CloudWatch alarms.`
#### Q9. What may be provided for environment variables?
+
- [ ] `an SSL certificate`
- [ ] `a bitmask`
- [x] `an AWS KMS key`
- [ ] `an HTTP protocol `
#### Q10. Lambda allows for running of what other things?
+
- [ ] `binaries.`
- [x] `all of these answers`
- [ ] `executables`
- [ ] `Shell scripts`
#### Q11. In what style must you write Lambda code?
+
- [ ] `MVC`
- [ ] `virtual`
- [x] `stateless`
- [ ] `protocol`
#### Q12. How can a developer provide Lambda code?
+
- [ ] `by uploading a .zip file`
- [x] `all of these answers`
- [ ] `by editing inline`
- [ ] `from an S3 bucket`
#### Q13. You are performance-testing your Lambda to verify that you set the memory size adequately. Where do you verify the exectuon overhead?
+
- [ ] `CLoudWatch logs`
- [ ] `DynamoDB logs`
- [ ] `S3 logs`
- [x] `Lambda logs.`
#### Q14. What facilitates continuous delivery of Lambdas?
+
- [ ] `CodeStack`
- [ ] `ElasticStack`
- [ ] `Mobile Hub`
- [x] `CodeDeploy`
#### Q15. How are computing resources allocated to Lambdas?
+
- [x] `proportionally`
- [ ] `equally`
- [ ] `periodically`
- [ ] `daily`
#### Q16. You can restrict the scope of a user's permissions by specifying which two items in an IAM policy?
-- [ ] `resources and users`
+
+- [ ] `resources and users`
- [x] `resources and conditions`
- [ ] `events and users`
- [ ] `events and conditions`
#### Q17. What does Lambda logging include?
+
- [x] `logging streams`
- [ ] `rotating streams`
- [ ] `logging events`
- [ ] `advancing log groups`
#### Q18. What can AWS Amplify NOT do for a Lambda?
+
- [ ] `create a Lambda`
- [x] `be an event source`
- [ ] `assign an IAM role`
- [ ] `delete a Lambda`
#### Q19. How do you author a Lambda in a programming language that AWS does not support?
+
- [ ] `Create a Lambda function with a custom runtime and reference the function in your Lambda`
- [x] `Create a Lambda layer with a custom runtime and reference the layer in your lambda`
- [ ] `You cannot use Lambda in this situation`
- [ ] `Create a Lambda function with a custom runtime`
#### Q20. What are listed downstream resources based on?
+
- [ ] `the execution policy`
- [x] `the Lambda configuration`
- [ ] `the Lambda nodes`
- [ ] `the IAM user`
#### Q21. Which is an equivalent and valid tag for a pair of Lambdas?
+
- [ ] `department:Sales,department:Sales`
- [x] `department:Sales,department:sales`
- [ ] `aws:demo;aws:demo`
- [ ] `aws:demo;aws:DEMO`
-#### Q22. Outbound connections from Lambdas must be ______.
+#### Q22. Outbound connections from Lambdas must be **\_\_**.
+
- [ ] `neither of these answers`
- [ ] `UDP/IP`
- [ ] `TCP/IP`
- [x] `both of these answers`
#### Q23. How are CloudWatch actions configured?
+
- [ ] `automatically`
- [ ] `none of these answers`
- [x] `manually`
- [ ] `ad hoc`
#### Q24. You are testing your stream-based application and the associated Lambda. AWS best practice advises you to test by varying what?
+
- [ ] `stream and record sizes`
- [ ] `stream and shard sizes`
- [x] `batch and record sizes`
- [ ] `batch and shard sizes`
#### Q25. You need to make your Lambda available to services in multiple VPCs. What do you do?
+
- [ ] `Place each subnet in a VPC. Associate all subnets to your Lambda.`
- [ ] `Place all subnets in a VPC. Associate all subnets to your Lambda.`
- [ ] `Configure your Lambda to be available to multiple VPCs.`
- [x] `Configure all application VPCs to be peered.`
#### Q26. How is the cost associated with Lambda function calculated?
+
- [ ] `number of function calls`
- [ ] `amount of code run`
- [x] `compute time`
- [ ] `amount of infrastructure used`
#### Q27. What is the fastest way to get started with Lambda?
+
- [ ] `Author a Lambda from scratch.`
- [x] `Use a blueprint.`
- [ ] `Use a .zip deployment package.`
- [ ] `Use the serverless app repository.`
#### Q28. Where is the disk space allocated for Lambda functions?
+
- [x] `/tmp`
- [ ] `/default`
- [ ] `/temp`
- [ ] `/ds`
#### Q29. How do you stop a running Lambda that is stuck in a recursive loop?
+
- [ ] `Delete the function.`
- [x] `Set the function concurrent execution limit to 0 while you update the code.`
- [ ] `Reset the function.`
- [ ] `Set the function concurrent execution limit to 100 while you update the code.`
#### Q30. What is AWS best practice for Lambda configuration?
+
- [x] `Overprovision memory to run your functions faster and reduce your costs. Do not overprovision your function timeout settings.`
- [ ] `Overprovision memory and your function timeout settings to run your functions faster and reduce your costs.`
- [ ] `Do not overprovision memory. Overprovision your function timeout settings to run your functions faster and reduce costs.`
- [ ] `Do not overprovision memory. Do not overprovision your function timeout settings to run your functions faster and reduce costs.`
-
#### Q31. Basic Lambda permissions include permissions for what?
+
- [ ] `removing log groups`
- [ ] `none of these answers`
- [ ] `creating log groups`
- [x] `updating log groups`
-
#### Q32. How are environment variables stored?
+
- [ ] `DynamoDB tables`
- [x] `key-value pairs`
- [ ] `S3 buckets`
- [ ] `none of these answers`
-
#### Q33. You need to use a Lambda to provide backend logic to your website. Which service do you use to make your Lambda available to your website?
+
- [ ] `S3`
- [x] `API Gateway`
- [ ] `X-Ray`
- [ ] `DynamoDB`
-
#### Q34. How can additional code or content be provided for your Lambda?
+
- [ ] `aliases`
- [ ] `blocks`
- [ ] `handlers`
- [x] `layers`
-
#### Q35. Lambdas allow for running of what other things?
+
- [ ] `binaries`
- [ ] `executables`
- [x] `all of these answers`
- [ ] `shell scripts`
-
#### Q37. You are creating a Lambda to trigger on change to files in an S3 bucket. Where should you put the bucket name?
+
- [ ] `in the Lambda function code`
- [x] `in a Lambda environment variable`
- [ ] `in the Lambda tags`
- [ ] `in another S3 bucket`
-
#### Q38. What action is needed before you can test a Lambda?
+
- [ ] `Deploy the Lambda.`
- [ ] `Export the function`
- [ ] `none of these answers`
- [x] `Configure a test event.`
-
#### Q39. What kind of packages can you use with Node.js for Lambdas?
+
- [ ] `Fleece`
- [x] `NPM`
- [ ] `none of these answers`
- [ ] `Pod`
-
#### Q41. Lambdas are monitored by default using which service?
+
- [ ] `CloudTrail`
- [x] `CloudWatch`
- [ ] `CloudFormation`
- [ ] `LogWatch`
-
#### Q42. What can trigger a Lambda function execution?
+
- [ ] `a table definition`
- [ ] `queue isolation`
- [ ] `STS Write`
- [x] `an SNS topic`
-
#### Q43. You need to set an S3 event trigger on your Lambda to respond when data is added to your bucket from another S3 bucket. Which event type do you configure?
+
- [ ] `POST`
- [ ] `"All object create events"`
- [x] `PUT`
- [ ] `COPY`
-
diff --git a/aws/aws-quiz.md b/aws/aws-quiz.md
index 935d393d72..5457ff0d97 100644
--- a/aws/aws-quiz.md
+++ b/aws/aws-quiz.md
@@ -1,104 +1,105 @@
-AWS Assessment
----------------------
+## AWS Assessment
+
#### Q1. You have an application using a 100 GB MySQL database that you are migrating into AWS. What should you consider when deciding between whether to host the database on RDS for MySQL or Aurora?
+
- [ ] cost
- [ ] ease of maintenance vs. granularity of control
- [ ] all of these answers<<< Correct
- [ ] the current storage engine used by the application, such as InnoDB or MyISAM
-
#### Q2. Which database is a NoSQL database type that can quickly store and retrieve key-value pairs?
+
- [ ] Aurora
- [ ] Neptune
- [ ] ORDS for MySQL
- [ ] DynamoDB<<< Correct
-
#### Q3. Your database is an RDS instance running SQL Server with Multi-AZ replication and you have several older .NET console utilities that perform database operations every 15 seconds. When the cluster has to switch the primary database server to the secondary AZ, the .NET utilities start to report connection failures to the database although other applications are able to access the database. How do you correct this problem?
+
- [ ] Use the RDS console to force a reboot of the database instance so that the primary server becomes the master server again.
- [ ] The server running the .NET utilities is caching the DNS lookup on the database cluster address. Flush the DNS cache of the server and force the C# utilities to open new connections to the database.
- [ ] A.NET application will retain the IP address of a connection string until the host machine is rebooted.
- [ ] The NET utilities need to change the SQL Server endpoint in the connection strings to read from the secondary database server using a try/catch.
-
#### Q4. What AWS services can help you automate your development pipeline for continuous integration and continuous deployment?
+
- [ ] CodePipeline
- [ ] CodeDeploy
- [ ] all of these answers<<< Correct
- [ ] CodeBuild
-
#### Q5. Which AWS service complies with the standards outlined in Payment Card Industry Data Security Standard (PCI DSS) Level 1 for the handling and transmission of credit card data?
+
- [ ] API Gateway
- [ ] all of these answers<<< Correct
- [ ] Simple Queue Service (SOS)
- [ ] Kinesis Data Streams
-
#### Q6. You have a large amount of files on your network-attached storage array that must be archived and maintained for a period of 10 years due to industry regulations. This data will be infrequently accessed but must be kept What is the best AWS service for storing this data?
+
- [ ] EFS
- [ ] Snowball
- [ ] OEBS
- [ ] S3 Glacier<<< Correct
-
#### Q7. For your AWS root account, you have generated a random password of the maximum allowed length and included special characters. Which additional steps should you take to secure your AWS root account?
+
- [ ] Create an AM role for the account administrator with the highest privileges. Do not store the root password, but when the root account is needed reset the password on the root account via email confirmation and repeat this procedure.
- [ ] Store your randomly generated password in your organizational secrets database using a service such as 1Password or LastPass, and only grant access to this secret to the DevOps team.
- [ ] Create IAM accounts for your administrators and attach the AdministratorAccess policy to their accounts. Disable the root account in the user settings.
- [ ] Create an IAM role for the account administrator with the highest privileges and do not use the root account in day-today operations. Enable two-factor authentication on the root account<<< Correct
-
#### Q8. Which Elastic Load Balancing option supports Lambda as a target?
+
- [ ] Network Load Balancer
- [ ] Lambda can not be called directly by incoming web requests. You must use API Gateway.
- [ ] Classic Load Balancer
- [ ] Application Load Balancer<<< Correct
-
#### Q9. How do you architect a solution for an SQL Server database to be replicated across AWS regions in an active-active architecture?
+
- [ ] Use RDS for SQL Server and create the same instance in two different regions. Use Database Migration Service to keep each database in sync.
- [ ] Use a VPN or VPC peering to establish a connection between the VPCs in each region. Install SOL Server Enterprise Edition on EC2 instances in each region and configure an Always On availability group.
- [ ] Use RDS for SQL Server 2016 or 2017 Enterprise Edition. Enable Multi-AZ support and select the Mirroring/Always On option. Select another region for the mirroring option
- [ ] You can not set up an active-active architecture for SQL Server that spans geographic regions.
-
#### Q10. What does it cost to launch an EC2 instance from the AWS Marketplace?
+
- [ ] All images in the AWS Marketplace incur additional hourly fees in addition to the charges from the instance size you select.
- [ ] You can only launch images that were created by other users on your AWS account, so you pay only for the instance size you select and the S3 storage costs for the base image.
- [ ] Each image has its own pricing that could either be free, or include charges for software licensing costs. You will also pay for the instance the image runs on<<< Correct
- [ ] All images in the AWS Marketplace contain only open-source software with no additional fees and are created by other AWS users. You will pay only for the instance size you select.
-
#### Q11. When using an ECS cluster with EC2 instances, what maintenance tasks should you perform on the EC2s?
+
- [ ] The instances created by ECS do not have patches that need to be applied; however you should make sure your containers contain any important security updates,
- [ ] Refresh the cluster with instances built from the latest ECS AML
- [ ] ECS clusters do not use EC2 instances.
- [ ] You should not directly manipulate the EC2 instances created by ECS. AWS will automatically update these instances.
-
#### Q12. What in-memory caching server is not supported by ElastiCache?
+
- [ ] Redis 5
- [ ] Memcached
- [ ] Elasticsearch<<< Correct
- [ ] Redis 3
-
#### Q13. Which AWS service can be used to help generate the documentation required by various compliance standards, such as Payment Card Industry Data Security Standard (PCI DSS) Level 1 for the handling of credit card data?
+
- [ ] Artifact<<< Correct
- [ ] DocumentDB
- [ ] Print out the AWS Compliance summary and keep it with your required documentation for an audit.
- [ ] Secrets Manager
-
#### Q14. When using AWS for research and development ahead of a planned migration, how do you prevent unexpected increases or spikes in the billing?
+
- [ ] Use the billing dashboard to create a cost budget. Input the max amount you want to be charged each month. Any charges that occur over this amount will cause AWS to automatically suspend those resources
- [ ] Using the root AWS account, activate IAM access to the billing information for the account. Make sure your IAM users have the Billing FullAccessGroup policy. Then from the billing dashboard, check the accrued charges once a day.
- [ ] If you are using the AWS free tier, you will have to confirm the usage of any service that goes over the AWS free tier limits.
- [ ] Using the root AWS account enable Billing Alerts in the user preferences. Then use CloudWatch to create a billing alarm and set a threshold to a specific dollar amount for your estimated monthly charges.<<< Correct
-
#### Q15. You are creating a DynamoDB table to store all movies that have been released since 1938. Your application will allow users to search by movie title and see the details of that film. Given the sample below showing the movie data that you will be importing, what is the best set of keys to apply to this table?
+
```
{
"title":"The Avengers",
@@ -107,55 +108,56 @@ AWS Assessment
"genres" : ["Action"]
}
```
+
- [ ] The primary key should be a partition key of the title field.
- [ ] The primary key should be the title field and the partition key should be the genres field.
- [ ] The primary key should be a composite key comprised of a partition key on the title field and a sort key on the year field.
- [ ] The primary key should be created as a completely unique value, such a sequential numerical list of movie IDs. The partition key should be title field for fast lookup.
-
#### Q16. What data store provides a simple and quick way of storing basic user attributes in an object-based format?
+
- [ ] ORDS for Oracle
- [ ] Redshift
- [ ] Neptune
- [ ] DynamoDB
-
#### Q17. You need a schemaless database. Which Amazon database service provides that solution?
+
- [ ] ORDS
- [ ] Aurora
- [ ] Redshift
- [ ] DynamoDB
-
#### Q18. Which communication channel does SNS not support natively?
+
- [ ] OSMS text message
- [ ] push notification
- [ ] email
- [ ] automated phone call<<< Correct
-
#### Q19. When designing a serverless web application using Lambda, what key concept must you factor into your design?
+
- [ ] Serverless web applications run within the web browser of the user, so you will need to store any data the user changes directly in a database.
- [ ] Lambda only allows you to write functions in JavaScript
- [ ] Lambda does not use servers, so it can only return the same request to every user,
- [ ] Lambda is stateless, so it won't remember who a user is in between requests
-
#### Q20. A principle of DevOps is to view infrastructure as code. Which AWS service allows you to script your AWS infrastructure?
+
- [ ] CloudTrail
- [ ] CloudFormation
- [ ] AWS Config<<< Correct
- [ ] AWS Service Catalog
-
#### Q21. You created a Windows EC2 instance with a public IP address and installed SQL Server. When attempting to connect to SQL Server from SQL Server Enterprise Manager on your local computer, the Windows EC2 instance is unable to establish a connection to the server. What is the first thing you should check?
+
- [ ] Check the routing tables for the VPC.
- [ ] Verify that the assigned security groups allow TCP port 1433 traffic from your current IP address.<<< Correct
- [ ] Check the policies within Windows Firewall
- [ ] Verify that you are connecting to the instance using a user that is not sa.
-
#### Q22. You are hosting an application configured to stream media to its clients on TCP ports 3380-3384, 3386-3388, and 3390. The Inbound tab below shows three incoming security group policies attached to this instance. Which policy should you use?
+
- [ ] The rule that exposes TCP ports 3380-3390 would also publicly expose port 3389 (RDP) to the entire internet. Write separate rules to only expose the needed ports.
- [ ] The first security group rule allows all traffic into this instance. Exposing your entire instance to the whole internet leaves the server open to various attacks of the other services running on different port numbers.
- [ ] Verify that the AWS account owners actually control the entire CIDR C block for 12.228.11.0-255 and these are secured IPs for RDP access into this instance.
diff --git a/bash/bash-quiz.md b/bash/bash-quiz.md
index e133a43811..9c4678e3b9 100644
--- a/bash/bash-quiz.md
+++ b/bash/bash-quiz.md
@@ -25,7 +25,7 @@ Script.sh
$ cat script.sh
for i in $(ls *.jpg); do
mv $i ${i}.bak
-done
+done
```
- [ ] ls: cannot access nonexistentfile: No such file or directory
@@ -87,7 +87,7 @@ awk -F: '/user1/{print $1 "-" $3 "-" $6}' /etc/passwd
- [ ] It will cause Bash to exit if local, declare, or typeset assignments return a nonzero status code.
- [x] It will cause Bash to exit if a command, list of commands, compound command, or potentially a pipeline returns a nonzero status code.
-#### Q9. The ______ keyword pauses the script to get input from standard input.
+#### Q9. The **\_\_** keyword pauses the script to get input from standard input.
- [ ] get
- [ ] argument
@@ -96,8 +96,9 @@ awk -F: '/user1/{print $1 "-" $3 "-" $6}' /etc/passwd
#### Q10. If file.sql holds SQL statements to be executed, what will be in file.txt?
-##### I cannot reproduce this question, but at first sight I don't see correct answer, because no-one write to file.txt and content doesn't change
-##### I suppose the correct script is *mysql < file.sql > file.txt* then the correct answer is fourth option.
+##### I cannot reproduce this question, but at first sight I don't see correct answer, because no-one write to file.txt and content doesn't change
+
+##### I suppose the correct script is _mysql < file.sql > file.txt_ then the correct answer is fourth option.
```bash
mysql < file.sql < file.txt
@@ -112,7 +113,7 @@ mysql < file.sql < file.txt
- [ ] When the command creates files, they will be owned by the group owner of the command.
- [ ] The SUID bit allows anyone to execute the command no matter what other permissions are set.
-- [x] When the command is executed, its running privileges elevate to the user owner of the command.
+- [x] When the command is executed, its running privileges elevate to the user owner of the command.
- [ ] When the command is executed, its running privileges elevate to the group owner of the command.
#### Q12. In order to extract text from the first column of file called textfile, which command would you use?
@@ -192,7 +193,7 @@ The date is: Sun Mar 24 12:30:06 CST 2019!
- [ ] `echo "The date is: !"`
- [ ] `echo "The date is: date!"`
-- [ ] `echo "The date is: (date)!"`
+- [ ] `echo "The date is: (date)!"`
- [x] `echo "The date is: $(date)!"`
#### Q21. Suppose your current working directory is your home directory. How could you run the script demo.sh that is located in your home directory? Find three correct answers.
@@ -213,6 +214,7 @@ E. bash demo.sh
#### Q22. How could you get a list of all .html files in your tree?
#### Idk both of them work
+
- [ ] `find . -type html`
- [x] `find . -name *.html`
- [ ] `find *.html`
@@ -262,7 +264,7 @@ case $num in
*)
echo "a mystery"
; ;
-esac
+esac
```
- [x] a case that matches any value, providing a default option if nothing else catches that value
@@ -285,9 +287,10 @@ esac
- [ ] `$@`
#WARNING!
-Start from this question and to Q40 I have a lot of doubts about answers
+Start from this question and to Q40 I have a lot of doubts about answers
because in real assessment I get these 12 question + 3 from Q1 to Q28,
and I select other answers in Q29, Q31, Q32, Q35, Q36, Q37, Q39, Q40 and pass it
+
#### Q29. What is the output of this script?
```bash
@@ -312,10 +315,10 @@ echo ${!fname}
- [ ] `D` ![D](questionimages/Q30/D.jpg)
Here a text based version of Q.30:
-
+
ll
--rw-r--r-- 1 frankmolev staff 374 Jun 3 19:30 .
--rw-r--r-- 1 frankmolev staff 1666 Jun 3 19:30 ..
+-rw-r--r-- 1 frankmolev staff 374 Jun 3 19:30 .
+-rw-r--r-- 1 frankmolev staff 1666 Jun 3 19:30 ..
-rw-r--r-- 1 frankmolev staff 0 Jun 3 19:30 file1.txt
-rw-r--r-- 1 frankmolev staff 0 Jun 3 19:30 file2.txt
..
@@ -323,31 +326,30 @@ ll
ll | sed -e 's,file,text,g'
a) []
--rw-r--r-- 1 frankmolev staff 374 Jun 3 19:30 .
--rw-r--r-- 1 frankmolev staff 1666 Jun 3 19:30 ..
+-rw-r--r-- 1 frankmolev staff 374 Jun 3 19:30 .
+-rw-r--r-- 1 frankmolev staff 1666 Jun 3 19:30 ..
-rw-r--r-- 1 frankmolev staff 0 Jun 3 19:30 file1.file
-rw-r--r-- 1 frankmolev staff 0 Jun 3 19:30 file2.file
..
b) []
--rw-r--r-- 1 frankmolev staff 374 Jun 3 19:30 .
--rw-r--r-- 1 frankmolev staff 1666 Jun 3 19:30 ..
+-rw-r--r-- 1 frankmolev staff 374 Jun 3 19:30 .
+-rw-r--r-- 1 frankmolev staff 1666 Jun 3 19:30 ..
-rw-r--r-- 1 frankmolev staff 0 Jun 3 19:30 file1.txt
-rw-r--r-- 1 frankmolev staff 0 Jun 3 19:30 file2.txt
..
c) []
--rw-r--r-- 1 frankmolev staff 68 Jun 3 19:30 .
--rw-r--r-- 1 frankmolev staff 1666 Jun 3 19:30 ..
+-rw-r--r-- 1 frankmolev staff 68 Jun 3 19:30 .
+-rw-r--r-- 1 frankmolev staff 1666 Jun 3 19:30 ..
d) [x]
--rw-r--r-- 1 frankmolev staff 374 Jun 3 19:30 .
--rw-r--r-- 1 frankmolev staff 1666 Jun 3 19:30 ..
+-rw-r--r-- 1 frankmolev staff 374 Jun 3 19:30 .
+-rw-r--r-- 1 frankmolev staff 1666 Jun 3 19:30 ..
-rw-r--r-- 1 frankmolev staff 0 Jun 3 19:30 text1.txt
-rw-r--r-- 1 frankmolev staff 0 Jun 3 19:30 text.txt
..
-
#### Q31. What is wrong with this script?
```bash
@@ -370,7 +372,7 @@ fi
- [ ] `history --combined`
- [x] `shopt -s histappend`
-#### Q33. What is the difference between the $@ and $* variables?
+#### Q33. What is the difference between the $@ and $\* variables?
- [x] `$@ treats each quoted argument as a separate entity. $* treats the entire argument string as one entity.`
- [ ] `$* treats each quoted argument as a separate entity. $@ treats the entire argument string as one entity.`
@@ -448,6 +450,7 @@ done
```bash
ls Hello[[.vertical-line.]]World
```
+
It's matches also `Hello[[.vertical-line.]]World` file but if we have this and `Hello|World` file will always be matched last one
- [ ] `Nothing, this is an invalid file glob.`
@@ -477,6 +480,7 @@ else
echo "Is not numeric"
fi
```
+
- [x] Any sequence of characters that includes an integer
- [ ] The user would have to enter the character sequence of ^[0-9]]+$ Only this will prove to be true and "Is numeric" would be printed on the screen due to incorrect syntax. By encapsulating the regular expression in double quotes every match will fail except the text string ^[0-9]+$
- [ ] One or more characters that only includes integers
@@ -490,7 +494,7 @@ mysql < file.sql > out.txt
- [ ] The output on the screen will be identical to out.txt
- [x] There will be no output on the screen as it's being redirected to out.txt.
-- [ ] The output on the screen will be identical to out.txt plus line numbers.
+- [ ] The output on the screen will be identical to out.txt plus line numbers.
- [ ] The out.txt file will hold STDERR and STDOUT will go to the screen.
#### Q43. How would you find the last copy command run in your history?
@@ -502,10 +506,10 @@ mysql < file.sql > out.txt
#### Q44. In order to write a script that iterates through the files in a directory, which of the following could you use?
-- [ ] ```bash for i in $(ls); do ... done```
-- [ ] ```bash for $(ls); do ... done```
-- [x] ```bash for i in $ls; do ... done```
-- [ ] ```bash for $ls; do ... done```
+- [ ] `bash for i in $(ls); do ... done`
+- [ ] `bash for $(ls); do ... done`
+- [x] `bash for i in $ls; do ... done`
+- [ ] `bash for $ls; do ... done`
#### Q45 When executing a command and passing the output of that command to another command, which character allows you to chain these commands together?
@@ -529,12 +533,12 @@ echo $greeting, everybody!
#### Q47. Which statement checks whether the variable num is greater than five?
-- [ ] (( $num -gt 5 ))
+- [ ] (( \$num -gt 5 ))
- [ ] [[ $num -lt 5 ]]
-- [x] (( $num > 5 ))
-- [ ] $num > 5
+- [x] (( \$num > 5 ))
+- [ ] \$num > 5
-#### Q48. Using Bash extended globbing, what will be the output of this command?
+#### Q48. Using Bash extended globbing, what will be the output of this command?
ls -l
apple
@@ -544,16 +548,18 @@ banapple
pineapple
strawberry
-$ shopt -s extglob
-ls -l @(ba*(na)|a+(p)le)
+\$ shopt -s extglob
+ls -l @(ba\*(na)|a+(p)le)
- [ ] a
+
```bash
apple
banana
```
- [ ] b
+
```bash
apple
banana
@@ -564,6 +570,7 @@ strawberry
```
- [ ] c
+
```bash
apple
banana
@@ -573,6 +580,7 @@ pineapple
```
- [ ] d
+
```bash
apple
banana
@@ -581,12 +589,12 @@ banapple
pineapple
```
-#### Q49. When used from within a script, which variable contains the name of the script?
-- [x] $0
-- [] $# // number of positional parameters
-- [] $$ // pid of the current shell
-- [] $@ // array-like construct of all positional parameters
+#### Q49. When used from within a script, which variable contains the name of the script?
+- [x] \$0
+- [] \$# // number of positional parameters
+- [] \$\$ // pid of the current shell
+- [] \$@ // array-like construct of all positional parameters
#### Q50. What does the + signify at the end of the 10-digit file permissions on data.txt?
@@ -598,22 +606,23 @@ ls -l
- [x] There is an access control list
- [] There is an extended attribute such as immutable set
-
Training questions
+
#### Q1. What does this command do?
+
cat > notes -
+
- [x] Accepts text from standard input and places it in "notes"
- [] Creates "notes" and exits
- [] Outputs the content of notes and deletes it
- [] Appends text to the existing "notes"
#### Q2. What is the output of:
+
VAR="This old man came rolling"
-echo "${VAR//man/rolling}"
+echo "\${VAR//man/rolling}"
- [x]This old rolling came rolling
- []This old man came man
- []This old man came rolling
- []This old came
-
-
diff --git a/c (programming language)/c quiz.md b/c (programming language)/c quiz.md
index ad9a02cd38..f396daf5b3 100644
--- a/c (programming language)/c quiz.md
+++ b/c (programming language)/c quiz.md
@@ -1,22 +1,27 @@
-C (Programming Language) Assessment
--------------
+## C (Programming Language) Assessment
##### Q1. Which Code saple will eventually cause the computer to run out of memory ?
-- [x]
+
+- [x]
+
```c
while(1)
{
char *smallString = (char *) malloc(10);
}
```
-- [ ]
+
+- [ ]
+
```c
long long number = 1;
while(1)
number *= 2;
```
-- [ ]
+
+- [ ]
+
```c
while(1)
{
@@ -24,7 +29,9 @@ while(1)
memset(hugeString, 0, 1000000L);
}
```
-- [ ]
+
+- [ ]
+
```c
while(1)
{
@@ -32,7 +39,7 @@ while(1)
memset(bigArray, 1000000, 1000);
free(bigArray);
}
-```
+```
#### Q2. What will this code print on the screen?
@@ -54,22 +61,20 @@ int f1 (int a, int b)
main()
{
if (f1(20,10) || f1(10,20))
- printf("C is fun!\n");
+ printf("C is fun!\n");
}
```
-- [x] A is greater then B
-C is fun!
-
-- [ ] A is greater then B
- B is greater then A
-C is fun!
-- [ ] A is greater then B
- B is greater then A
+- [x] A is greater then B
+ C is fun!
+- [ ] A is greater then B
+ B is greater then A
+ C is fun!
-- [ ] Northing is printed on Screen
-
+- [ ] A is greater then B
+ B is greater then A
+- [ ] Northing is printed on Screen
#### Q3. What is the name for calling a function inside the same function?
@@ -80,29 +85,29 @@ C is fun!
#### Q4. What does the declaration of variable c2 demonstrate?
-```c
+```c
main(){
char c1 ='a';
char c2 = c1+10;
}
```
+
- [x] character arithmetic
- [ ] undefined assignment
- [ ] type conversion
- [ ] invalid declaration
-
#### Q5. A pointer to void named vptr, has been set to point to a floating point variable named g. What is the valid way to dereference vptr to assign its pointed value to a float variable named f later in this program?
-```c
+```c
float g;
void *vptr=&g;
```
-- [ ] f = *(float *)vptr;
-- [ ] f = (float *)vptr;
-- [x] f = (float)*vptr;
-- [ ] f = *(float)vptr;
+- [ ] f = _(float _)vptr;
+- [ ] f = (float \*)vptr;
+- [x] f = (float)\*vptr;
+- [ ] f = \*(float)vptr;
#### Q6. What is this declaration an example of?
@@ -113,36 +118,40 @@ struct s {
struct s *s2;
};
```
+
- [x] a node
- [ ] a linked list
- [ ] a stack
- [ ] a binary tree
-
-#### Q7. A C header file is a file with extension .h that contains function declarations and macro definitons to be shared between several source files. Header files are listed using the preprocessing directive #include, and can have one of the following formats: #include <fileA> or #include "fileB". What is the difference between these two formats?
+#### Q7. A C header file is a file with extension .h that contains function declarations and macro definitons to be shared between several source files. Header files are listed using the preprocessing directive #include, and can have one of the following formats: #include <fileA> or #include "fileB". What is the difference between these two formats?
- [ ] The preprocessor will try to locate the fileA in same directory as the source file, and the fileB in a predetermined directory path.
- [ ] The preprocessor will try to locate the fileA in the fixed system directory. It will try to locate fileB in the directory path designated by the -l option added to the command line while compiling the source code.
- [ ] The file using fileA syntax must be system files, of unlimited number. fileB must be a user file at a maximun of one per source file.
-- [x] The preprocessor will try to locate the fileA in a predetermined directory path. It will try to locate fileB in the same directory as the source file along with a custom directory path.
-
+- [x] The preprocessor will try to locate the fileA in a predetermined directory path. It will try to locate fileB in the same directory as the source file along with a custom directory path.
#### Q8. Using a for loop, how could you write a C code to count down from 10 to 1 and display each number on its own line?
-- [ ]
+- [ ]
+
```c
for (int i = 0; i>=0, i--){
printf("%d\n", i);
}//end of loop
```
-- [ ]
+
+- [ ]
+
```c
int i;
for (i=1; i<=10; i++){
printf("%d", i);
}
```
+
- [ ]
+
```c
int i = 10;
while (i>0){
@@ -150,7 +159,9 @@ while (i>0){
i--;
}
```
+
- [x]
+
```c
int i;
for (i= 10; i>0; i--){
@@ -165,7 +176,6 @@ for (i= 10; i>0; i--){
- [ ] register
- [ ] typedef
-
#### Q10. What does the program shown below return?
```c
@@ -184,7 +194,6 @@ int main(){
- [ ] 2
- [ ] 0
-
#### Q11. Using the Union declaration below, how many bytes of memory space will the data of this type occupy?
```c
@@ -200,7 +209,6 @@ union Cars{
- [x] 30
- [ ] 52
-
#### Q12. In this code sample, what is not a problem for C compiler?
```c
@@ -215,7 +223,6 @@ main(){
- [ ] The data type of PI needs to be float not int.
- [ ] The printf statement needs to use PI, not pi.
-
#### Q13. Which is the smallest program to compile and run without errors?
- [ ] main()
@@ -224,6 +231,7 @@ main(){
- [ ] main() { ; }
#### Q14. What is optional in a function declaration?
+
- [ ] data type of parameters
- [ ] return type of function
- [x] parameter names
@@ -271,7 +279,7 @@ main(){
- [ ] by using recursive functions
- [ ] by using global variables
-#### Q21. A union allows you to store differente _____ in the same _____.
+#### Q21. A union allows you to store differente **\_** in the same **\_**.
- [ ] Objects; Structure
- [ ] Variables; Declaration
@@ -295,7 +303,7 @@ main(){
#### Q23. What is the difference between scanf() and sscanf() functions?
-- [ ] The scanf() function reads data formatted as a string; The sscanf() function reads string input from the screen.
+- [ ] The scanf() function reads data formatted as a string; The sscanf() function reads string input from the screen.
- [x] The scanf() function reads formatted data from the keyword; The sscanf() function reads formatted input from a string.
- [ ] The scanf() function reads string data from the keyword; The sscanf() function reads string data from a string.
- [ ] The scanf() function reads formatted data from a file; The sscanf() function reads input from a selected string
diff --git a/c#/c-sharp-quiz.md b/c#/c-sharp-quiz.md
index b4f786eba7..b83a6cc145 100644
--- a/c#/c-sharp-quiz.md
+++ b/c#/c-sharp-quiz.md
@@ -1,11 +1,10 @@
-C# Assessment
--------------
+## C# Assessment
#### Q1. In which of these situations are interfaces better than abstract classes?
-- [ ] When you need to define an object type's characteristics, use an interface. When you need to define an object type's capabilities, use an abstract class.
+- [ ] When you need to define an object type's characteristics, use an interface. When you need to define an object type's capabilities, use an abstract class.
- [ ] Interfaces are a legacy of older versions of C#, and are interchangeable with the newer abstract class feature.
-- [X] When you need a list of capabilities and data that are classes-agnostic, use an interface. When you need a certain object type to share characteristics, use an abstract class.
+- [x] When you need a list of capabilities and data that are classes-agnostic, use an interface. When you need a certain object type to share characteristics, use an abstract class.
- [ ] You should use both an interface and an abstract class when defining any complex object.
#### Q2. Which statement is true of delegates?
@@ -25,22 +24,30 @@ C# Assessment
#### Q4. How would you determine if a class has a particular attribute?
- [ ] .
+
```
-var type = typeof(SomeType);
+var type = typeof(SomeType);
var attribute = type.GetCustomAttribute();
```
+
- [ ] .
+
```
var typeof(MyPresentationModel).Should().BeDecoratedWith();
```
+
- [ ] .
+
```
Attribute.GetCustomAttribute, typeof(SubControllerActionToViewDataAttribute)
```
+
- [x] .
+
```
Attribute.GetCustomAttribute(typeof(ExampleController), typeof(SubControllerActionToViewDataAttribute))
```
+
#### Q5. What is the difference between the ref and out keywords?
- [ ] Variables passed to out specify that the parameter is an output parameter, while ref specifies that a variable may be passed to a function without being initialized.
@@ -56,6 +63,7 @@ Attribute.GetCustomAttribute(typeof(ExampleController), typeof(SubControllerActi
- [ ] dependency injection
#### Q7. What is this code an example of?
+
```
private static object objA;
private static object objB;
@@ -73,10 +81,11 @@ Attribute.GetCustomAttribute(typeof(ExampleController), typeof(SubControllerActi
{
lock (objA)
{
- lock (objB) { }
+ lock (objB) { }
}
}
```
+
- [ ] a private class that uses multithreading
- [ ] multithread coding
- [ ] thread mismanagement
@@ -100,7 +109,7 @@ Attribute.GetCustomAttribute(typeof(ExampleController), typeof(SubControllerActi
- [ ] The .Equals method compares reference identities while the == compares contents.
- [ ] The .Equals method compares primitive values while == compares all values.
-- [X] The .Equals method compares contents while == compares references reference identity.
+- [x] The .Equals method compares contents while == compares references reference identity.
- [ ] The .Equals method compares reference type while == compares primitive value types.
#### Q11. Which choice best describes a deadlock situation?
@@ -120,7 +129,7 @@ Attribute.GetCustomAttribute(typeof(ExampleController), typeof(SubControllerActi
#### Q13. What is an object in C#?
- [ ] a class or struct, including its variables and functions
-- [ ] a primitive data type that can be created only at compile time
+- [ ] a primitive data type that can be created only at compile time
- [ ] a value type that can be used only with an abstract class
- [x] an instance of a class or struct that includes fields, properties, and/or methods
@@ -132,15 +141,18 @@ Attribute.GetCustomAttribute(typeof(ExampleController), typeof(SubControllerActi
- [ ] Anonymous userData = new Anonymous { name = "John", age = 32 };
#### Q15. What will be returned when this method is executed?
+
`
public void userInput(string charParamters) { }
`
-- [X] nothing
+
+- [x] nothing
- [ ] a Boolean
- [ ] a string variable
- [ ] an integer
#### Q16. In what order would the employee names in this example be printed to the console?
+
`
string[] employees = { "Joe", "Bob", "Carol", "Alice", "Will" };
@@ -153,6 +165,7 @@ Attribute.GetCustomAttribute(typeof(ExampleController), typeof(SubControllerActi
Console.WriteLine(employee);
}
`
+
- [x] ascending
- [ ] unordered
- [ ] descending
@@ -167,18 +180,18 @@ Attribute.GetCustomAttribute(typeof(ExampleController), typeof(SubControllerActi
#### Q18. What is the correct formatting for single line and multiline comments?
-- [ ] /*/ - Single Line
- /* - Multiline
+- [ ] /_/ - Single Line
+ /_ - Multiline
- [ ] // Multiline
- /* Single Line */
-- [ ] //* Multiline
+ /_ Single Line _/
+- [ ] //\* Multiline
/ Single Line
- [x] // Single Line
- /* Multiline */
+ /_ Multiline _/
#### Q19. How do you make a method in an abstract class overridable?
-- [ ] Make it public
+- [ ] Make it public
- [ ] Make it static
- [ ] Make it private
- [x] Make it virtual
@@ -250,7 +263,7 @@ Attribute.GetCustomAttribute(typeof(ExampleController), typeof(SubControllerActi
- [ ] system actions that communicate directly with the compiler at runtime
- [ ] actions that execute when the code compiles, generating logs and test output
-- [x] actions that generate notifications, which are sent to their registered listeners** <= Correct
+- [x] actions that generate notifications, which are sent to their registered listeners\*\* <= Correct
- [ ] user-only methods that send data to the application's back end
#### Q30. What kind of values can arrays store?
@@ -261,6 +274,7 @@ Attribute.GetCustomAttribute(typeof(ExampleController), typeof(SubControllerActi
- [x] multiple variables, or collections, of the same type
#### Q31. Given this enumeration, how would you access the integer-type value of 'AppState.Loading'?
+
`
enum AppState { OffLine, Loading, Ready }
`
@@ -278,6 +292,7 @@ Attribute.GetCustomAttribute(typeof(ExampleController), typeof(SubControllerActi
- [x] \w
#### Q33. To conform to the following interface, which of its members need to be implemented?
+
```
public interface INameble
{
@@ -285,6 +300,7 @@ Attribute.GetCustomAttribute(typeof(ExampleController), typeof(SubControllerActi
string LastName { get; }
}
```
+
- [x] Both the FirstName and LastName properties need to be implemented.
- [ ] Neither, they are both optional.
- [ ] Only the LastName property needs to be implemented.
@@ -311,68 +327,71 @@ Attribute.GetCustomAttribute(typeof(ExampleController), typeof(SubControllerActi
- [ ] To communicate between classes and object
- [ ] To store the class definition value
-#### Q37. When would you use generics in your code?
-- [ ] to increase code performance
-- [x] all of these answers
-- [ ] when code reuse is a priority
-- [ ] when type safety is important
-
-#### Q38. What prints to the console when this code is executed?
-`
-public delegate void AuthCallback(bool validUser); public static AuthCallback loginCallback : Login;
-public static void Login() {
-Console.WriteLine("Valid user!");
-}
-public static void Main(string[] args) {
-loginCallback(true);
-}
-`
-
-- [ ] Login successful...
-- [ ] Valid user!
+#### Q37. When would you use generics in your code?
+
+- [ ] to increase code performance
+- [x] all of these answers
+- [ ] when code reuse is a priority
+- [ ] when type safety is important
+
+#### Q38. What prints to the console when this code is executed?
+
+`public delegate void AuthCallback(bool validUser); public static AuthCallback loginCallback : Login; public static void Login() { Console.WriteLine("Valid user!"); } public static void Main(string[] args) { loginCallback(true); } `
+
+- [ ] Login successful...
+- [ ] Valid user!
- [x] an error, because the method signature of Login doesn't match the delegate //It will throw an error because you cant apply Inheritance to methods that way.
-- [ ] Login successful... Valid user!
+- [ ] Login successful... Valid user!
+
+#### Q39. How would you declare a sealed class named User?
+
+- [ ] public class User
+- [ ] abstract User {}
+- [x] sealed class User
+- [ ] private sealed class User
-#### Q39. How would you declare a sealed class named User?
-- [ ] public class User
-- [ ] abstract User {}
-- [x] sealed class User
-- [ ] private sealed class User
+#### Q40. How would you write a delegeate named ResultCallback with an int parameter named responseCode?
-#### Q40. How would you write a delegeate named ResultCallback with an int parameter named responseCode?
- [ ] `public delegate void ResultCallback<(int) responseCode>`;
- [ ] `public delegate ResultCallback(int responseCode)`;
- [x] `public delegate void ResultCallback(int responseCode)`;
- [ ] `public void delegate ResultCallback`;
#### Q41. What is the difference between non-static and static classes?
+
- [] non-static classes need to be initialized before use, while static classes do not
- [] non-static classes are accessible only from an interface while static classes are accessible from anywhere
- [] non-static classes need to initialize all class members at runtime, while static classes do not
- [] non-static classes do not need to be initialized while static classes do
#### Q42. Which characteristic prevents this code from compiling?
+
public int age="28"
+
- [x] type safety
- [] single inheritance
- [] dependency injection
- [] multiple inheritance
#### Q43. How would you serialize this class?
+
public class User {}
+
- [] mark the User class with the DeserializableAttribute
- [] Declare it as public serializable class User {}
- [] Mark it with the SerializableAttribute
- [] Declare it as private serializable class User{}
#### Q44. How would you write a delegate named ResultCallback with an int parameter named responseCode
+
- [] public delegate ResultCallback(int responseCode)
- [] public delegate void ResultCallback<(int) responseCode>;
- [] public void delegate ResultCallback;
- [x] public delegate void ResultCallback(int responseCode);
#### Q45. What is the difference between a static and non-static method?
+
- [] non-static methods always need to have a void return type
- [] non-static methods do not have access to static member variables
- [x] static methods do not have to instantiate an instance of the class to call the method
-- [] static methods always have to be public
\ No newline at end of file
+- [] static methods always have to be public
diff --git a/c++/c++quiz.md b/c++/c++quiz.md
index 068e3a8255..c9f3ce712b 100644
--- a/c++/c++quiz.md
+++ b/c++/c++quiz.md
@@ -1,244 +1,224 @@
-C++ LinkedIn Assesment Questions Answers
--
+## C++ LinkedIn Assesment Questions Answers
Q1. What is printed from this code?
- vector v(22);
- bool b= (v[6]);
- printf("%d",!b);
-
- a) False
- b) 0
- c) 1 << Correct
- d) This code has an error
+ vector v(22);
+ bool b= (v[6]);
+ printf("%d",!b);
+
+ a) False
+ b) 0
+ c) 1 << Correct
+ d) 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;
-
- a) The compiled code is always bigger because of all of the imported symbols.
- b) 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.
- c) It automatically includes all header files in the standard library (cstdint,cstdlib,cstdio,iostream etc). << Correct
- d) 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.
+Using namespce std;
+a) The compiled code is always bigger because of all of the imported symbols.
+b) 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.
+c) It automatically includes all header files in the standard library (cstdint,cstdlib,cstdio,iostream etc). << Correct
+d) 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?
- typedef struct {
- unsigned int age : 4;
- unsigned char gender :1;
- unsigned int size : 2;
- } child_t;
+typedef struct {
+unsigned int age : 4;
+unsigned char gender :1;
+unsigned int size : 2;
+} child_t;
- a) 7 bits. << Correct
- b) 25 bytes.
- c) 1 bit.
- d) 1 bytes.
+ a) 7 bits. << Correct
+ b) 25 bytes.
+ c) 1 bit.
+ d) 1 bytes.
Q4. Which of the following shows the contents of vector v1 and v2 after running this code?
- std:: vector v1{1,2,3},v2;
- v2=v1;
- v1.push_back(4);
- v2.push_back(5);
-
- a) Error <<< Correct because std::vector v1{1,2,3}; doesn't compile, It should be std::vector v1{1,2,3};
- b) v1:{1,2,3,4};
- v2:{5};
- c) v1:{1,2,3,4,5};
- v2:{1,2,3,4,5};
- d) v1:{1,2,3,4};
- v2:{1,2,3,5}; << Correct
+std:: vector v1{1,2,3},v2;
+v2=v1;
+v1.push_back(4);
+v2.push_back(5);
+
+ a) Error <<< Correct because std::vector v1{1,2,3}; doesn't compile, It should be std::vector v1{1,2,3};
+ b) v1:{1,2,3,4};
+ v2:{5};
+ c) v1:{1,2,3,4,5};
+ v2:{1,2,3,4,5};
+ d) v1:{1,2,3,4};
+ v2:{1,2,3,5}; << Correct
Q5. Which of the following is a true statement about the difference between pointers and iterators?
-
- a) While pointers are variable that hold memory address, iterators are generic functions used to traverse containers. These function allows the programmer to implement read and write code as the container is traversed. << Correct
- b) Incrementing an iterator always means access the next element in the container(if any) , no matter the container. Incrementing the pointer means pointing to the next element in memory, not always the next element.
- c) Pointers are variables that hold memory address where as iterator are unsigned integers that refers to offsets in arrays.
- d) All iterator are implemented with pointers so all iterators are pointers but not all pointers are iterators.
-
-Q6. What's a benefit of declaring the parameter as a const reference instead of declaring it as a regular object.
-
- int median(const my_arrary &a);
-
- a) The argument is passed as a reference so the function receives a copy that can be modified without affecting the original value.
- b) The argument is passed as a reference,so all if the passed my_array object is large, the program will require less time and memory. << Correct
- c) Actually object can't be passed as regular variable because they require a constructor call. Therefore a const reference is the only way to pass class instances to functions.
- d) There are no benefits because a reference and an object are treated as the same thing.
+a) While pointers are variable that hold memory address, iterators are generic functions used to traverse containers. These function allows the programmer to implement read and write code as the container is traversed. << Correct
+b) Incrementing an iterator always means access the next element in the container(if any) , no matter the container. Incrementing the pointer means pointing to the next element in memory, not always the next element.
+c) Pointers are variables that hold memory address where as iterator are unsigned integers that refers to offsets in arrays.
+d) All iterator are implemented with pointers so all iterators are pointers but not all pointers are iterators.
+
+Q6. What's a benefit of declaring the parameter as a const reference instead of declaring it as a regular object.
+int median(const my_arrary &a);
+a) The argument is passed as a reference so the function receives a copy that can be modified without affecting the original value.
+b) The argument is passed as a reference,so all if the passed my_array object is large, the program will require less time and memory. << Correct
+c) Actually object can't be passed as regular variable because they require a constructor call. Therefore a const reference is the only way to pass class instances to functions.
+d) There are no benefits because a reference and an object are treated as the same thing.
Q7. What's the storage occupied by u1?
- union {
- unit16_t a;
- unit32_t b;
- int8_t c;
- } u1;
-
- a) 4 bytes << Correct You can see example [here](https://en.cppreference.com/w/cpp/language/union)
- b) 7 bytes
- c) 8 bytes
- d) 2 bytes
+union {
+unit16_t a;
+unit32_t b;
+int8_t c;
+} u1;
+a) 4 bytes << Correct You can see example [here](https://en.cppreference.com/w/cpp/language/union)
+b) 7 bytes
+c) 8 bytes
+d) 2 bytes
Q8. Which of the following operators is overloadable?
- a) ?:
- b) new << Correct
- c) ::
- d) .
+ a) ?:
+ b) new << Correct
+ c) ::
+ d) .
Q9. Which of the following shows the contents of vector pointed by v1 and v2 after running this code?
- std:: vector *v1 = new std:: vector ({1,2,3});
- std:: vector *v2;
- v2=v1;
- v1->push_back(4);
- v2->push_back(5);
-
- a) *v1:{1,2,3,4};
- *v2:{5};
- b) *v1:{1,2,3,4'5};
- *v2:{1,2,3,4,5};
- c) Error << Correct
- d) *v1:{1,2,3,4};
- *v2:{1,2,3,5};
+std:: vector *v1 = new std:: vector ({1,2,3});
+std:: vector *v2;
+v2=v1;
+v1->push_back(4);
+v2->push_back(5);
+
+ a) *v1:{1,2,3,4};
+ *v2:{5};
+ b) *v1:{1,2,3,4'5};
+ *v2:{1,2,3,4,5};
+ c) Error << Correct
+ d) *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?
-
- a) Because structor are part of the c programming language there some complexity between c and c++ struct This is not the case with classes.
- b) Classes may have member function;struct private.
- c) 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/)
- d) 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?
-
- a) typedef struct {
- 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++.
- b) typedef char[7]: weekdays;
- c) typedef struct {
- bit sunday:1;
- bit monday:1;
- // more days
- bit fridyas:1;
- bit satarday:1;
- } weekdays;
- d) typedef struct {
- bit sunday;
- bit monday;
- // more days
- bit friday;
- bit satarday;
- } weekdays;
+a) Because structor are part of the c programming language there some complexity between c and c++ struct This is not the case with classes.
+b) Classes may have member function;struct private.
+c) 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/)
+d) 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?
+
+ a) typedef struct {
+ 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++.
+ b) typedef char[7]: weekdays;
+ c) typedef struct {
+ bit sunday:1;
+ bit monday:1;
+ // more days
+ bit fridyas:1;
+ bit satarday:1;
+ } weekdays;
+ d) typedef struct {
+ bit sunday;
+ bit monday;
+ // more days
+ bit friday;
+ bit satarday;
+ } weekdays;
Q12. What is an lvalue?
-
- a) It's a constant expression , meaning an expression composed of constants and operations.
- b) It's an expression that represents an object with an address. << Correct
- c) It's an expression suitable for the left hand side operand in binary operation.
- d) It's a location value , meaning a memory address suitable for assigning to pointer or reference.
+a) It's a constant expression , meaning an expression composed of constants and operations.
+b) It's an expression that represents an object with an address. << Correct
+c) It's an expression suitable for the left hand side operand in binary operation.
+d) It's a location value , meaning a memory address suitable for assigning to pointer or reference.
Q13. What does auto type specifier do in this line of code (since c++ 11)?
- a) It specifies that the type of x will be deducted from the initializer in this case,double.
- b) It specifies that the type of x is automatic meaning that if can be assigned different type of data throughout the program.
- c) It specifies that x is a variable with automatic storage duration. << Correct
- d) It soecifies that more memory will be allocated for x in case it needs more space, avoiding loss of data due to overflow.
+ a) It specifies that the type of x will be deducted from the initializer in this case,double.
+ b) It specifies that the type of x is automatic meaning that if can be assigned different type of data throughout the program.
+ c) It specifies that x is a variable with automatic storage duration. << Correct
+ d) It soecifies that more memory will be allocated for x in case it needs more space, avoiding loss of data due to overflow.
Q14. What is a class template?
- a) It's a class written with the generic programming , specifying behavior in terms of type parameter rather than specific type. << Correct
- b) It's a blank superclass intended for inheritence and polymorphism.
- c) It's class that only consists of member variable , with no constructor , destructor nor member functions.
- d) It's skelton source code for a class where the programming has to fill in specific parts to define the data types and algorithms used.
+ a) It's a class written with the generic programming , specifying behavior in terms of type parameter rather than specific type. << Correct
+ b) It's a blank superclass intended for inheritence and polymorphism.
+ c) It's class that only consists of member variable , with no constructor , destructor nor member functions.
+ d) It's skelton source code for a class where the programming has to fill in specific parts to define the data types and algorithms used.
Q15. What is the ternary operator equivalent to this code snippet?
- if(x)
- y=a;
- else
- y=b;
-
- a) y=a?b:x;
- b) y=if(x?a:b);
- c) y=(x&a)?a:(x&b)?b:0;
- d) y=x?a:b; << Correct
-
-
+ if(x)
+ y=a;
+ else
+ y=b;
+
+ a) y=a?b:x;
+ b) y=if(x?a:b);
+ c) y=(x&a)?a:(x&b)?b:0;
+ d) y=x?a:b; << Correct
+
Q16. What is the output of this code? What is the output of this code?
- #include
- 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);
- }
-
- a) x = 10 and y = 20 x = 11 and y = 19
- b) x = 11 and y = 19 x = 10 and y = 20
- c) x = 10 and y = 19 x = 11 and y = 20 << Correct
- d) x = 11 and y = 20 x = 10 and y = 19
-
+ #include
+ 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);
+ }
+
+ a) x = 10 and y = 20 x = 11 and y = 19
+ b) x = 11 and y = 19 x = 10 and y = 20
+ c) x = 10 and y = 19 x = 11 and y = 20 << Correct
+ d) x = 11 and y = 20 x = 10 and y = 19
-
Q.17 What is the meaning of the two parts specified between parentheses in a range-based for loop, separated by a colon?What is the meaning of the two parts specified between parentheses in a range-based for loop, separated by a colon?
- a) The first is a variable declaration that will hold an element in a sequence. The second is the sequence to traverse.
-
- b) The first is an iterator, and the second is the increment value to be added to the iterator. The first is an iterator, and the second is the increment value to be added to the iterator.
+ a) The first is a variable declaration that will hold an element in a sequence. The second is the sequence to traverse.
+ b) The first is an iterator, and the second is the increment value to be added to the iterator. The first is an iterator, and the second is the increment value to be added to the iterator.
- c) The first is the iterating variable. The second is an std::pair that specifies the range (start and end) in which the variable will iterate.The first is the iterating variable. The second is an std::pair that specifies the range (start and end) in which the variable will iterate.
+ c) The first is the iterating variable. The second is an std::pair that specifies the range (start and end) in which the variable will iterate.The first is the iterating variable. The second is an std::pair that specifies the range (start and end) in which the variable will iterate.
+
+
+ d)The first is a container object. The second is an std::pair that specifies the range (start and end) in which the elements will be accessed within the loop.The first is a container object. The second is an std::pair that specifies the range (start and end) in which the elements will be accessed within the loop.
- d)The first is a container object. The second is an std::pair that specifies the range (start and end) in which the elements will be accessed within the loop.The first is a container object. The second is an std::pair that specifies the range (start and end) in which the elements will be accessed within the loop.
-
Q.18 What is the output of this piece of code? What is the output of this piece of code?
int8_t a=200;
-uint8_t b=100;
+uint8_t b=100;
if(a>b) {
-std::cout<<"greater";
+std::cout<<"greater";
else std::cout<<"less";
}
+ a) 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. << Correct
+ b)greaternull
+ c)lessnull
+ d)There is no output because there is a compiler error.There is no output because there is a compiler error.
- a) 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. << Correct
- b)greaternull
- c)lessnull
- d)There is no output because there is a compiler error.There is no output because there is a compiler error.
-
Q.20 What results from executing this code snippet? What results from executing this code snippet?
-int x=5, y=2; if(x & y){ /*part A*/ } else{ /*part B*/ }
+int x=5, y=2; if(x & y){ /_part A_/ } else{ /_part B_/ }
- a) Part A executes because x==5 (true) and y==2 (true), thus the AND operation evaluates as true.Part A executes because null (true) and null (true), thus the null operation evaluates as true.
+ a) Part A executes because x==5 (true) and y==2 (true), thus the AND operation evaluates as true.Part A executes because null (true) and null (true), thus the null operation evaluates as true.
- b) Part B executes because (x & y) results in 0, or false.Part B executes because null results in 0, or false. <` element is an example of an inline element. `` is an example of a block element.
+- [ ] A `