Wednesday, July 24, 2019

An introduction to Continuous Integration (CI), its benefits and tools used


What is Continuous Integration?


Continuous Integration is a development practice that requires developers to integrate code into a shared repository several times a day. Each commit is then verified by an automated build, allowing team to detect problems early.



Continuous Integration (CI) is the process of automating the build and testing of code every time a team member commits changes to version control. CI encourages developers to share their code and unit tests by merging their changes into a shared version control repository after every small task completion. Committing code triggers an automated build system to grab the latest code from the shared repository and to build, test, and validate the full master branch (also known as the trunk or main).

CI emerged as a best practice because software developers often work in isolation, and then need to integrate their changes with the rest of the team’s code base. Waiting days or weeks to integrate code creates many merge conflicts, hard-to-fix bugs, diverging code strategies, and duplicated efforts. CI requires the development team’s code to be continuously merged to a shared version control branch to avoid these problems.

CI keeps the master branch clean. Teams can leverage modern version control systems such as Git to create short-lived feature branches to isolate their work. A developer submits a “pull request” when the feature is complete and, on approval of the pull request, the changes get merged into the master branch. Then the developer can delete the previous feature branch. Development teams repeat the process for additional work. The team can establish branch policies to ensure the master branch meets desired quality criteria.

Teams use build definitions to ensure that every commit to the master branch triggers the automated build and testing processes. Implementing CI as described here ensures bugs are caught earlier in the development cycle, which makes them less expensive to fix. Automated tests run for every build to ensure builds maintain a consistent quality.


Benefits of Continuous Integration

Continuous Integration (CI) provides many benefits to the development process, including:
  • Improving code quality based on rapid feedback
  • Triggering for automated testing for every code change
  • Reducing build times for rapid feedback and early detection of problems (risk reduction)
  • Better managing technical debt and conducting code analysis
  • Reducing long, difficult, and bug-inducing merges
  • Increasing confidence in code base health long before production
  • Key Benefit: Rapid Feedback for Code Quality

Possibly the most important benefit of continuous integration is rapid feedback to the developer. If the developer commits something and it breaks the code, he or she will know that almost immediately from the build, unit tests, and through other metrics. If successful integration is happening across the team, the developer is also going to know if her or his code change breaks something that another team member did to a different part of the code base. This process removes very long, difficult, and drawn out bug-inducing merges, which allows organizations to deliver in a very fast cadence.

Continuous integration also enables tracking metrics to assess code quality over time, such as unit test pass rates, code which breaks frequently, code coverage trends, and code analysis. It can be used to provide information on what has been changed between builds for traceability benefits, as well as for introducing anecdotal evidence of what teams do in order to have a global view of build results.


Three Pillars of Continuous Integration


Continuous Integration relies on three foundational elements for successful implementation. For each element, your team needs to select the specific platforms and tools they will use, but you must ensure that you have established each pillar in order to proceed. The Three Pillars of Continuous Integration are:
  • A Version Control System
  • A Continuous Integration System
  • An Automated Build Process

Tools used for Continuous Integration:

SL.Version ControlContinuous IntegrationAutomated Build Process
1GitJenkinsMaven
2T-SVNBambooTeam Build
3PerforceTeamCityApache ANT
4CVSVisual Studio Team ServicesGradle




Monday, July 22, 2019

C# Interview Questions with Answers part 2



1. To create a custom exception, which class is required to be inherited?
A) SystemException
B) System.Exception
C) System.Attribute
D) Enumerable

Ans. B

2. How do you throw an exception so the stack trace preserves the information?
A) throw;
B) throw new Exception();
C) throw ex;
D) return new Exception();


Ans. A

3. You need to reference a method which returns a Boolean value and accepts two int parameters. Which of the following delegates would you use?
A) Func<int, int, bool> func;
B) Action<int, int, bool> act;
C) Func<bool, int, int> func;
D) Action<bool, int, int> act;

Ans. A

4. Which of the following keywords is useful for ignoring the remaining code execution and quickly jumping to the next iteration of the loop?
A) break;
B) yield;
C) jump;
D) continue;

Ans. D

