Tuesday, 28 January 2020

Top 20 PowerShell Interview Questions


Ques: 1. What do you understand by PowerShell?

Ans: With PowerShell, you can control your system operations such as accessing data storage, registry, and file system. PowerShell is a command-line tool built upon the .NET framework to help the windows system administrator. The operations in the command line are executed by cmdlets. Cmdlets are .NET classes to implement operations in the PowerShell.

It also has a good expression parser and a scripting language to control and automate the administration of the windows system. This open-sourced tool was developed by Microsoft and released in 2006.

 
Ques: 2. What is $null in PowerShell?

Ans: The $null is a variable in the PowerShell that is used to represent NULL as the name suggests. It can be assigned to a variable, use it for comparisons, etc. In PowerShell, $null is an object that holds the value of NULL. To assign $null, use the following command

PS> $null –eq $variable
Here, the $variable holds the value of $null.


Ques: 3. Can you explain String Interpolation in PowerShell?

Ans: The String Interpolation is the way of displaying the value of the variable by surrounding the variable in the double-quotes.
//example

$var = “Nature”
Echo “the value is $var”

The above statement produces the ‘value is Nature’. Here the $var is surrounded by double quotes when used in the echo statement. So, it prints the value of the variable instead of the variable name itself. It is called string interpolation.


Ques: 4. What are cmdlet's in PowerShell?

Ans: The PowerShell cmdlet (Command let) is just a group of commands that are used in the PowerShell to perform a function. It is a lightweight .NET framework class object that is invoked by the PowerShell runtime. Programmers can create and invoke it manually too. You can construct your cmdlet by grouping a few lines of PowerShell code. The cmdlet has a .ps1 extension.


Ques: 5. How to call a function in powershell?

Ans: To call a function in PowerShell, first, you have to declare the function using the function keyword. Then to call the function, just type and enter the function name.
//example

function functionName {
$args[0] - $args[1]
}
PSC:\>functionName 10 5 5
You can also pass arguments to the called function as you see in the example above.


Ques: 6. What are Filters in PowerShell?

Ans: A lot of commands in the PowerShell return values that are not always useful. To get useful return objects from the commands we can use filters. Filters can be created using the Filter parameter or even using the Where-Object. We can use the Filter parameter with the Get-ChildItem to get the items that we specified in the filter.

//example
PS> Get-ChildItem -Path C:\folder\ -Filter '*1*.txt'

The above command filters and returns the files with a prefix as ‘1’. The same result can be achieved using the Where-Object, but generally, the filter is much faster than the Where-Object.


Ques: 7. What are $Home and $PID in PowerShell?

Ans: The $HOME is an automatic variable in the PowerShell. It contains the path of the user’s home directory. It is equivalent to C:\Users\. The $PID is also an automatic variable that contains the process identifier of the process which is hosting the PowerShell’s current session.


Ques: 8. Is PowerShell’s Execution Policy a security layer?

Ans: No. The execution policy in PowerShell is part of the security strategy but merely prevents potentially malicious scripts being executed by accident and, with the ‘ allsigned ‘ policy ensures that scripts cannot be altered without your knowledge. By default, this setting is set to ‘ Restricted ‘, meaning that no PowerShell script file can be run but it will execute PowerShell code within the PowerShell console.


Ques: 9. What is $Error and $ForEach variable?

Ans:

$Error – This variable contains an array of error objects which represents the most recent errors. The most recent error is the first error in the array.

$ForEach – This variable contains the enumerator (should not be confused with the resulting values) of a for each loop. Properties and methods of enumerators can be used on the value of the $ForEach variable. This kind of variable exists only while the for each loop is in running state, and it is deleted once the loop is completed.


Ques: 10. Explain Execution Policies and types of Execution Policy?

Ans: This is the common PowerShell Interview Questions asked in an interview. There are 6 types of execution policies in PowerShell. These are:-
  • Restricted: This is the default type. Under this, PowerShell will not run any script including PowerShell profiles too.
  • RemoteSigned: PowerShell will only run any script that is created locally. Any script that has been coming from the Internet should be digitally signed with a signing certificate code and is trusted by the computer.
  • AllSigned: PowerShell will only run any script that has been digitally signed using a trusted code signing certificate.
  • Unrestricted: PowerShell will run any script. If the script comes from an untrusted source, users are prompted once to execute it.
  • Bypass: This policy will run any script without any question or prompt.
  • Undefined: There is no execution policy set for this in the current scope.

