Cert Exam Prep: Exam : Programming with C#

Slides:



Advertisements
Similar presentations
MIX 09 4/15/ :14 PM © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Advertisements

Session 1.
Feature: Assign an Item to Multiple Sites © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names.
© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or.
© 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or.

© 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks.
© 2008 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or.

What’s new in Entity Framework Core 2.0
Microsoft Virtual Academy
TFS Database Import Service for Visual Studio Team Services
Get Typed with TypeScript!
Optimizing Microsoft OneDrive for the enterprise
What a Real, Functioning DevOps Team Looks Like
Virtual Machine Diagnostics in Microsoft Azure
SQL Server on Linux on All-Flash Arrays
Workflow Orchestration with Adobe I/O
Customize Office 365 Search and create result sources
How we got a traditional bank collaborating across boundaries
Online virtual labs: The hidden gem for free hands-on learning, practice, and exploration CA Callahan.
9/12/2018 7:18 AM THR1081 Don’t be the first victim of new malware Turn Windows Defender AV Cloud Protection on! Amitai Senior Program.
Automate all things! Microsoft Azure continuous deployment
TechEd /13/2018 7:46 PM © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks.
Agile Planning with Visual Studio Team Services (VSTS)
Servicing Windows 10 in the Real World
9/22/2018 3:49 AM BRK2247 Learn from MVPs: Panel discussion on all things SharePoint and OneDrive © Microsoft Corporation. All rights reserved. MICROSOFT.
Confidence at speed: Visual Studio 2017 and your CI pipeline
Azure PowerShell Aaron Roney Senior Program Manager Cormac McCarthy
11/22/2018 © 2014 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks.
Continuous Delivery with Visual Studio Team Services
Azure Advisor: Optimization in the best way
PowerShell Unplugged Jeffrey Snover Technical Fellow
Super Charge Your Debugging in Visual Studio
Accelerate Office 365 Adoption Through Microsoft FastTrack Services
Microsoft products for non-profits
Introduction to ASP.NET Core 1.0
Five cool things you can do with Windows PowerShell on Office 365
Securely pass passwords into your deployment
Yammer for IT Tom Kretzmer Solutions Developer, Westinghouse THR1016
Microsoft Exchange: Through the eyes of MVPs (Panel discussion)
MDM Migration Analysis Tool (MMAT)
Overview: Dynamics 365 for Project Service Automation
Understand your Azure cloud assets dependencies with BMC Discovery
Hostage Negotiation, Special Ops and Office 365 Adoption
Silverlight Debugging
Breaking Down the Value of A Yammer Post: 20 Things to Do
8/04/2019 9:13 PM © 2006 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Cool Microsoft Edge Tips and Tricks
When Bad Things Happen to Good Applications
Getting the most out of Azure resources with Azure Advisor
SharePoint 2013 Authentication with Azure – Part 1
Manage your App Service resources using Command line tools
“Hey Mom, I’ll Fix Your Computer”
Windows 8 Security Internals
4/28/2019 3:30 AM THR1061 Learn how Dynamics 365, Office 365 and related applications work together to transform the workplace Donna Edwards Solution Architect.
Виктор Хаджийски Катедра “Металургия на желязото и металолеене”
Consolidate, manage, backup, and secure your cloud content
Designing Bots that Fit Your Organization
Ask the Experts: Windows 10 deployment and servicing
Passwordless Service Accounts
Шитманов Дархан Қаражанұлы Тарих пәнінің
SharePoint 2013 Authentication with Azure – Part 2
Digital Transformation: Putting the Jigsaw Together
WCF and .NET Framework Microservices in Containers
Diagnostics and troubleshooting in Azure App Service Support Center
Optimizing your content for search and discovery
7/5/2019 © 2014 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks.
Mobile App Management David Alessi — Support Topic Owner for Enterprise Windows Phone, Microsoft Corporation Simon May — Enterprise Device Infrastructuralist,
Presentation transcript:

Cert Exam Prep: Exam 70-483: Programming with C# BRK3162 Cert Exam Prep: Exam 70-483: Programming with C# Mark Rosenberg Technical Instructor New Horizons © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Ubiquitous Outline Slide What we’re going to cover: Technical content Couple of exam tips

A Little More Detail What we will touch on: What we won’t touch on: Complex concepts Technologies you might not be familiar with Sample questions What we won’t touch on: Console.WriteLine("Hello, world!");

Outline Manage program flow Create and use types Debug applications and implement security Implement data access

Roadmap – Developer Certification Exam 483 can be used as an elective in MCSD: Web Applications MCSD: SharePoint Applications MCSA: SQL Server 2012 http://bit.ly/Ignite-CertApp

Check the Exam Guide Exam 70-483 Guide Skills Measured Functional groups and individual topics Relative weighting of functional groups Links to more information about functional topics Preparation Options