5. Which of the following loops is faster?
A) for
B) do
C) Parallel.for
D) foreach

Ans. C

6. await keyword can only be written with a method whose method signature has:
A) static keyword
B) async keyword
C) lock keyword
D) sealed keyword

 Ans. B

7. Which keyword is used to prevent a class from inheriting?
A) sealed
B) lock
C) const
D) static

Ans. A

8. When handling an exception, which block is useful to release resources?
A) try
B) catch
C) finally
D) lock

Ans. A

9. Which of following methods is accurate for holding the execution of a running task for a specific time?
A) Thread.Sleep()
B) Task.Delay()
C) Task.Wait()
D) Task.WaitAll()

Ans. B


10. Which of the following methods is useful for holding the execution of a main thread until all background tasks are executing?
A) Thread.Sleep()
B) Task.WaitAll()
C) Task.Wait()
D) Thread.Join()

Ans. B

11. How would you chain the execution of a task so that every next task runs when the previous task finishes its execution? Which method you would use?
A) task.ContinueWith()
B) Task.Wait()
C) Task.Run()
D) Thread.Join()

Ans. A

12. In a switch statement, which keyword would you use to write a code when no case value satisfies?
A) else
B) default
C) return
D) yield

Ans. B

13. Foreach loop can only run on:
A) anything
B) collection
C) const values
D) static values

Ans. B

14. Which keyword is useful for returning a single value from a method to the calling code?
A) yield
B) return
C) break
D) continue

Ans. B

15. Which of the following collections is a thread-safe?
A) Dictionary<K,V>
B) Stack<T>
C) ConcurrentDictionary<K,V>
D) Queue

Ans. C

16. When running a long-running asynchronous operation that returns a value, which keyword is used to wait and get the result?
A) await
B) yield
C) return
D) async

Ans. A

17. Which of the following is the right syntax for using an asynchronous lambda expression?
 A) Task task = async () => { ... };
B) Task<Task> task = async () => { ... };
C) Func<Task> task = async () => { ... };
D) Action<Task> task = async (t) => { ... };

Ans. C

18. Which property or method of task can be used as an alternative of the await keyword?
A) Result
B) Wait()
C) WaitAll()
D) Delay()

Ans. A

19. Suppose you’re creating an application that needs a delegate that can hold a reference of a method that can return bool and accept an integer parameter. How would you define that delegate?
A) delegate bool myDelegate(int i, int j);
B) delegate bool (int i, int j);
C) delegate myDelegate(int i, int j);
D) delegate bool myDelegate(int i);

Ans. A



Friday, July 19, 2019

PMP Certification Exam questions with Answers


Free Project Management Professional (PMP) Certification Questions


1. Which of the following activities is NOT considered a project?

A. Developing a new software program
B. Production of automobile tires
C. Designing a space station
D. Developing a new advertising program
E. Preparing the site for the Olympic Games

Ans: B