Ques: 11. What is the PowerShell order in which execution policy is evaluated?

Ans: Windows PowerShell has execution policies in the following order of precedence: 
  • Group Policy: Example is Computer Configuration.
  • Group Policy: Example is User Configuration.
  • Execution Policy: Such as Process (or PowerShell.exe -Execution Policy) – which is the CURRENT SCOPE.
  • Execution Policy: Such as Current User – Which is SAVED in the HKCU registry.
  • Execution Policy: Such as Local Machine – which is SAVED in the HKLM registry.

Ques: 12. Can you explain the differences between the concept of WMI between old and new?

Ans:
Old WMI
  • Uses old-style native code providers and a repository for itself.
  • Available only on Windows as mentioned.
  • It has been more or less deprecated which means it’s is not focused on further improvement or development.
New WMI
  • Supports old-style native code providers and a repository, as well as new-style MI providers as discussed.
  • Available only on Windows as mentioned.
  • This is the way forward. It has an essentially stateless relationship with the remote machine.

Ques: 13. What are the various Differences between OMI and CIM.?

Ans:
OMI
  • It uses WS-MAN where OMI code includes the protocol stack od WS-MAN. It supports only new-style MI providers.
  • It is available on any implementing platform. If something can talk to OMI, it will be able to talk to NEW WMI as well.
CIM
  • It defines the standard. It is created by DMTF.
  • In this case, early versions were implemented as OLD WMI actually by Microsoft, but the newest version implemented both in NEW WMI and OMI by Microsoft as well as others.

Ques: 14. What are the differences among WinRM and WSMan and DCOM?

Ans:
 
WSMan: 
  • WS-Management abbreviated as WSMAN or Web Services-Management is basically a Distributed Management task force.
  • It is an open standard which defines a SOAP-based (full form Simple Object Access Protocol) protocol for the management of its servers, devices, applications and also various Web services.
WinRM:
  • WinRM is a feature which came from Windows Vista and it allows administrators to remotely run management scripts.
  • It can handle remote connections using the WS-Management Protocol.
DCOM:
  • DCOM means Distributed COM.
  • It is used to connect LIVE objects which are on the remote machine.
  • The RPC protocol that it uses was designed for continuous back-and-forth messaging.
  • It is network and memory inefficient.

Ques: 15. What are Scriptblocks?

Ans: Scriptblocks are one of most Powerful concept of PowerShell. By definition, is a collection of statements or expressions between “{” and “}” that can be used as a single unit. It can be stored in a variable, can be passed to function and can be executed remotely by the operator “&”

