Upload
harry-porter
View
45
Download
5
Embed Size (px)
Citation preview
MT5604275
22MARDATE COMPLETED
00:52:12TIME TO COMPLETE
28/40RAW SCORE
#1OUT OF 3
ASP .NET
88%
C# 3.0 & 4.0
50%
Object Oriented Programming Theory
67%
Windows Communication Foundation 3.0
40%
XML Programming in .NET
75%
T-SQL
88%
Reverse Words
100%
ASP .NET
INTERMEDIATE
3/3100%
GROUP RANKING
#1OUT OF 3
SECTION TIMING
00:08:20GROUP AV 00:06:41 (+1M 38S)
TIME TO ANSWER
AV 00:02:46 (+32S)
Individual Report
Essential
73%
1/3 answered correctly 00:02:01 (+0) SELECTED: CORRECT
Selected by 1 others
Selected by 0 others
Selected by 1 others
Selected by 0 candidates
Microsoft Technology - ASP .NET - Intermediate - 25
Which of the following validation server controls are provided by ASP.NET?
Answer: ICustomValidator ControlAnswer: IIValidationSummary ControlAnswer: IIICompareValidator ControlAnswer: IVRequiredValueValidator Control
I, II and III
I, III and IV
II, III and IV
All the above
I don't know
Microsoft Technology - ASP .NET - Intermediate - 93
You elect to create the following simple XML file using XmlWriter.<product product ID=”999”“> <price>9.99</price></product>Which of the following code samples creates the above XML file?Answer: IXmlWriterSettings settings = new XmlWriterSettings();settings.Indent = true;settings.OmitXmlDeclaration = true;settings.NewLineOnAttributes = true;writer = XmlWriter.Create(Console.Out, settings);writer.WriteStartElement(” product “);writer.WriteAttributeString(“orderID”, “999”);writer.WriteElementString(“price”, “9.99”);writer.WriteEndElement(); writer.Flush();Answer: IIXmlWriterSettings settings = new XmlWriterSettings();settings.Indent = true;settings.OmitXmlDeclaration = true;settings.NewLineOnAttributes = true;writer = XmlWriter.Create(Console.Out, settings);writer.WriteStartElement(” product “);writer.WriteAttributeString(“orderID”, “999”);writer.WriteElement(“price”, “9.99”);writer.WriteEndElement(” product “); writer.Flush();
Answer: IIIXmlWriterSettings settings = new XmlWriterSettings();settings.Indent = true;settings.OmitXmlDeclaration = true;settings.NewLineOnAttributes = true;writer = XmlWriter.Create(Console.Out, settings);writer.WriteStartElement(” product “);writer.WriteAttributeString(“orderID”, “999”);writer.WriteElementString(“price”, “9.99”);writer.WriteEndElement(); writer.Close();writer.Flush();
Answer: IVXmlWriterSettings settings = new XmlWriterSettings();settings.Indent = true;settings.OmitXmlDeclaration = true;settings.NewLineOnAttributes = true;writer = XmlWriter.Create(Console.Out, settings);writer.WriteStartElement(” product “);writer.WriteAttributeString(“orderID”, “999”);writer.WriteElement(“price”, “9.99”);writer.WriteEndElement(” product “); writer.Flush();writer.Finalize();
1/3 answered correctly 00:05:07 (+0) SELECTED: CORRECT
Selected by 1 others
Selected by 1 others
XmlWriterSettings settings = new XmlWriterSettings();
settings.Indent = true;
settings.OmitXmlDeclaration = true;
settings.NewLineOnAttributes = true;
writer = XmlWriter.Create(Console.Out, settings);
writer.WriteStartElement(” product “);
writer.WriteAttributeString(“orderID”, “999”);
writer.WriteElementString(“price”, “9.99”);
writer.WriteEndElement();
writer.Flush();
XmlWriterSettings settings = new XmlWriterSettings();
settings.Indent = true;
settings.OmitXmlDeclaration = true;
settings.NewLineOnAttributes = true;
writer = XmlWriter.Create(Console.Out, settings);
writer.WriteStartElement(” product “);
writer.WriteAttributeString(“orderID”, “999”);
writer.WriteElement(“price”, “9.99”);
writer.WriteEndElement(” product “);
writer.Flush();
writer.Finalize();
XmlWriterSettings settings = new XmlWriterSettings();
settings.Indent = true;
settings.OmitXmlDeclaration = true;
settings.NewLineOnAttributes = true;
writer = XmlWriter.Create(Console.Out, settings);
writer.WriteStartElement(” product “);
writer.WriteAttributeString(“orderID”, “999”);
writer.WriteElementString(“price”, “9.99”);
writer.WriteEndElement();
writer.Close();
writer.Flush();
Selected by 0 others
Selected by 0 candidates
XmlWriterSettings settings = new XmlWriterSettings();
settings.Indent = true;
settings.OmitXmlDeclaration = true;
settings.NewLineOnAttributes = true;
writer = XmlWriter.Create(Console.Out, settings);
writer.WriteStartElement(” product “);
writer.WriteAttributeString(“orderID”, “999”);
writer.WriteElement(“price”, “9.99”);
writer.WriteEndElement(” product “);
writer.Flush();
I don't know
2/3 answered correctly 00:01:12 (+27s) SELECTED: CORRECT
Selected by 0 others
Selected by 0 others
Selected by 0 others
Selected by 1 candidates
Microsoft Technology - ASP .NET - Intermediate - 87
You create an ASP.NET application and deploy it to a web server running IIS 7.0. IIS is running in worker processisolation mode. Which process should you attach the debugger to in order to debug the application? Answer: Iaspnet_wp.exe
Answer: IIw3wp.exe
Answer: IIIinetinfo.exe
Answer: IVdllhost.exe
II
I
IV
III
I don't know
ADVANCED
2/367%
GROUP RANKING
#2OUT OF 3
SECTION TIMING
00:02:18GROUP AV 00:02:21 (-3.3S)
TIME TO ANSWER
AV 00:00:46 (-1.1S)
2/3 answered correctly Av 00:00:53 CORRECT
Selected by 0 others 00:01:04 SELECTED: INCORRECT
Selected by 0 others
Selected by 0 others
Selected by 0 candidates
Microsoft Technology - ASP .NET - Advanced - 33
How do you specify that ViewState data should be encrypted?
Answer: IAdd the ViewStateEncryptionMode=”Auto” attribute to the <pages> section in web.configAnswer: IIAdd the enableViewStateMac=”true” attribute to the <pages> section in web.configAnswer: IIIAdd the ViewStateEncryptionMode=”Always” attribute to the <pages> section in web.configAnswer: IVYou can’t encrypt ViewState Data
III
II
I
IV
I don't know
2/3 answered correctly 00:00:39 (+0.5s) SELECTED: CORRECT
Selected by 1 others
Selected by 0 others
Selected by 0 others
Selected by 0 candidates
Microsoft Technology - ASP .NET - Advanced - 28
What is the name given to a web hosting environment that uses a single server but multiple instances ofworker processes to service an application pool? Answer: IWeb FarmAnswer: IIWeb CommunityAnswer: IIIWeb GardenAnswer: IVWeb Park
III
I
II
IV
I don't know
2/3 answered correctly 00:00:35 (-0.5s) SELECTED: CORRECT
Selected by 0 others
Selected by 0 others
Selected by 1 others
Selected by 0 candidates
Microsoft Technology - ASP .NET - Advanced - 61
You define a custom configuration section in your web.config file. How do you add the source file containingthe implementation of this configuration to your project so that it is executed by ASP.NET?
Answer: IAdd the source file to the project as an embedded resourceAnswer: IIAdd the source file to the bin folderAnswer: IIIAdd the source file to the App_Code folderAnswer: IVIn Visual Studio open the Add Reference Dialog, select the Browse tab and locate the source file
II
III
I
IV
I don't know
EXPERT
2/2100%
GROUP RANKING
#1OUT OF 3
SECTION TIMING
00:02:35GROUP AV 00:01:30 (+1M 4S)
TIME TO ANSWER
AV 00:01:17 (+45S)
2/3 answered correctly 00:00:44 (+2.5s) SELECTED: CORRECT
Selected by 0 others
Selected by 0 others
Selected by 0 others
Selected by 1 candidates
Microsoft Technology - ASP .NET - Expert - 62
You want to combine all the assemblies for a compiled web site into to a single assembly that allows you toupdate UI elements separately from code. Which of the following tools could you use to accomplish this? Answer: IAspnet_mergeAnswer: IIAspnet_compressAnswer: IIIAspnet_compiler (using the –o option)Answer: IVDotNetObfuscator
I
II
III
IV
I don't know
2/3 answered correctly 00:01:51 (+42s) SELECTED: CORRECT
Selected by 0 others
Selected by 1 others
Selected by 0 others
Selected by 0 candidates
Microsoft Technology - ASP .NET - Expert - 83
You need to configure remote debugging for your ASP.NET application. You install the remote debuggingutility on the server. What user group should you add your user account to in order to debug the websiteremotely?Answer: IDebugger Users
Answer: IIAdministrators
Answer: IIIPower Users
Answer: IVPerformance Monitor Users
II
III
I
IV
I don't know
C# 3.0 & 4.0
INTERMEDIATE
1/333%
GROUP RANKING
#2OUT OF 3
SECTION TIMING
00:03:00GROUP AV 00:03:26 (-26S)
TIME TO ANSWER
AV 00:01:00 (-8.7S)
Essential
Microsoft Technology - C# 3.0 & 4.0 - Intermediate - 50
1/3 answered correctly Av 00:01:21 CORRECT
Selected by 0 others 00:02:04 SELECTED: INCORRECT
Selected by 1 others
Selected by 0 others
Selected by 0 candidates
What would be the output of executing the following code?
var data1 = new[] {1,2,3,4,5};var data2 = new[] {1,2,3,1,2,3,4,1,2};
var qry = from x in data1 join y in data2 on x equals y into z select new { x,z };
foreach (var result in qry){ Console.WriteLine( "{0}{1}", result.x, result.z.Count());}
13
23
32
41
50
11
21
31
41
51
19
29
39
49
13
23
32
41
I don't know
2/3 answered correctly Av 00:01:03 CORRECT
Selected by 0 others 00:00:34 SELECTED: INCORRECT
Selected by 0 others
Selected by 0 others
Selected by 0 candidates
Microsoft Technology - C# 3.0 & 4.0 - Intermediate - 54
Given this class
public class Car{ public string Model { get; set; } public string Colour { get; set; }}
What would be the output of executing the following code?
var result = (from c in new[] { new Car{ Model="A", Colour="Blue"}, new Car{ Model="B", Colour="Blue"}, new Car{ Model="A", Colour="Red"}, new Car{ Model="C", Colour="Green"}, new Car{ Model="D", Colour="Blue"} } group c by c.Model into g select g.Key) .Max();
Console.WriteLine(result);
D
Blue
Red
A
I don't know
1/3 answered correctly 00:00:22 (+0) SELECTED: CORRECT
Selected by 1 others
Selected by 0 others
Selected by 1 others
Selected by 0 candidates
Microsoft Technology - C# 3.0 & 4.0 - Intermediate - 74
Which of the following statements about the dynamic keyword are correct?Option: iA variable declared as dynamic has it’s type statically inferred by the compilerOption: iiAny object can be implicitly converted to dynamicOption: iiiAt compile time, a variable typed as dynamic is assumed to support any operationOption: ivThe var keyword provides the same functionality as the dynamic type
ii and iii
i and iv
iii and iv
i and ii
I don't know
ADVANCED
2/367%
GROUP RANKING
#1OUT OF 3
SECTION TIMING
00:03:08GROUP AV 00:04:14 (-1M 6S)
TIME TO ANSWER
AV 00:01:02 (-8.6S)
1/3 answered correctly Av 00:01:48 CORRECT
Selected by 0 others 00:00:58 SELECTED: INCORRECT
Selected by 1 others
Selected by 0 others
Selected by 0 candidates
Microsoft Technology - C# 3.0 & 4.0 - Advanced - 27
Given these three classes:
public class Foo { }
public class Bar : Foo { }
public static class Ex { public static void Foo(this Foo obj) { Console.WriteLine("Foo - Foo"); }
public static void Foo(this Bar obj) { Console.WriteLine("Foo - Bar"); }}
What would be the output of executing the following code?
var o = new Bar(); o.Foo(); ((Foo)o).Foo();
Foo – Bar
Foo – Foo
The code will fail with a runtime error
Foo – Bar
Foo – Bar
Foo – Foo
Foo – Foo
I don't know
1/3 answered correctly 00:01:11 (+0) SELECTED: CORRECT
Selected by 0 others
Selected by 0 others
Selected by 2 others
Selected by 0 candidates
Microsoft Technology - C# 3.0 & 4.0 - Advanced - 47
What would be the output of executing the following code?
object[] data1 = new object[] { "a", "b", "c", 1, 2, 3 };var source = data1.Cast<string>();var qry = from item in source select item.ToUpper();
foreach (var result in qry){ Console.WriteLine(result);}
A
B
C
ABC123
The code will fail with a runtime error
A
B
C
1
2
3
I don't know
2/3 answered correctly 00:00:59 (-12s) SELECTED: CORRECT
Selected by 0 others
Selected by 1 others
Selected by 0 others
Selected by 0 candidates
Microsoft Technology - C# 3.0 & 4.0 - Advanced - 51
What would be the output of executing the following code?
var qry = from x in new int[] { 1, 2, 3, 4, 5 } join y in new int[] { 1, 4, 6, 10, } on new { val=x*2 } equals new { val=y} select new { x, y };
foreach (var result in qry){ Console.WriteLine("{0}{1}", result.x,result.y);}
24
36
510
44
66
1010
11
24
36
410
12
24
36
48
510
I don't know
EXPERT
1/250%
GROUP RANKING
#3OUT OF 3
SECTION TIMING
00:02:05GROUP AV 00:02:25 (-20S)
TIME TO ANSWER
AV 00:01:02 (-10.0S)
3/3 answered correctly 00:01:00 (-12s) SELECTED: CORRECT
Selected by 0 others
Selected by 0 others
Selected by 0 others
Selected by 0 candidates
Microsoft Technology - C# 3.0 & 4.0 - Expert - 23
Which of the following conversions of lambda expressions to expression trees will successfully compile andexecute?Option: i
Expression<Func<int, int>> expression1 = x => x * 2;
Option: ii
Expression<Func<int, int>> expression2 = x => { return x * 2; };
Option: iii
Expression<Func<int, int>> expression3 = x => x * (Int32.Parse("2"));
Option: iv
Expression<Func<int, int>> expression4 = x => x * (() => Int32.Parse("2"));
i and iii
iii and iv
ii and iv
i and ii
I don't know
2/3 answered correctly Av 00:01:16 CORRECT
Selected by 0 others 00:01:05 SELECTED: INCORRECT
Selected by 0 others
Selected by 0 others
Selected by 0 candidates
Microsoft Technology - C# 3.0 & 4.0 - Expert - 28
Given this class
public static class Foo { public static bool ObjectIsNull(this object input) { return input == null; } }
What would be the output of executing the following code?
string bar = null; Console.WriteLine(bar.ObjectIsNull()); bar = "bar"; Console.WriteLine(bar.ObjectIsNull());
True
False
The code will throw a compilation error
The code will throw a runtime error
False
False
I don't know
Object Oriented Programming Theory
BASIC
3/475%
GROUP RANKING
#1OUT OF 3
SECTION TIMING
00:01:24GROUP AV 00:02:00 (-36S)
TIME TO ANSWER
AV 00:00:21 (-9.2S)
1/3 answered correctly 00:00:22 (+0) SELECTED: CORRECT
Selected by 0 others
Selected by 0 others
Selected by 0 others
Selected by 2 candidates
Object Oriented Programming Theory - Design Patterns - Basic - 4
Consider the design pattern description given below: Defines an interface for creating an object, but lets subclasses decide which class to instantiate, eliminatingthe need to bind application-specific classes into code Which is this design pattern?
Factory Method
Decorator
Singleton
Abstract Factory Method
I don't know
Essential
1/3 answered correctly 00:00:09 (+0) SELECTED: CORRECT
Selected by 0 others
Selected by 0 others
Selected by 1 others
Selected by 1 candidates
Object Oriented Programming Theory - Design Patterns - Basic - 15
Which design pattern should you implement if you are asked to add functionality or change the state of anobject at runtime?
Decorator
Factory
State
Proxy
I don't know
1/3 answered correctly 00:00:31 (+0) SELECTED: CORRECT
Selected by 1 others
Selected by 0 others
Selected by 0 others
Selected by 1 candidates
Object Oriented Programming Theory - Design Patterns - Basic - 12
Consider the design pattern description given below: Defines one-to-many dependency between objects to achieve updates in several objects when the base objectchanges its state Which is this design pattern?
Observer
Factory
State Change
Memento
I don't know
0/3 answered correctly Av 00:00:00 CORRECT
Selected by 1 others 00:00:22 SELECTED: INCORRECT
Selected by 0 others
Selected by 0 others
Selected by 1 candidates
Object Oriented Programming Theory - Design Patterns - Basic - 14
Which design pattern should you implement if you want an object to behave differently based on someargument passed to the class?
State
Proxy
Singleton
Bridge
I don't know
INTERMEDIATE
1/250%
GROUP RANKING
#1OUT OF 3
SECTION TIMING
00:01:57GROUP AV 00:01:53 (+3.7S)
TIME TO ANSWER
AV 00:00:58 (+1.8S)
1/3 answered correctly Av 00:01:22 CORRECT
Selected by 1 others 00:01:24 SELECTED: INCORRECT
Selected by 0 others
Selected by 0 others
Selected by 0 candidates
Object Oriented Programming Theory - SOLID - Intermediate - 11
You are developing a Heath Management application that maintains patients’ health information. In theapplication, you are using the SOLID principles of Object-Oriented Programming (OOP) to implement businesslogic. You have written the following code in the class library: Code: class Base { public: void funtion1(); — (i)virtual void funtion2(); — (ii)virtual void funtion3() = 0; — (iii)}; Which line in the given code has the “pure virtual” function?
iii
ii
i, ii and iii
i
I don't know
1/3 answered correctly 00:00:33 (+0) SELECTED: CORRECT
Selected by 0 others
Selected by 0 others
Selected by 0 others
Selected by 2 candidates
Object Oriented Programming Theory - DRY - Intermediate - 15
You are working as a developer in a software development company. You are using the DRY principles ofObject-Oriented Programming (OOP) to develop Web applications. Which of the following statements are correct about DRY principles? Option: i A sealed class can be inherited by a derived class Option: ii A static class contains only static members Option: iii A class that has an unsafe construct likes pointers Option: iv The instance of a class is not created if the class is abstract
ii, iii and iv
ii and iii
iii and iv
i, ii and iii
I don't know
Windows Communication Foundation 3.0
BASIC
1/250%
GROUP RANKING
#1OUT OF 3
SECTION TIMING
00:00:56GROUP AV 00:01:16 (-20S)
TIME TO ANSWER
AV 00:00:28 (-10S)
0/3 answered correctly Av 00:00:00 CORRECT
Selected by 2 others 00:00:39 SELECTED: INCORRECT
Selected by 0 others
Selected by 0 others
Selected by 0 candidates
Microsoft IT - Windows Communication Foundation 3.0 - Basic - 19
Explain the behaviour of following WCF client code: using (CalculatorClient client = new CalculatorClient()){ client.Add(1,2);}
‘Using’ pattern should not be used with WCF as it can produce undesired results
Code calls the Add method and properly disposes the WCF proxy
‘Using’ cannot be used with WCF clients
Service address must be specified in the constructor for this code to work
I don't know
Relevant
2/3 answered correctly 00:00:17 (-19s) SELECTED: CORRECT
Selected by 0 others
Selected by 1 others
Selected by 0 others
Selected by 0 candidates
Microsoft IT - Windows Communication Foundation 3.0 - Basic - 10
Which default security settings are enabled by BasicHttpBinding?
None
Message security
Transport security
Mixed security
I don't know
INTERMEDIATE
1/250%
GROUP RANKING
#1OUT OF 3
SECTION TIMING
00:01:08GROUP AV 00:01:28 (-20S)
TIME TO ANSWER
AV 00:00:34 (-10S)
1/3 answered correctly 00:00:34 (+0) SELECTED: CORRECT
Selected by 0 others
Selected by 1 others
Selected by 1 others
Selected by 0 candidates
Microsoft IT - Windows Communication Foundation 3.0 - Intermediate - 38
What are scenarios requiring the use of XMLSerializer over DataContractSerializer?
XmlSerializer offers precise control over the structure of the XML message being produced
XMLSerializer is deprecated in WCF
Faster XML serialization
XMLSerializer supports low memory consumption and is useful of memory constraint
environments
I don't know
1/3 answered correctly Av 00:01:04 CORRECT
Selected by 0 others 00:00:34 SELECTED: INCORRECT
Selected by 0 others
Selected by 0 others
Selected by 1 candidates
Microsoft IT - Windows Communication Foundation 3.0 - Intermediate - 39
What is the use of Windows Process Activation Service (WAS) in WCF?
WAS enables WCF services to be hosted in IIS over non-HTTP transports
WAS is the primary WCF hosting engine
WAS is used to host WCF services in a ‘Windows Service’
WAS is an IIS component and is not compatible with WCF
I don't know
ADVANCED
0/10%
GROUP RANKING
#1OUT OF 3
SECTION TIMING
00:00:32GROUP AV 00:00:40 (-8.3S)
TIME TO ANSWER
AV 00:00:32 (-8.3S)
0/3 answered correctly Av 00:00:00 CORRECT
Selected by 1 others 00:00:32 SELECTED: INCORRECT
Selected by 1 others
Selected by 0 others
Selected by 0 candidates
Microsoft IT - Windows Communication Foundation 3.0 - Advanced - 43
What’s the issue in following configuration in WCF 4.0?
The configuration is correct and defines a default service behavior
No endpoints defined within the service element
element must have a name attribute specified and the named behavior must be
linked to the service element
element must have a name attribute specified
I don't know
XML Programming in .NET
INTERMEDIATE
2/2100%
GROUP RANKING
#1OUT OF 3
SECTION TIMING
00:03:06GROUP AV 00:02:18 (+48S)
TIME TO ANSWER
AV 00:01:33 (+24S)
Relevant
3/3 answered correctly 00:01:32 (+11s) SELECTED: CORRECT
Selected by 0 others
Selected by 0 others
MS Web Development - XML Programming in .NET - Intermediate - 10
You are using XML in your Web application. In your application, you have written the following C# code: static void Main(string[] args){ Movie movie = new Movie(); movie.Title = “James Bond”; movie.ReleaseDate = DateTime.Parse(“10/8/1990”); movie.Rating = 14.3f; SerializeToXML(movie);}static public void SerializeToXML(Movie movie){ XmlSerializer serializer = new XmlSerializer(typeof(Movie)); TextWriter textWriter = new StreamWriter(@”C:\movie.xml”); serializer.Serialize(textWriter, movie); textWriter.Close();} When the above code is executed, what would the resulting movie.xml contain?
<?xml version=”1.0” encoding=”utf-8”?>
<Movie xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xmlns:xsd=”http://www.w3.org
/2001/XMLSchema”>
<Title>James Bond</Title>
<Rating>14.3</Rating>
<ReleaseDate>1990-08-10T00:00:00</ReleaseDate>
</Movie>
<?xml version=”1.0” encoding=”utf-8”?>
<Movie xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance”
xmlns:xsd=”http://www.w3.org/2001/XMLSchema”>
<Title>James Bond</Title>
<Rating>14.3</Rating>
<ReleaseDate>10/8/1990</ReleaseDate>
</Movie>
<?xml version=”1.0” encoding=”utf-8”?>
<Title>James Bond</Title>
<Rating>14.3</Rating>
<ReleaseDate>1990-08-10T00:00:00</ReleaseDate>
Selected by 0 others
Selected by 0 candidates
2/3 answered correctly 00:01:34 (+28s) SELECTED: CORRECT
Selected by 1 others
Selected by 0 others
Selected by 0 others
Selected by 0 candidates
MS Web Development - XML Programming in .NET - Intermediate - 1
You are using XML to store and retrieve data in your Web application. In one of your XML files, you need to insert a comment at runtime. Which code snippet should you use to achieve this?
<?xml version=”1.0” encoding=”utf-8”?>
<Movie xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance”
xmlns:xsd=”http://www.w3.org/2001/XMLSchema”>
<Title>James Bond,14.3,1990-08-10T00:00:00</Title>
</Movie>
I don't know
writer.WriteComment(“Company details.”);
writer.Comment(“Company details.”);
writer.XmlComment(“Company details.”);
writer.XmlWriteComment(“Company details.”);
I don't know
ADVANCED
1/250%
GROUP RANKING
#2OUT OF 3
SECTION TIMING
00:02:07GROUP AV 00:02:29 (-22S)
TIME TO ANSWER
AV 00:01:03 (-11S)
1/3 answered correctly Av 00:00:53 CORRECT
Selected by 1 others 00:00:28 SELECTED: INCORRECT
Selected by 0 others
Selected by 0 others
Selected by 0 candidates
MS Web Development - XML Programming in .NET - Advanced - 9
You are developing a Web application. In your application, you are using XML to store and transfer data. You have written the following XML and C# code: XML (Test.xml): <root xml:space=”preserve”> <test> This is great. </test></root> C#:
XDocument doc = XDocument.Load(“Test.xml”); Console.WriteLine(doc.Descendants(“root”).First()); What would the output be of executing the above code?
<root xml:space= “preserve”>
<test> This is great. </test>
</root>
<root>
<test> This is great. </test>
</root>
<root xml:space=”preserve”>
<test>This is great.</test>
</root>
<root>
<test>This is great.</test>
</root>
I don't know
3/3 answered correctly 00:01:39 (+5.0s) SELECTED: CORRECT
Selected by 0 others
Selected by 0 others
MS Web Development - XML Programming in .NET - Advanced - 2
You are developing an online movie ticket purchasing application. You are using XML to store and transferdata. In the application, you have the following Product.xml file: <Table> <Product> <Product_id>1</Product_id> <Product_name>Product 1</Product_name> <Product_price>1000</Product_price> </Product> <Product> <Product_id>2</Product_id> <Product_name>Product 2</Product_name> <Product_price>2000</Product_price> </Product> <Product> <Product_id>3</Product_id> <Product_name>Product 3</Product_name> <Product_price>3000</Product_price> </Product> <Product> <Product_id>4</Product_id> <Product_name>Product 4</Product_name> <Product_price>4000</Product_price> </Product></Table> You have written the following C# code to filter the XML data: XmlDocument xmldoc = new XmlDocument();XmlNodeList xmlnode = null;string str = null; FileStream fs = new FileStream(“Product.xml”, FileMode.Open, FileAccess.Read);xmldoc.Load(fs); xmlnode = xmldoc.GetElementsByTagName(“Product”);xmlnode[1].ChildNodes.Item(0).InnerText.Trim(); str = xmlnode[1].ChildNodes.Item(0).InnerText.Trim() + ” | ” + xmlnode[1].ChildNodes.Item(1).InnerText.Trim(); Console.WriteLine(str); What would the output of running the above code be?
2 | Product 2
3 | Product 3
1 | Product 1
Selected by 0 others
Selected by 0 candidates
4 | Product 4
I don't know
T-SQL
BASIC
4/4100%
GROUP RANKING
#1OUT OF 3
SECTION TIMING
00:02:10GROUP AV 00:02:25 (-15S)
TIME TO ANSWER
AV 00:00:32 (-3.8S)
3/3 answered correctly 00:00:42 (-6.3s) SELECTED: CORRECT
Selected by 0 others
Selected by 0 others
Selected by 0 others
Selected by 0 candidates
TSql - Basic - 3
A main requirement of a TSql developer is to get data into the database. Consider the “Users Table” below:ID FIRSTNAME SURNAME DATEOFBIRTH(MM-DD-YYYY) SEX
1 Alan Person 02-01-1970 M
2 Jane Doe 10-05-1980 F
3 Fred Bloggs 12-11-2005 M
4 Terri Trouble 07-20-1999 F
5 Bobby Tables 06-30-2009 M
Please select from the answers below which statement will correctly add a new row into the table for the following details: 6 - Percy Peabody born 15th August 2004 - Male
insert into users values(6, ‘Percy’, ‘Peabody’, ‘08-15-2004’, ‘M’)
add ‘Percy’, ‘Peabody’ into users with dateofbirth = ‘08-15-2004’ and sex = ‘M’ for id=6
add into users values(6, ‘Percy’, ‘Peabody’, ‘08-15-2004’, ‘M’)
insert ‘Percy’, ‘Peabody’ into users with dateofbirth = ‘08-15-2004’ and sex = ‘M’ for id=6
I don't know
Nice to Have
3/3 answered correctly 00:00:45 (+5.7s) SELECTED: CORRECT
Selected by 0 others
Selected by 0 others
Selected by 0 others
Selected by 0 candidates
TSql - Basic - 10
Consider the table “Users” below:ID FIRSTNAME SURNAME DATEOFBIRTH(MM-DD-YYYY) SEX
1 Alan Person 02-01-1970 M
2 Jane Doe 10-05-1980 F
3 Fred Bloggs 12-11-2005 M
4 Terri Trouble 07-20-1999 F
5 Bobby Tables 06-30-2009 M
While most table creation in TSql is performed using SQL Management studio, there will be times when you have to create atable using nothing more than raw TSql statements. Assuming that we don’t have to take indexes, nulls and other extrathings in to account, select from the list below the TSql statement that would be used to make the table we’ve been using forall the questions in this section so far:
create table users(ID integer, FIRSTNAME varchar(100),SURNAME varchar(100), DATEOFBIRTH date, SEX char(1)
create table(with ID,FIRSTNAME,SURNAME,DATEOFBIRTH,SEX) with values of (integer,
varchar, carchar, date, varchar) as users
make table users(ID integer, FIRSTNAME varchar(100), SURNAME varchar(100),
DATEOFBIRTH date, SEX char(1)
make table users add columns ID,FIRSTNAME,SURNAME,DATEOFBIRTH,SEX as integer,
string,string,date,string
I don't know
3/3 answered correctly 00:00:26 (-9.3s) SELECTED: CORRECT
Selected by 0 others
Selected by 0 others
Selected by 0 others
Selected by 0 candidates
TSql - Basic - 7
Outpu ng combined data is a commonly requested opera on in TSql. Consider the “Users” table below:ID FIRSTNAME SURNAME DATEOFBIRTH(MM-DD-YYYY) SEX
1 Alan Person 02-01-1970 M
2 Jane Doe 10-05-1980 F
3 Fred Bloggs 12-11-2005 M
4 Terri Trouble 07-20-1999 F
5 Bobby Tables 06-30-2009 M
You have been asked to provide the following:Produce a data set that lists all the users in the table, the output of this table should consist of 2 columns containing the fullname of the user and their date of birth, the columns should be labelled ‘Full name’ and ‘Birth date’ respectively. From the statements below, select which one will satisfy this request and produce the required data:
select FIRSTNAME + ’ ’ + SURNAME as [Full name], DATEOFBIRTH as [Birth date] from users
select ‘Full Name’ and ‘Birth date’ from users with firstname + surname and dateofbirth
select FIRSTNAME and SURNAME as FULLNAME, DATEOFBIRTH as BIRTHDAY in users
select fullname(FIRSTNAME, SURNAME), birthdate(DATEOFBIRTH) out of users
I don't know
3/3 answered correctly 00:00:17 (-5.3s) SELECTED: CORRECT
Selected by 0 others
Selected by 0 others
Selected by 0 others
Selected by 0 candidates
TSql - Basic - 8
Managing tables quite o en means dele ng unused data. Consider the “Users” table below:ID FIRSTNAME SURNAME DATEOFBIRTH(MM-DD-YYYY) SEX
1 Alan Person 02-01-1970 M
2 Jane Doe 10-05-1980 F
3 Fred Bloggs 12-11-2005 M
4 Terri Trouble 07-20-1999 F
5 Bobby Tables 06-30-2009 M
You have been asked to remove the users with id’s of 2 and 3 from the database as they no longer areregistered in the system, which of the following statements will accomplish this task:
delete from users where id in(2, 3)
remove records from users where id = 2 and id = 3
delete from uers if id is 2 or if id is 3
erase from users where id is(2, 3)
I don't know
INTERMEDIATE
3/475%
GROUP RANKING
#2OUT OF 3
SECTION TIMING
00:08:39GROUP AV 00:09:40 (-1M 1S)
TIME TO ANSWER
AV 00:02:09 (+6.7S)
2/3 answered correctly 00:00:34 (-26s) SELECTED: CORRECT
Selected by 0 others
Selected by 1 others
Selected by 0 others
Selected by 0 candidates
TSql - Intermediate - 4
Embedding sub queries within standard SQL statements is a good way to isolate individual entries from an otherwise large table ofdata. When we say isolate in this sense, we mean a specific singular query based on a singular criteria. Consider the “users” tablebelow:
ID FIRSTNAME SURNAME DATEOFBIRTH SEX BIRTHLOCATIONID MIGRATED CURRENTLOCATIONID
1 Alan Person 02-01-1970 M 1 False 1
2 Jane Doe 10-05-1980 F 1 True 6
3 Fred Bloggs 12-11-2005 M 2 False 4
4 Terri Trouble 07-20-1999 F 2 True 7
5 Bobby Tables 06-30-2009 M 5 False 2
6 Thomas Peabody 08-21-2011 M Null True 1
7 Angie Agenew 05-16-2007 F 7 Null Null
Given the following request:Produce a query that will return the oldest user in the users table, this query should return the id, firstname, surname andbirthdate in separate columns. Which of the following queries will produce the requested result:
SELECT TOP 1 u1.ID, u1.FIRSTNAME, u1.SURNAME, u1.DATEOFBIRTH FROM Users ORDER BY DATEOFBIRTH
SELECT (MAX(Year) FROM Users) INTO u1.ID, u1.FIRSTNAME, u1.SURNAME, u1.DATEOFBIRTH FROM Users u1
SELECT ID, FIRSTNAME, SURNAME, DATEOFBIRTH FROM Users WHERE year(DATEOFBIRTH) = (SELECT
MIN(YEAR(DATEOFBIRTH)) FROM Users)
SELECT TOP 1u1.ID + u1.FIRSTNAME + u1.SURNAME + u1.DATEOFBIRTH AS [Oldest User] FROM Users u1 WHERE
year(DATEOFBIRTH) = Oldest(YEAR FROM Users AS u2) ORDER WITH DATEOFBIRTH
I don't know
3/3 answered correctly 00:02:10 (-17s) SELECTED: CORRECT
Selected by 0 others
Selected by 0 others
Selected by 0 others
TSql - Intermediate - 1
Simple joins are a fact of life when building TSql queries. Most of the data you work with, will not just be in one single table, it willo en be split over several tables. As such, consider the table shema below:Users Table
ID FIRSTNAME SURNAME DATEOFBIRTH SEX BIRTHLOCATIONID MIGRATED CURRENTLOCATIONID
1 Alan Person 02-01-1970 M 1 False 1
2 Jane Doe 10-05-1980 F 1 True 6
3 Fred Bloggs 12-11-2005 M 2 False 4
4 Terri Trouble 07-20-1999 F 2 True 7
5 Bobby Tables 06-30-2009 M 5 False 2
6 Thomas Peabody 08-21-2011 M Null True 1
7 Angie Agenew 05-16-2007 F 7 Null Null
Locations Table
ID NAME COUNTRYID
1 London 1
2 Newcastle 1
3 Glasgow 1
4 Cardiff 1
5 Manchester 1
6 Sydney 2
7 New York 3
Country’s Table
ID NAME
1 United Kingdom
2 Australia
3 United States of America
Given the following requirements:Design a query, which will return all people listed in the database, this data set must contain the persons full name in asingle column, the year of their birth and the name of their birth location, no filtering shall be done on the dataset and all rowsshould be returned. Which of the following queries will satisfy this requirement and produce the requested data?
select u.FIRSTNAME + ’ ’ + u.SURNAME as [Full Name], year(u.DATEOFBIRTH) as [Year of Birth], l.NAME as [Place of Birth] from Users as u left outer join
Locations l on u.BIRTHLOCATIONID = l.ID
select u.FIRSTNAME + ’ ’ + u.SURNAME as [Full Name], year(u.DATEOFBIRTH) as [Year of Birth], l.NAME as [Place of Birth]
from Users as u right outer join Locations l on u.BIRTHLOCATIONID = l.ID
select FullName(u.FIRSTNAME, u.SURNAME), YearOfBirth(u.DATEOFBIRTH), PlaceName(l.NAME) from Users as u left outer
join Locations l on u.BIRTHLOCATIONID = l.ID
select FIRSTNAME + ’ ’ + SURNAME as [Full Name], year(DATEOFBIRTH) as [Year of Birth], NAME as [Place of Birth] from
Users left outer join Locations on BIRTHLOCATIONID = ID
Selected by 0 candidates
3/3 answered correctly 00:00:54 (-12s) SELECTED: CORRECT
Selected by 0 others
Selected by 0 others
Selected by 0 others
Selected by 0 candidates
TSql - Intermediate - 8
Some mes you need to present data differently to how it’s stored in the database table, to do this you can actually makedecisions based on the data you have and show the output as something different, this can be achieved using a casestatement or a simple if/then statement. Taking the ‘sex’ column in our users table below, you’ve been asked to display thefull sex rather than just ‘M’ or ‘F’. This is to be displayed along with the full name in the order; surname first separated by acomma, and using only 2 columns; one for the name and one for the sex.
ID FIRSTNAME SURNAME DATEOFBIRTH SEX BIRTHLOCATIONID MIGRATED CURRENTLOCATIONID
1 Alan Person 02-01-1970 M 1 False 1
2 Jane Doe 10-05-1980 F 1 True 6
3 Fred Bloggs 12-11-2005 M 2 False 4
4 Terri Trouble 07-20-1999 F 2 True 7
5 Bobby Tables 06-30-2009 M 5 False 2
6 Thomas Peabody 08-21-2011 M Null True 1
7 Angie Agenew 05-16-2007 F 7 Null Null
Which of the following queries will produce the required output:
I don't know
select surname + ‘, ’ + firstname as [Full Name],case sex when ‘M’ then ‘Male’ when ‘F’ then ‘Female’ end as sex from users
select surname + ‘, ’ + firstname as [Full Name],if sex = ‘M’ then ‘Male’ else if sex = ‘F’ then ‘Female’ as sex from users
select surname + comma + firstname , if case is sex = ‘M’ then return ‘Male’ if case is sex = ‘F’ then return ‘Female’ end as sex
from users
select fullname(surname, firstname) as [Full Name],case when sex in ‘M’ then sex = ‘Male’ when sex in ‘F’ then sex = ‘Female’
return sex from users
I don't know
2/3 answered correctly Av 00:04:49 CORRECT
Selected by 0 others 00:05:01 SELECTED: INCORRECT
Selected by 0 others
Selected by 0 others
Selected by 0 candidates
TSql - Intermediate - 5
Stringing together chains of functions in TSql is one way to perform multiple transformations on your data output. In somecases you might need TSql to produce your final output text, when you have a requirement like this, you need to know whichfunction calls you need to produce, transform and convert the data types you need to produce your output. Consider the“users” table below:
ID FIRSTNAME SURNAME DATEOFBIRTH SEX BIRTHLOCATIONID MIGRATED CURRENTLOCATIONID
1 Alan Person 02-01-1970 M 1 False 1
2 Jane Doe 10-05-1980 F 1 True 6
3 Fred Bloggs 12-11-2005 M 2 False 4
4 Terri Trouble 07-20-1999 F 2 True 7
5 Bobby Tables 06-30-2009 M 5 False 2
6 Thomas Peabody 08-21-2011 M Null True 1
7 Angie Agenew 05-16-2007 F 7 Null Null
Given the following specification:Create a query that will create one column of data called ‘Description’ for each row in the Users table, the format of each rowshould be the users full name in all capitals, followed by ‘Has been alive for X days since Day of month name Year’ whereday and year are the numerical equivalent of those date parts and month name is the full textual month name. Which of the following statements will produce this output:
SELECT upper(FIRSTNAME + ’ ’ + SURNAME) + ’ Has been alive for ’ + CAST(DATEDIFF(day, DATEOFBIRTH, CURRENT_TIMESTAMP) as varchar(10))
+ ’ days, since ’ + CAST(DATENAME(day, DATEOFBIRTH) as varchar) + ’ of ’ + CAST(DATENAME(month, DATEOFBIRTH) as varchar) + ’
’ + CAST(year(DATEOFBIRTH) as varchar) as [Description] FROM Users
SELECT upper(FIRSTNAME + ’ ’ + SURNAME) + ’ Has been alive for ’ + CAST(DATEDIFF(day, DATEOFBIRTH,
CURRENT_TIMESTAMP) as varchar(10)) + ’ days, since ’ + CAST(DATENAME(day, DATEOFBIRTH) as varchar)
+ ’ of ’ + CAST(DATENAME(month, DATEOFBIRTH) as varchar) + ’ ’ + CAST(year(DATEOFBIRTH) as varchar)
as [Description] FROM Users
SELECT FIRSTNAME.ToUpper() + ’ ’ + SURNAME.ToUpper() + ’ Has been alive for ’ + CONVERTTO(DATEDIFF(day,
DATEOFBIRTH, CURRENT_TIMESTAMP) as varchar) + ’ days, since ’ + CONVERTTO(DATENAME(day, DATEOFBIRTH) as
varchar) + ’ of ’ + CONVERTTO(DATENAME(month, DATEOFBIRTH) as varchar) + ’ ’ + CONVERTTO(year(DATEOFBIRTH)
as varchar) as [Description] FROM Users
SELECT UPPERCASE((FIRSTNAME + ’ ’ + SURNAME) + ’ Has been alive for ’ + CAST(DATEDIFF(day, DATEOFBIRTH,
CURRENT_TIMESTAMP) as varchar(10)) + ’ days, since ’ + CAST(DATENAME(day, DATEOFBIRTH) as varchar)
+ ’ of ’ + CAST(DATENAME(month, DATEOFBIRTH) as varchar) + ’ ’ + CAST(year(DATEOFBIRTH) as varchar))
as [Description] FROM Users
I don't know
CODE SCORE
100%
UNIT TESTS PASSED
5/5
QUESTION TIMING
00:08:47
Reverse Words - C# - Basic
Write a method to return the reverse order for a list of space separated words.Example: “A sample sentence is required” would return “required is sentence sample A”
using System;using System.Collections.Generic;using System.IO;using System.Text;
public class Solution{ public string ReverseWords(string input) { string[] words = input.Split(' '); StringBuilder result = new StringBuilder(); for (int i = words.Length -1 ; i > -1; i--) { result.Append(words[i]); if(i > 0) { result.Append(" "); } } return result.ToString(); }}
Unit Test Status:
Status Type Unit Test Summary
Private
Private
Private
Private
Public
Passed Check that an empty input results in an empty output.
Passed Check that a single character input string is returned verbatim.
Passed Check that two single character words are successfully reversed.
Passed Check that three single character words are successfully reversed.
Passed Check that a multiple word sentence is successfully reversed.