2. The three primary objectives of a project to meet are:

    A. cost, quality, customer satisfaction
    B. customer satisfaction, budget, schedule
    C. scope, cost, time
    D. quality, scope, schedule

    Ans: C

    3. A project is different from a process, in that a project: (select all that apply)

      A. Creates a unique result or service
      B. Monitors routine operations
      C. Creates something non-unique
      D. Is temporary
      E. Has a start and end date

      Ans: A, D, E

      4. When a project is temporary, it doesn’t require Project Management.

        A. True
        B. False

        Ans: B

        5. This role is an integrator across functions and ensures the right resources are assigned to the project.

        A. Project Manager
        B. Functional Manager
        C. Senior Manager
        D. Project Sponsor

        Ans: A

        6. This role has specialist or expertise knowledge within an area in the organization.

          A. Project Manager
          B. Functional Manager
          C. Senior Manager
          D. Project Sponsor

          Ans: B

          7. To be successful, a Project Manager needs to have the following project management skills:
          (select all that apply)

            A. Managing a schedule, budget, and scope
            B. Managing risks and resolving issues
            C. Overseeing manufacturing operations
            D. Assembling the right project team
            E. Understanding the organization’s business goals
            F. Delivering on commitments
            G. Ensuring operational processes meet standards

            Ans: A, B, D, E, F

            8. Which behavioral skills ("soft skills") does a Project Manager need to have to be successful?
            (select all that apply)

              A. Leadership
              B. Resolving conflicts
              C. Leading an operational team, such as manufacturing
              D. Meeting Stakeholder expectations
              E. Communication, negotiation, and coaching
              F. Team building
              G. Managing a department, such as Engineering

              Ans: A, B, D, E, F

              9. As long as the right team members are selected for the project team, where they are physically located has no bearing on their ability to effectively work as a team.

                A. True
                B. False

                Ans: B

                10. A key responsibility of the Project Manager is to make sure the entire project team is staffed with the most expert persons.

                A. True
                B. False

                Ans: B

                11. To ensure a project team can effectively complete the objectives of the project, the Project Manager must:(select all that apply)

                  A. Ensure the properly skilled individuals are assigned to work
                  B. Ensure the team is located where it can be most effective
                  C. Ensure the team is not too big or too small to achieve the project goals
                  D. Ensure the team is staffed with resources who volunteered to work on the project
                  E. Ensure the team has one person to manage all communications amongst team members
                  F. Establish an environment of trust and open communication

                  Ans: A, B, C, F

                  12. A Project Manager must manage the Triple Constraint because: (select all that apply)

                    A. All 3 constraints must be balanced
                    B. The constraints don’t change through the life of the project
                    C. The customer may decide that one constraint is more important than the others
                    D. The project scope cannot change, only the cost and schedule can change
                    E. The project schedule can change without impacting the scope or cost of the project

                    Ans: A, C

                    13. Project Management involves a complex set of factors that must be effectively managed. They include: (select all that apply)
                    A. Controlling the project budget
                    B. Managing time and deliverable commitments
                    C. Managing risks
                    D. Managing the engineering department
                    E. Communicating information
                    F. Managing customer service employees
                    G. Leading a team

                    Ans: A, B, C, E, G


                    14. Your manager tells you that your project budget has been cut due to unforeseen financial pressures that the organization has encountered. In order to balance the Triple Constraint, the best choice is:

                    A. Reduce the scope of work and deliverables. Request additional money for the project.
                    B. Shorten the schedule. Deliver the same scope of work and deliverables.
                    C. Deliver the same scope of work and deliverables. Lengthen the schedule.
                    D. Reduce the scope of work and deliverables. Deliver to the same schedule.

                    Ans: D

                    15. Your manager tells you that your project needs to be delivered one month earlier than your original plan. In order to balance the Triple Constraint, the best choice is:
                    A. Decrease the budget. Reduce the scope of work and deliverables.
                    B. Increase the budget. Reduce the scope of work and deliverables.
                    C. Decrease the budget. Provide the original scope of work and deliverables.
                    D. Increase the budget. Provide the original scope of work and deliverables.

                    Ans: D

                    16. The customer has asked you to increase the scope by providing extra features in the project deliverables. In order to balance the Triple Constraint, the best choice is:


                    A. Tell your customer that it is impossible to add features so they need to let you deliver the original project features.
                    B. Decrease the scope of work and deliverables. Lengthen the schedule.
                    C. Lengthen the schedule and increase the budget.
                    D. Increase the budget and shorten the original schedule so that there is time to add the new features in.

                    Ans: C

                    17. During Project Execution, your project is behind schedule. Your boss tells you that the project schedule is the most important of the Triple Constraints and that the project cannot be delivered late. In order to balance the Triple Constraint you should:(select all that apply)

                      A. Cancel the project because the constraints are no longer balanced
                      B. Reduce the scope of work and deliverables
                      C. Increase the scope of work and deliverables
                      D. Increase the cost
                      E. Reduce the cost
                      F. Lengthen the schedule

                      Ans: B, D


                      18. NPV is a preferred measure over Payback Period because: (select all that apply)

                        A. NPV considers the time value of money in its calculation
                        B. NPV tells management how long it will take to recoup the initial investment
                        C. When the NPV is zero we know the Payback Period is too long
                        D. When NPV is greater than zero we know the Payback Period is less than 5 years
                        E. NPV tells management if the required rate of return will be met

                        Ans: A, E

                        19. Project A has a Payback Period of 2.5 years, an NPV of $9,500, and a Profitability Index of 1.15. Project B has a Payback Period of 3.0 years, a Profitability Index of 1.05, and an NPV of $10,000. Both Project A and B are multi-year projects. Select all the statements below that are true. (select all that apply)


                        A. Project A has a better Profitability Index than Project B

                        B. Both projects could be selected to proceed since the NPV is positive for both

                        C. Project B has a better NPV than Project A

                        D. Neither project would be good because the Profitability Index is too close to 1.0 and the NPV is low

                        E. Neither project would be good because they will not provide the required rate of return for the organization

                        F. Neither project would be good because the payback is too long

                        Ans: A, B, C

                        20. A 4-year project has a projected cash inflow of $5,000 in the first year, $10,000 in the second year, $15,000 in the third year, and $25,000 in the fourth year. It will cost $25,000 to implement the project. The required rate of return is 20%. What is the NPV?
                        Ans: 6848


                        21. The organizational structure where the Project Manager has the least authority is:

                          A. Pure project
                          B. Strong matrix
                          C. Weak matrix
                          D. Functional

                          Ans: D

                          22. Pure project structures have these characteristics: (select all that apply)

                            A. Full time project team
                            B. Resources report with a dotted line to the Project Manager
                            C. Have two bosses
                            D. Are typically used for multiyear projects
                            E. Project Managers have minimal authority

                            Ans: A, D

                            23. Matrix structures have these characteristics: (select all that apply)

                              A. Shared resources with projects and functions
                              B. Resources report only to the Project Manager
                              C. The Project Manager is typically the Functional Manager
                              D. Resources report with a dotted line to the Project Manager
                              E. Have two bosses
                              F. A simple structure

                              Ans: A, D, E

                              25. All structures have pros and cons so it doesn't matter which structure a Project Manager uses to achieve the project goals.
                              A. True
                              B. False

                              Ans: B

                              26. A Project Management Office: (select all that apply)

                                A. Provides financial accountants
                                B. Supports the Project Portfolio and selection process
                                C. Manages projects for the organization
                                D. Provides coaching support to Project Managers
                                E. Provides tool and process support to Project Managers
                                F. Provides a majority of the revenue for an organization

                                Ans: B, D, E

                                27. Project Management Offices should: (select all that apply)

                                  A. Follow the Project Management Institute® Standards for Project Management Offices
                                  B. Have objectives that are aligned to the business strategy
                                  C. Demonstrate value to the organization by increasing the success rate of projects
                                  D. Guarantee the success of a project
                                  E. Serve as a repository of best practices

                                  Ans: B, C, E

                                  28. The most influential Stakeholders on a project typically include the following: (select all that apply)

                                  A. The person/people funding the project
                                  B. The person/people overseeing the operations area
                                  C. The person/people who are the customer(s)
                                  D. The person/people sponsoring the project
                                  E. The person/people running the manufacturing process

                                  Ans: A, C, D

                                  29. A Project Manager must identify all project Stakeholders during Initiation for the following reasons: (select all that apply)
                                  A. Need to understand Stakeholder expectations and requirements
                                  B. Need to analyze Stakeholder influence
                                  C. Need to identify the Stakeholder role and function
                                  D. Need to assign the Stakeholders to project tasks
                                  E. Need to identify key relationships for project success
                                  F. Need to establish regular communications with Stakeholders
                                  G. Need to know who is leading the project team

                                  Ans: A, B, C, E, F

                                  30. Consider the high level description for the Project Charter for our mobile application project. Which one of the following descriptions would be considered correct for this project?

                                  A. The smartphone application will allow customers to view and to purchase our store merchandise remotely.

                                  B. The smartphone application will allow customers to search and view our store's merchandise for sale. Customers can purchase items for in-store pickup or to be mailed to a customer-provided delivery address. The smartphone application will simplify store purchases for customers as well as provide a more customer-friendly purchasing environment than competitors. The application will be integrated with the existing store inventory and sales systems, including web-based sales.

                                  C. The application will allow customers to view and buy merchandise while standing in the store. Customers can use the in-store kiosk to scan an item tag. The application will accept credit cards, debit cards, or cash for customers to pay for their items without having to wait in checkout lines. The application will send a receipt to their smartphone so that the customer has a record of the sale and a receipt for the purchase.

                                  D. The smartphone application will allow customers to enter an item description and view prices from any website that has that item for sale. In this way, the customer can find the lowest cost for that item. They can purchase the item directly from the website that offers the item for sale, or they can take their smartphone into a store and have the store match the lowest price for them so that they can get the item locally.

                                  Ans: B 

                                  31. Consider the objectives for the Project Charter for our mobile application project. Which of the following objectives are correctly written and applicable to this project? 
                                  (select all that apply)
                                  A. The application should be easy to use
                                  B. Increase sales by 10% within one fiscal year
                                  C. Increase customer base by 20% within one fiscal year
                                  D. The application should not cost too much
                                  E. Application will be completed within 6 months and not to exceed a cost of $150,000

                                  Ans: B, C, E

                                  32. Consider the high level requirements for the Project Charter for our mobile application project. Which of the following are actually requirements and applicable to this project? (select all that apply)
                                  A. Accessible on all mobile platforms (Android, Apple, Windows) for free
                                  B. Ensure experienced application developers are available to develop the software and test it
                                  C. Includes basic search feature as well as filters for item type, size, style, location, and price
                                  D. Ensure there are enough customers to test the product and provide feedback
                                  E. Securely accepts credit cards, debit cards, or PayPal for payment of merchandise
                                  F. Collects user profile information and stores it for easy retrieval for future purchases
                                  G. Integrated with the existing system database for the store inventory

                                  Ans: A, C, E, F, G

                                  33. Consider the schedule Milestones for the Project Charter for our mobile application project. Which of the following are actually Milestones and applicable to this project?(select all that apply)

                                    A. Requirements defined and documented
                                    B. Prototype build completed
                                    C. Designing the application interfaces
                                    D. Configuring the application
                                    E. Beta 1 version build completed
                                    F. Early launch feedback from Premier customers documented
                                    G. Testing the application

                                    Ans: A, B, E, F 

                                    34. Consider the resources for the Project Charter for our mobile application project. Which of the following resources would be considered correct for this project?
                                    (select all that apply)

                                      A. Budget provided for the project is not to exceed $150,000 and must cover the cost of smartphone devices for testing, including 3 smartphone options for each operating system

                                      B. The budget must cover the procurement of all hardware and software required for the development of the application

                                      C. The budget must cover building the store inventory system and database

                                      D. Resources would need to include the in-store sales staff that collect money from customers for items purchased

                                      E. Personnel would include Mobile Application Development resources with at least 5 years' experience, a Project Manager with at least 5 years of experience in mobile application development, and in-house application testers

                                      F. We can assume that marketing materials to promote the application will be created by existing Marketing staff and not included in the budget for this project

                                      Ans: A, B, E, F 

                                      35. Consider the overall project risks for the Project Charter for our mobile application project. Which of the following are feasible risks for this project?(select all that apply)

                                        A. Schedule milestone dates could be missed if there are delays in locating qualified resources for application development and testing.

                                        B. The budget estimates provided are estimates at this time. Costs could be higher if the customer identifies significant defects or issues with the prototype.

                                        C. The increased sales forecast could be missed if new customers are not identified.

                                        D. The mobile application has to work on different types of smartphones: Android, Apple and Windows.

                                        E. If the quality of the application is poor (contains defects/doesn't work right), then customers will not want to use it.

                                        F. Lack of experience in developing mobile applications could result in a poorly designed application.

                                        G. The project will require experienced developers that understand how to develop a mobile application of this type.

                                        Ans: A, B, C, E, F

                                        36. Consider the Stakeholders for the Project Charter for our mobile application project. Which of the following Stakeholders would be considered correct for this project?
                                        (select all that apply)

                                          A. The Store Owner as Project Sponsor to provide support and funding for the project

                                          B. Competitors who will want to have a similar mobile application for their merchandise sales

                                          C. A Project Manager who will be responsible to manage the project plan

                                          D. Mobile Application Developers who will be responsible to design and develop the application

                                          E. Website developers who support the store's existing web site

                                          F. Premier customers who will be part of the early launch of the product to provide feedback and areas for improvement on functionality and usability

                                          Ans: A, C, D, F

                                          37. Consider the approval requirements and exit criteria for the Project Charter for our mobile application project. Which of the following approval requirements and exit criteria would be considered correct for this project:
                                          (select all that apply)

                                            A. The Store Owner (Project Sponsor) will provide the final approval on the completion of the smartphone application.

                                            B. The application developer will provide the final approval on the completion of the smartphone application.

                                            C. Fifty existing customers will provide the final approval on the completion of the smartphone application.

                                            D. The project will be closed after meeting the following exit criteria: A fully tested and compliant smartphone application is available for Android, Apple, and Windows mobile devices. The smartphone application is integrated with store systems, including inventory and sales.

                                            E. If the application cannot securely accept customer payment, then the project will be cancelled.

                                            F. The project will be closed after the application passes all testing requirements.


                                            Ans: A, D, E


                                            38. Defining the project's scope includes: (select all that apply)

                                            A. Defining the budget for the project
                                            B. Defining schedule for the project
                                            C. Documenting a Project Scope Statement correct
                                            D. Documenting the product/result/service requirements correct
                                            E. Defining the work required to deliver the project successfully correctF. Documenting the WBS correct
                                            G. Documenting the Project Charter

                                            Ans: C, D, E, F

                                            39. Once we have the project scope defined, then we can begin the Execution Phase of the project.

                                            A. True
                                            B. False


                                            For next question please visit part 2 of this article : Free Project Management Professional (PMP) Certification Exam Questions Part 2


                                            For training you can choose:





                                            Tuesday, July 16, 2019

                                            List of countries and websites that provide e-Visa


                                            An increasing number of countries offer e-visas, which allow tourists to apply for a e-visa online without ever speaking with a consular officer. It’s all done remotely. The list contains 20 countries and their authorized government website for applying for e-visa.

                                            SLCountryWebsite
                                            1Armeniahttps://evisa.mfa.am/
                                            2Azerbaijanhttps://evisa.gov.az/en/
                                            3Bahrainhttps://www.evisa.gov.bh/
                                            4Cambodiahttps://www.evisa.gov.kh/
                                            5Cote d’Ivoirehttp://www.snedai.com/en/
                                            6Gabonhttps://evisa.dgdi.ga/
                                            7Georgiahttps://www.evisa.gov.ge/GeoVisa/
                                            8Indiahttps://indianvisaonline.gov.in/visa/index.html
                                            9Kenyahttp://evisa.go.ke/eligibility.html
                                            10Kuwaithttps://evisa.moi.gov.kw/evisa/home_e.do
                                            11Malaysiahttps://www.malaysiavisa.com.my
                                            12Moldovahttps://www.evisa.gov.md/#
                                            13Myanmarhttps://evisa.moip.gov.mm/
                                            14Rwandahttps://www.migration.gov.rw/index.php?id=203
                                            15Singaporehttps://save.ica.gov.sg/
                                            16Sri Lankahttp://www.eta.gov.lk/slvisa/visainfo/center.jsp
                                            17Turkeyhttps://www.evisa.gov.tr/en/
                                            18Ugandahttps://visas.immigration.go.ug/
                                            19Uzbekistanhttps://e-visa.gov.uz/main
                                            20Zambiahttps://eservices.zambiaimmigration.gov.zm/#/home



                                            Tuesday, July 9, 2019

                                            C# Interview Questions with Answers

                                            Common C# and .net Interview Questions

                                            C# Interview Questions


                                            1. Which of the following methods help us to convert string type data into integers? Select any two. 
                                            A) Convert.toInt32();
                                            B) Convert.Int32();
                                            C) int.parse();
                                            D) parse.int()


                                            2. Suppose you’re implementing a method name “Show” that will be able to take an unlimited number of int arguments. How are you going to define its method signature? 
                                            A) void Show(int[] arg)
                                            B) void Show(params int[] arg)
                                            C) void Show(int a)
                                            D) void Show(ref int a


                                            3. You need to use null-coalescing operator to make sure “name” variable must have a value not null. Select the right way to use null-coalescing operator in C#.

                                            A) string name = n ?? “No Name”;
                                            B) string name = “No Name” ?? null;
                                            C) string name = “No Name” ? null;
                                            D) string name = null ? “No Name”;


                                            4. Which jump statement will you use to start the next iteration while skipping the current iteration of loop?
                                            A) Break
                                            B) Continue
                                            C) Goto
                                            D) Return


                                            5. Which operator is used to compare types? 
                                            A) as
                                            B) is
                                            C) this
                                            D) ?

                                             

                                            6. Which operator is used to get instance data inside type definition? 

                                            A) as
                                            B) is
                                            C) this
                                            D) ?


                                            7. Which type cannot be instantiated? 

                                            A) enum type
                                            B) static type
                                            C) class type
                                            D) System.Object type


                                            8. The following code is boxed into object 

                                            o. double d = 34.5; 
                                            object o = d;

                                            You’re asked to cast “object o” into “int ”.
                                            A) int i = (int)o;
                                            B) int i = (int)(double)o;
                                            C) int i = (int)(float)(double)o;
                                            D) int i = (float)o;


                                            9. Suppose you’re developing an application which stores a user’s browser history. Which collection class will help to retrieve information of the last visited page?
                                            A) ArrayList
                                            B) Queue
                                            C) Stack
                                            D) HashTable


                                            10. Suppose you’re writing a class that needs a delegate who can refer a method(s) of two input string parameters and return an integer value. Choose the right delegate from the following options.
                                            A) Action<int, string, string>
                                            B) Func<string, string, int>
                                            C) Predicate<int, string, string>
                                            D) EventArgs<int, string, string>



                                            11. You are implementing a method that creates an instance of a class named Person. The Person class contains a public event named Die. The following code segment defines the Die event:

                                            Public event EventHandler Die;

                                            You need to create an event handler for the Die event by using a lambda expression.

                                            A) Person person = new Person();
                                                 person.Die = (s, e) => { /*Method Body*/};
                                            B) Person person = new Person();
                                                 person.Die -= (s, e) => { /*Method Body*/};
                                            C) Person person = new Person();
                                                 person.Die += (s, e) => { /*Method Body*/};
                                            D) Person person = new Person();
                                                  person.Die += () => { /*Method Body*/}



                                            12. Suppose you’re writing a method that has one input string parameter and it returns True if the value of the string input parameter is in upper case. Which of the following delegate(s) will you use to refer this method?
                                            A) Action<bool, string>
                                            B) Func<bool, string>
                                            C) Predicate<string>
                                            D) EventHandler


                                            13. In order to perform a query, a data source must be implemented by: 
                                            A) Enumerable or Queryable
                                            B) Enumerable and Queryable
                                            C) IEnumerable or IQueryable
                                            D) IEnumerable and IQueryable


                                            14. An application includes an object that performs a long-running process. You need to ensure that the garbage collector does not release the object's resources until the process completes.Which garbage collector method should you use?
                                            A) WaitForFullGCComplete()
                                            B) WaitForFullGCApproach()
                                            C) KeepAlive() 
                                            D) WaitForPendingFinalizers()



                                            15. Suppose you're writing an application that uses unmanaged resource. You've implemented an IDisposable interface to manage the memory of unmanaged resource. When implementing Dispose method, which method should you use to prevent garbage collector from calling the object's finalizer? 
                                            A) GC.SuppressFinalize(this)
                                            B) GC.SuppressFinalize(true)
                                            C) GC.WaitForFullGCApproach()
                                            D) GC.WaitForPendingFinalizers()


                                            16. You're instantiating an unmanaged resource; which of the following statements would you use to instantiate an unmanaged resource so that its Dispose method shall always call automatically? 
                                            A) if-else{}
                                            B) try/catch
                                            C) using()
                                            D) switch()


                                            17. Which of the following methods is used to run a LINQ query in parallel? 
                                            A) AsParallel();
                                            B) RunParallel();
                                            C) ToParallel();
                                            D) Parallel();


                                            18. How do you throw an exception to preserve stack-trace information? 
                                            A) throw;
                                            B) throw new Exception();
                                            C) throw e;
                                            D) return new Exception();


                                            19. Suppose you’re developing an application that require that need to define its own custom exceptions. Which of the following class you’d inherit to create a custom exception? 
                                            A) Attribute
                                            B) Exception
                                            C) IEnumerable
                                            D) IEnumerator


                                            20. You are developing an application that retrieves Person type data from the Internet using JSON. You have written the following function for receiving the data so far:

                                            serializer.Deserialize<Person>(json);

                                            Which code segment should you use before this function?
                                            A) DataContractJsonSerializer serializer = new DataContractJsonSerializer(typeof(Person));
                                            B) DataContractSerializer serializer = new DataContractSerializer(typeof(Person));
                                            C) JavaScriptSerializer serializer = new JavaScriptSerializer();
                                            D) NetDataContractSerializer serializer = new NetDataContractSerializer();


                                            21. You need to store a large amount of data in a file. Which serializer would you consider better?

                                            A) XmlSerializer
                                            B) DataContractSerializer
                                            C) DataContractJsonSerializer
                                            D) BinaryFormatter
                                            E) JavaScriptSerializer


                                            22. You want to serialize data in Binary format but some members don’t need to be serialized. Which attribute should you use?
                                            A) XmlIgnore
                                            B) NotSerialized
                                            C) NonSerialized
                                            D) Ignore 


                                            23. You want to retrieve data from Microsoft Access 2013, which should be read-only. Which class you should use? 
                                            A) SqlDataAdapter
                                            B) DbDataAdapter
                                            C) OleDbDataReader
                                            D) SqlDataReader


                                            24. Suppose you created the ASMX Web Service named SampleService. Which class you would use to create the proxy for this service? 

                                            A) SampleServiceSoapClient
                                            B) SampleService
                                            C) SampleServiceClient
                                            D) SampleServiceSoapProxy
                                             

                                            25. The application needs to encrypt highly sensitive data. Which algorithm should you use? 
                                            A) DES
                                            B) Aes
                                            C) TripleDES
                                            D) RC2



                                            26. You are developing an application which transmits a large amount of data. You need to ensure the data integrity. Which algorithm should you use? 
                                            A) RSA
                                            B) HMACSHA256
                                            C) Aes
                                            D) RNGCryptoServiceProvider


                                            27. Salt Hashing is done by: 
                                            A) Merging data with random value and perform cryptography.
                                            B) Merging data with random value and perform cryptanalysis.
                                            C) Merging data with random value and perform encryption.
                                            D) Merging data with random value and perform hashing.



                                            28. Which of the following methods is used for getting the information of the current assembly? 
                                            A) Assembly. GetExecutingAssembly();
                                            B) Assembly.GetExecutedAssembly();
                                            C) Assembly.GetCurrentAssembly();
                                            D) Assembly.ExecutingAssembly();



                                            29. Which class should you preferably use for tracing in Release Mode? 
                                            A) Debug
                                            B) Trace
                                            C) TraceSource
                                            D) All of the above


                                            30. Which method is the easiest way of finding the problem if you have no idea what it is? 
                                            A) Using Profiler
                                            B) Profiling by Hand
                                            C) Using Performance Counter
                                            D) Debugging


                                             Answers:
                                            1: A, C
                                            2. B
                                            3. A
                                            4. B
                                            5. B
                                            6. C
                                            7. B
                                            8. C
                                            9. C
                                            10. B
                                            11. C
                                            12. C
                                            13. C
                                            14. C
                                            15. A
                                            16. C
                                            17. A
                                            18. A
                                            19. B
                                            20. C
                                            21. D
                                            22. C
                                            23. C
                                            24. A
                                            25. B
                                            26. B
                                            27. D
                                            28. A
                                            29. C
                                            30. A