Syntax :
{<statement list>}
Like functions, a scriptblock can include parameters :
              {
            param ([type]$parameter1 [,[type]$parameter2])
           

And script blocks can include the DynamicParam, Begin, Process, and End keywords.

 
Ques: 16. What is Variable Interpolation?

Ans: When you add a variable to a double-quoted string, PowerShell replaces the variable name by its value. This feature is called variable interpolation.
              $HighOne = "Love"
"The most powerful Emotion is $HighOne" 

Output:

PS C:\Users\Administrator>
$HighOne = "Love"
"The most powerful Emotion is $HighOne"
"The most powerful Emotion is Love
PS C:\Users\Administrator>


Ques: 17. What is the {0} -f that I saw in some string codes?

Ans: This is string formatting using the PowerShell format operator. In PowerShell, you do not need to use “+” operator to concatenate strings. Actually is more in-tune with PowerShell syntax if you use interpolation or the -f (from format)

It is simple. You add the placeholder {N} and then type a command-separated list of values in order to be replaced. {0} represents the first value in the command-separated list, {1} the second and so on.


Ques: 18. What is a hash table in PowerShell?

Ans: Hash table is a data structure which used the mechanism of value/key pair. The professionals who create PowerShell scripts use variables to store data. For the storage of data in a highly secure environment hash table is used.


Ques: 19. How is Windows Powershell different from Stsadm ?
Ans: Unlike stsadm, which accept and return text, Windows PowerShell is built on the Microsoft .NET Framework and accepts and returns .NET Framework objects. In addition to that it also gives you access to the file system on the computer so that you can access registry,digital signature certificate etc.


Ques: 20. How Do You Comment Out Code In Powershell?
Ans: Like other languages powershell also supports single/Inline comments line and multi line comments.

Starting with PowerShell V1 there’s only # to make the text after it a comment.

In PowerShell V2 “<# #>” can be used for block comments (multi-line) and more specifically for SYNOPSIS, DESCRIPTION, NOTES, LINK help comments.

Example: Sinlgle/Inline comments
 # This is a single or inline comment starts with hash in Powershell

Example: Block comments (multi-line)
<# this is a first line of comment
 this is a second line of comment
this is a third line of comment
.
.
this is a last line of comment
#>


Top 20 Internet of Things (IOT) Interview Questions


Ques: 1. Why does the need of Internet of Things (IoT) arises?

Ans: The real value of the IoT is not about making the lights turn on or off when the vehicle reaches its parking bay, rather the data that the connected devices gather about its users. The data collected later can allow the consumers, businesses, and connected cities to work in a more efficient manner. 

Internet of Things (IoT) is a network of interconnected objects that uses embedded technology to sense and communicate with their internal states or the external environments. IoT is all about connecting the objects (devices) over the Internet and enabling them to interact with us and other objects.


Ques: 2. What are the main components of the Internet of Things (IoT) system?

Ans: IoT has three main components are as follows:

  • Devices embedded with sensors. 
  • Network connectivity 
  • Data storage application/system


Ques: 3. How does IoT differ from the IIoT?

Ans: 
Internet of Things(IOT): In this system, the connection is between devices and gadgets that are used by average consumers in their day-to-day life. Examples could be washing machines, refrigerators, electrical bulbs, etc. These devices are connected to the Internet and work according to the way they are programmed to and prompted to.

Industrial Internet of Things (IIoT): With IIoT, massive industrial items and systems are connected via the Internet to carry out functions without human intervention. The alarm systems in hospitals or the automatic shutting off of switches in industrial plants are examples of IIoT.


Ques: 4. Do you have any relatable examples of the way in which IoT impacts our everyday lives?

Ans: Since IoT’s primary aim is to connect devices and make them function intuitively according to the needs of the situation; they are used in a variety of devices that we use in our daily lives, which help us coordinate functions better. We no longer have to spend extra time to manually handle these devices, which means a lot of time saved.

Since connectivity with other devices is at the heart of the concept of IoT. IoT - enabled devices not only carry out their function in isolation, but also coordinate with others in the network to make work a lot more efficient than earlier devices could. For instance, while a standalone alarm clock can only wake you up, in an IoT ecosystem, based on your early morning traits, IoT could also heat the coffee decoction for you or put the geyser on.


Ques: 15. What importance does cybersecurity have for IoT?

Ans: Cybersecurity is a matter of serious concern wherever the Net is involved. So, with its heavy reliance on the Internet, the IoT is sure to make cybersecurity a very crucial area of its work. 

Corporations and governments will have to be on their toes in anticipating and preventing cyber attacks on the IoT. This calls for a very strongly coordinated, robust response from all the players involved because a disruption in any link in the chain can throw the whole ecosystem out of gear.


Ques: 16. Assess the impact the IoT will have on the healthcare sector

Ans: The IoT is extremely well-suited for the healthcare sector. With its ability to coordinate large volumes of data seamlessly and across devices; the IoT can be a great facilitator for the healthcare industry. At a micro level, it will help to generate a lot of data from the health-conscious user, such as pulse, blood pressure, calorie count, etc. from individual users. At the macro level, it will make tele-medicine a lot more efficient by being able to coordinate data across devices in far-flung locations.


Ques: 17. What do you understand by the Internet of Everything and what are the elements that go into it?

Ans: The Internet of Everything (IoE) can be understood as an extension of the IoT. While the IoT connects devices with one another, IoE aims at connecting devices with people and help them take smart decisions by coordinating with them. These are some of the elements that go into IoE:

Human beings: The IoE facilitates higher and smoother coordination between humans and devices such as social networks, computers, healthcare gadgets, teaching aids, etc.

Procedure: This aspect of the IoE seeks to automate processes that go into most things managed by humans, ranging from handheld devices to large industrial manufacturing processes.

Things: This is the set of devices or things used by humans that connect to the Net and help share information. sensors, actuators, certain types of medical devices or meters can be examples of things in IoE.

Information: Obviously, this is at the center of the IoE, as much as it is in the IoT. Algorithms function smartly to help make sense of the huge loads of data that devices and other things generate.


Ques: 18. What influences will the internet of things (IoT) have on monetary growth?

Ans: Several monetary analyses have anticipated that the IoT will make contributions extensively to monetary growth over the following decade, however, the predictions range substantially in magnitude. The modern-day international iot market has been valued at approximately $2 trillion, with estimates of its predicted fee over the following five to ten years varying from $4 trillion to $11 trillion.


Ques: 19. What are the elements of the Internet of Everything?
Ans: 
Human beings: People will continue to attach through gadgets, like smartphones, computers, and drugs, in addition to social networks, which includes FaceBook and LinkedIn.

Procedure: This includes evolving era, business, organizational and different tactics in order to be wished in an effort to control and, to a massive extent, automate the explosive growth in connections and the resultant accumulation, analysis and conversation of information with a view to be inevitable inside the internet of the entirety.

Things: It consists of many physical objects like sensors, meters, actuators, and other styles of gadgets that can be connected to any item, that are or can be capable of connecting to the community and sharing statistics. These items will sense and supply more facts, respond to manipulate inputs, and provide more statistics to assist human beings and machines make choices.

Information: Today, devices commonly accumulate statistics and circulate it over the internet to a valuable source, in which it is analyzed and processed. Such statistics is predicted to surpass today’s biggest social media data set by means of every other order of importance.


Ques: 20. What is Bluetooth Low Energy (BLE) Protocol for an Internet of Things (IoT)?
Ans: Nokia originally introduced this protocol as wibree in 2006. Additionally known as Bluetooth smart this protocol presents the same range coverage with a good deal of decreased strength intake because of the unique Bluetooth. It has comparable bandwidth with narrow spacing as utilized by Zigbee. Low electricity latency and decrease complexity makeable greater appropriate to include into low-cost microcontrollers.


Top 20 Azure Interview Questions

Ques: 1. What are the sizes of the Azure VM?

Ans: It is another basic question that finds its place in the series of top Microsoft Azure interview questions. The Windows Azure is destined to balance a variety of sizes. Most of the VM sizes are:
  • The extra-large computer has 8*1.6 GHz of Instance size, with instance storage of 2040 GB, CPU memory of 14 GB. The I/O performance is high. 
  • The large computer has 4*1.6 GHz of Instance size, with instance storage of 1000 GB, CPU memory of 7 GB. The I/O performance is high. 
  • The medium computer has 2*1.6 GHz of Instance size, with instance storage of 490 GB, CPU memory of 3.5 GB. The I/O performance is high. 
  • Small computer has 1.6 GHz of Instance size, with instance storage of 225 GB, CPU memory of 1.75 GB. The I/O performance is moderate. 
  • The extra small computer has 1.0 GHz of Instance size of 20 GB, with instance storage of 20 GB, CPU memory of 768MB. The I/O performance is low.

Ques: 2. How is Azure Resource Manager beneficial over the classic services?

Ans: The benefits of the Azure Resource Manager that overshadows the benefit of the classic services are:
  • The resources need not be managed, deployed or monitored one at a time. They are chain deployment activities throughout the life cycle without the need for individual data handling. 
  • The data is also deployed at a consistent pace with the ARM service. It enables the user to use a declarative template that indicates the deployment. 
  • Since the role-based control is present in the management platform that provides you with the access to the resources that leads you to control. 
  • You can mark dependencies between the resources that enable you to get the correct order of deployment. 
  • The resources may be tagged and organized logically so that it is convenient to follow up the billing of your company.

Ques: 3. What do you mean by SAS?

Ans: This is one of the common SQL Azure interview questions that should be answered by stating that SAS is an abbreviation for Statistical analytical System which is a software suite performing analysis of multiple variables. It is in linked to the predictive analysis, data handling, advanced analytics or cooperative intelligence. It produces a smooth interface that offers graphical and clicks based solution. It is user-friendly for the technical or the non-technical with advanced features.


Ques: 4. Describe the log analytics?

Ans: This question can be asked among the SQL Azure interview questions. The operational management service of the Log Analytics provides the entire requirement that runs the particular service. It manifests automation, security, log analytics and availability at a particular dashboard. It generates Power data source that enables the user to get the visuals of the raw data. It is introduced in three different tiers of prices that include free, premium and standard. You enjoy the convenience of searching the data at a single dashboard and export the results.


Ques: 5. State what will you do in case of a drive failure?

Ans: This is one of another Microsoft Azure interview questions for experienced that should be answered in the following manner. When there is an instance that the drive has failed the following step should be performed:
  • The first is that the drive should be not mounted enabling the object storage to function without fail. 
  • The second scenario is replacing the drive in which the desired step will be remounting, formatting the drive.

Ques: 6. Give a clear overview of API in Azure?

Ans: The Test Analytics in API is a web service that is built with the Azure learning. It is an effective tool to analyze the unstructured data like the extraction of the key phrase. It runs with the binomial scoring unit that is either 0 or 1 where 1 corresponds to a positive and 0 corresponds to a negative viewpoint. The advantage is that it does not need any assistance with designing and training which imply that the data is in the hands of directly the user. Proceed to find more Microsoft Azure interview questions for experienced.


Ques: 7. Differentiate between the PROC SUMMARY and PROC MEANS?

Ans:

PROC MEANS refers to the subgroup statist created in the persistence of the BY statement that will be involved. The data here is sorted beforehand with the assistance of BY variables.

PROC SUMMARY is the aid of statistics giving all varieties of information running simultaneously and is produced for every subgroup automatically. The information in the outlet is not created.


Ques: 8. If the client gets disconnected from cache with the services state the probable cause?

Ans: If the client gets disconnected the causal factor can be distributed into two categories:

The cause on the operator side: 
  • There might be a failure in the transfer of the standard cache from one node to the other. 
  • While the service was processing and dispatching the cache got deployed. 
  • There was a server update or an automated VM maintenance.
The fault on the client side:
  • The application of the client accidentally got redeployed. 
  • The application on the client side got auto-scaling. 
  • The layer of the network on the client side altered. 
  • There was a transient error on the network node. 
  • The bound operation took more time. 
  • The upper limit of the bandwidth was reached.

Ques: 9. What is purpose of cloud service configuration file (.cscfg)?  

Ans: Every cloud service type of project contains .cscfg file and primarily is used for storing.

  • Number of role instances to deploy for each role in cloud service project. 
  • Thumbprint of certificates used if any. 
  • And most important, User defined configuration settings.
The primary aim or purpose of this file is to allow configuration changes in production environment without downtime of your application.


Ques: 10. What are different types of Azure blobs and difference between them?

Ans: Azure storage has two type of blob – Block and Page.

BLOCK BLOB:
1. Block blob is ideal for sequential read, write operations.
2. Block blobs should be natural choice for storing the various types of files such as office file, pdf, mp3, video, byte array and so on.
3. The data constitutes from various blocks and each block can have max size of 4MB.
4. Write made to block blob using PutBlock is uncommitted and maintained only for 7 days. User have to call PutBlockList to commit the data permanently.

PAGE BLOB:
1. Page blob is ideal for random read, write operations.
2. Page blob being “sparse” type of storage, is natural choice for storing .VHD files backing the Azure Virtual Machines
3. The data constitutes of various page ranges and each page should be in multiple of 512 bytes.
4. Write made to page blob using PutPage is a direct commit.


Ques: 11. What is the difference between Table Storage and SQL Azure Table?
Ans:

TABLE STORAGE: 
1. This is NoSQL store on Azure
2. As NoSQL, the data is stored in Key-Value pair combination and data is referred as an Entity.
3. Schema is not enforced while storing the data.
4. Combination of partition and row key is treated as unique for an entity.
5. Can’t have relationship between tables.
6. Being key-value store, we can’t define objects such as Stored procedures, Views, functions.
7. General usage is observed for storing diagnostics information, error log information.

SQL AZURE TABLE
1. This is relational store on Azure
2. The data is stored in Rows and Columns combination.
3. Schema is enforces while storing the data. If schema is violated, then error is thrown.  
4. User can define various constraints such primary key, unique key.
5. We can define relationships between tables such as foreign key.
6. We can created Stored procedures, views, functions.
7. Used widely in transaction based systems.


Ques: 12. What are the other VNET options for achieving connectivity with on premise and azure resources?

Ans: Site to Site and express route are other options for achieving cross premises connectivity. Site to site to specifically use when you have large number of resources to be connected. In some cases, Site to Site or Point to Site connectivity may introduce network latency as VPN created by these features work on public infrastructure (Internet) only. To overcome on this situation “Express Route” option can be taken which offers dedicated Leased Line based offering to overcome on latency issue.


Ques: 13. On premises application running few windows services, console applications to handle certain tasks. What should be the approach for migration of such applications to Azure?

Ans: There are 3 ways by which we can achieve background process migration to Azure:

1.Azure Virtual Machine  
2.Worker role 
3.Azure Web Jobs


Ques:14. What is HDInsight in Microsoft Azure?

Ans: HDInsight is a could service which that makes it easy. It is fast and cost-effective to process a massive amount of data using with the help of open-source frameworks like Spark, Hadoop, Hive, Storm and R. HDInsight offers various type of scenarios which includes ETL, data warehousing, and Machine Learning.


Ques: 15. What are the important drawbacks of using Microsoft Azure?
Ans: The below are the major drawbacks of using Azure:
  • Cloud computing is not possible if you are not able to connect to the Internet.
  • Azure is a web-based app which needs a lot of bandwidth to download, as do large documents. 
  • Web-based applications can sometimes be slower compared accessing similar software program on your desktop PC.

Ques: 16. What are the main benefits of Traffic Manager?
Ans: Traffic management offers many advantages for the user:
  • Increase the performance. 
  • No Downtime required for update or Maintenance. 
  • You can easily configure Azure Traffic manager on Windows Azure portal.

Ques: 17. State the difference pricing model of Microsoft Azure.

Ans: The different pricing model of Microsoft Azure are:

BYOL Model: It brings your license model. It is just right to access model. You can obtain it outside of the Azure Marketplace. This model is not charged any fees.

Free Software Trial: It is a full-featured version which is promotionally free for a limited period of time. However, for excessive use, you need to pay fees.

Usage-based: This is a widely used model of Microsoft Azure. Here, user are changed for only that service which is used by them.

Monthly fee: Here, you need to pay a fixed monthly payment for a subscription.


Ques: 18. How can you categorizes Azure services?

Ans: Azure services are classified into into 11 types:
  1. Compute 
  2. Web 
  3. Mobile 
  4. Data storage 
  5. Analytics Networking 
  6. Media 
  7. Content Delivery Network (CDN) 
  8. Hybrid integration 
  9. Identity and access management (IAM) 
  10. Internet of Things (IoT) 
  11. Development Management and security 

Ques:19. What is Azure Service Fabric?

Ans: Azure Service Fabric is a distributed platform for deploying and managing microservices and containers. It allows the developers to focus on implementation which is scalable, reliable, and manageable and not be concerned about the infrastructure. It uses the Azure Service Fabric Resource Provider.
It allows developers to build applications which are composed of micro services. These services run on pool of Virtual machines known as a cluster.
It allows the services to massively scale out. You can create clusters for Service Fabric in many environments such as Linux, on premise. The microservices you can build with Service Fabric can be stateful or stateless.


Ques: 20. What is Service Bus?
Ans: Service bus is a messaging service in Azure.You can use Service bus for sending messages between applications.It is used for decoupling applications and provides asynchronous communication using queues.