70-483 Exam Outline Objective % Manage program flow 25% TechEd 2012 11/10/2018 6:06 AM 70-483 Exam Outline Objective % Manage program flow 25% Create and use types 24% Debug applications and implement security Implement data access 26% © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Outline Manage program flow Create and use types Debug applications and implement security Implement data access

Creating threads Thread object ThreadPool Advantage: complete control over thread Disadvantage: complete control over thread ThreadPool CLR manages a pool of threads based on environment New ThreadPool requests are placed in queue Preferred over creating threads manually

Tasks Represents an asynchronous operation References an Action delegate Can have a return type No parameters Can have a state object

Cancel task

async and await Offers simplest method of asynchronous development async method can run on a separate thread await keyword instructs runtime to pause until async method completes Other threads are not blocked

async and await syntax

Understanding Async Task ... LoadSettingsAsync Task ... DownloadAsync DPE Metro Template 11/10/2018 Understanding Async Click async void Button1_Click(){ await LoadSettingsAsync(); UpdateView(); } Task ... LoadSettingsAsync LoadSettings async Task LoadSettingsAsync() { await IO.Network.DownloadAsync(path); } Message pump Task ... DownloadAsync Download Click © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Async void is only for event handlers TechReady 16 11/10/2018 Async void is only for event handlers private async void Button1_Click(object Sender, EventArgs e) { try { SendData("https://secure.flickr.com/services/oauth/request_token"); await Task.Delay(2000); DebugPrint("Received Data: " + m_GetResponse); } catch (Exception ex) { rootPage.NotifyUser("Error posting data to server." + ex.Message); private async void SendData(string Url) { var request = WebRequest.Create(Url); using (var response = await request.GetResponseAsync()) using (var stream = new StreamReader(response.GetResponseStream())) m_GetResponse = stream.ReadToEnd(); © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Async void is only for event handlers TechReady 16 11/10/2018 Async void is only for event handlers private async void Button1_Click(object Sender, EventArgs e) { try { SendData("https://secure.flickr.com/services/oauth/request_token"); // await Task.Delay(2000); // DebugPrint("Received Data: " + m_GetResponse); } catch (Exception ex) { rootPage.NotifyUser("Error posting data to server." + ex.Message); private async void SendData(string Url) { var request = WebRequest.Create(Url); using (var response = await request.GetResponseAsync()) // exception on resumption using (var stream = new StreamReader(response.GetResponseStream())) m_GetResponse = stream.ReadToEnd(); © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Parallel.ForEach

Question You have the following code. (Line numbers are for reference only) 1. var items = new List<string> 2. {"Christopher", "Susan", "Veronica"}; 3. var result = items.Where(n => Method1(n)); 4. foreach (var item in result) { tbStatus.Text += item + "\n"; } Method1 takes several seconds to complete. You need to ensure your code executes in the shortest amount of time possible. What should you do? Update line 1 to var items = new List<object> Update line 3 to var result = items.Where(n => Method1(n)).AsParallel(); Update line 3 to var result = items.AsParallel().Where(n => Method1(n)); Update line 4 to foreach (var item in result.AsParallel())

Question You have the following code. (Line numbers are for reference only) 1. var items = new List<string> 2. {"Christopher", "Susan", "Veronica"}; 3. var result = items.Where(n => Method1(n)); 4. foreach (var item in result) { tbStatus.Text += item + "\n"; } Method1 takes several seconds to complete. You need to ensure your code executes in the shortest amount of time possible. What should you do? Update line 1 to var items = new List<object> Update line 3 to var result = items.Where(n => Method1(n)).AsParallel(); Update line 3 to var result = items.AsParallel().Where(n => Method1(n)); Update line 4 to foreach (var item in result.AsParallel()) Correct answer: C

Question You have a method that accesses a database, using the following code. private void Method1(string data) { try { ... } catch (Exception ex) { } You need to ensure the original exception is thrown back to caller. What code should you add to line 7? throw; throw ex; throw new Exception(ex); return ex;

Question You have a method that accesses a database, using the following code. private void Method1(string data) { try { ... } catch (Exception ex) { } You need to ensure the original exception is thrown back to caller. What code should you add to line 7? throw; throw ex; throw new Exception(ex); return ex; Correct answer: A

Outline Manage program flow Create and use types Debug applications and implement security Implement data access

Constructors and inheritance

Creating generic methods and classes

Question You create a class using the following code: public class Class1 { ... } You add the following method to a class named Class2: using(var class1 = new Class1()) { ... } You need to ensure Class1 functions correctly in the using statement. What interface should you implement? ICloneable IDisposable IEquatable IComparer

(and other methods/classes/etc.) Question You create a class using the following code: public class Class1 { ... } You add the following method to a class named Class2: using(var class1 = new Class1()) { ... } You need to ensure Class1 functions correctly in the using statement. What interface should you implement? ICloneable IDisposable IEquatable Icomparer PRO TIP: All interfaces (and other methods/classes/etc.) must exist Correct answer: A

Question You have the following code (line numbers are for reference only) class Program { static void Main(string[] args) { var string1 = "String 1"; var class1 = new Class1(); } public class Class1 { public List<string> Collection1; You need to add string1 to Collection1. What lines of code should you do? (Choose all that apply. Each answer represents part of the solution.) Update line 3 to string string1 = "String 1"; Update line 4 to Class1 class1 = new Class1(); At line 5, insert class1.Collection1 = new List<string>(); At line 6, insert class1.Collection1.Add(string1);

Question Correct answers: C & D You have the following code (line numbers are for reference only) class Program { static void Main(string[] args) { var string1 = "String 1"; var class1 = new Class1(); } public class Class1 { public List<string> Collection1; You need to add string1 to Collection1. What lines of code should you do? (Choose 2. Each answer represents part of the solution.) Update line 3 to string string1 = "String 1"; Update line 4 to Class1 class1 = new Class1(); At line 5, insert class1.Collection1 = new List<string>(); At line 6, insert class1.Collection1.Add(string1); Correct answers: C & D

Outline Manage program flow Create and use types Debug applications and implement security Implement data access

Symmetric encryption Reversible encryption, single key System.Security.Cryptography.SymmetricAlgorithm DES RC2 TripleDES Hello, world! Hello, world! Agaa5#*26ayzzdft

Asymmetric Encryption Reversible encryption, two keys System.Security.Cryptography.AsymmetricAlgorithm DSA ECDsa RSA Hello, world! Hello, world! Agaa5#*26ayzzdft

Hashing Irreversible encryption System.Security.Cryptography.HashAlgorithm MD5 SHA1 SHA256 Agaa5#*26ayzzdft Hello, world!

Serialize and deserialize

Write to the event log

Configuring tracing in app.config <system.diagnostics> <sources> <source name="DemoSource" switchName="DemoSwitch“ switchType="System.Diagnostics.SourceSwitch"> <listeners> <add name="console" type="System.Diagnostics.ConsoleTraceListener" initializeData="false" /> <remove name="Default" /> </listeners> </source> </sources> <switches> <add name="DemoSwitch" value="Warning"/> </switches> </system.diagnostics>

Tracing, using app.config

Tracing, programmatically

Compiler directives

Outline Manage program flow Create and use types Debug applications and implement security Implement data access

Reading streams

Reading streams

LINQ query results (join) Pizza Food Pasta Food Soda Beverage Water Beverage Ketchup Condiment Mustard Condiment

LINQ query results (group) Group key: 1 Pizza Pasta Group key: 2 Soda Water Group key: 3 Ketchup Mustard

Question You are creating an app that will process orders. You need to ensure all orders are processed in the order in which they are received. What collection type should you use? Hashtable Dictionary Stack Queue

Question You are creating an app that will process orders. You need to ensure all orders are processed in the order in which they are received. What collection type should you use? Hashtable Dictionary Stack Queue Correct answer: D

Question You have the following code (line numbers are for reference only): var list1 = new List<int>() { 1, 2, 3, 4 }; var result = list1.Where(i => i > 3); foreach (var item in list1) { Console.WriteLine(item); } list1.Add(5); You need to ensure both foreach loops display the same data. What should you do? Update line 2 to var result = list1.Where(i => i > 3).ToList(); At line 3, insert lock(result); Update line 4 to foreach(var item in list1.ToList()) { Update line 8 to foreach(var item in list1.ToList()) {

Question You have the following code (line numbers are for reference only): var list1 = new List<int>() { 1, 2, 3, 4 }; var result = list1.Where(i => i > 3); foreach (var item in list1) { Console.WriteLine(item); } list1.Add(5); You need to ensure both foreach loops display the same data. What should you do? Update line 2 to var result = list1.Where(i => i > 3).ToList(); At line 3, insert lock(result); Update line 4 to foreach(var item in list1.ToList()) { Update line 8 to foreach(var item in list1.ToList()) { Correct answer: A

Resources Microsoft Learning Site microsoft.com/learning Your one-stop location for info on all available Microsoft certifications, training, and exam prep resources Microsoft Virtual Academy microsoftvirtualacademy.com Your source for on-demand, online technical training Microsoft Training and Certification Guide -Link to the app: http://aka.ms/ignite-certapp Interactive Windows 8.1 app, to help you choose and traverse your path

Please evaluate this session Tech Ready 15 11/10/2018 Please evaluate this session From your Please expand notes window at bottom of slide and read. Then Delete this text box. PC or tablet: visit MyIgnite https://myignite.microsoft.com/evaluations Phone: download and use the Microsoft Ignite mobile app https://aka.ms/ignite.mobileapp Your input is important! © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

11/10/2018 6:06 AM © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.