1. What arguments do you frequently use for the Perl interpreter and what do they mean?
2. What does the command ‘use strict’ do and why should you use it?
3. What do the symbols $ @ and % mean when prefixing a variable?
4. What elements of the Perl language could you use to structure your code to allow for maximum re-use and maximum readability?
5. What are the characteristics of a project that is well suited to Perl?
6. Why do you program in Perl?
7. Explain the difference between my and local.
8. Explain the difference between use and require.
9. What’s your favorite module and why?
10. What is a hash?
11. Write a simple (common) regular expression to match an IP address, e-mail address, city-state-zipcode combination.
12. What purpose does each of the following serve: -w, strict, -T ?
13. What is the difference between for & foreach, exec & system?
14. Where do you go for Perl help?
15. Name an instance where you used a CPAN module.
16. How do you open a file for writing?
17. How would you replace a char in string and how do you store the number of replacements?
18. When would you not use Perl for a project?
Showing posts with label Interview Questions. Show all posts
Showing posts with label Interview Questions. Show all posts
C# interview questions
5:10 AM, Posted by कैलास बधान, No Comment
# What’s the advantage of using System.Text.StringBuilder over System.String?
StringBuilder is more efficient in the cases, where a lot of manipulation is done to the text. Strings are immutable, so each time it’s being operated on, a new instance is created.
# Can you store multiple data types in System.Array?
No.
# What’s the difference between the System.Array.CopyTo() and System.Array.Clone()?
The first one performs a deep copy of the array, the second one is shallow.
# How can you sort the elements of the array in descending order?
By calling Sort() and then Reverse() methods.
# What’s the .NET datatype that allows the retrieval of data by a unique key?
HashTable.
# What’s class SortedList underneath?
A sorted HashTable.
# Will finally block get executed if the exception had not occurred?
Yes.
# What’s the C# equivalent of C++ catch (…), which was a catch-all statement for any possible exception?
A catch block that catches the exception of type System.Exception. You can also omit the parameter data type in this case and just write catch {}.
# Can multiple catch blocks be executed?
No, once the proper catch code fires off, the control is transferred to the finally block (if there are any), and then whatever follows the finally block.
# Why is it a bad idea to throw your own exceptions?
Well, if at that point you know that an error has occurred, then why not write the proper code to handle that error instead of passing a new Exception object to the catch block? Throwing your own exceptions signifies some design flaws in the project.
# What’s a delegate?
A delegate object encapsulates a reference to a method. In C++ they were referred to as function pointers.
# What’s a multicast delegate?
It’s a delegate that points to and eventually fires off several methods.
# How’s the DLL Hell problem solved in .NET?
Assembly versioning allows the application to specify not only the library it needs to run (which was available under Win32), but also the version of the assembly.
# What are the ways to deploy an assembly?
An MSI installer, a CAB archive, and XCOPY command.
# What’s a satellite assembly?
When you write a multilingual or multi-cultural application in .NET, and want to distribute the core application separately from the localized modules, the localized assemblies that modify the core application are called satellite assemblies.
# What namespaces are necessary to create a localized application?
System.Globalization, System.Resources.
# What’s the difference between // comments, /* */ comments and /// comments?
Single-line, multi-line and XML documentation comments.
# How do you generate documentation from the C# file commented properly with a command-line compiler?
Compile it with a /doc switch.
# What’s the difference between and
Single line code example and multiple-line code example.
# Is XML case-sensitive?
Yes, so and are different elements.
# What debugging tools come with the .NET SDK?
CorDBG – command-line debugger, and DbgCLR – graphic debugger. Visual Studio .NET uses the DbgCLR. To use CorDbg, you must compile the original C# file using the /debug switch.
# What does the This window show in the debugger?
It points to the object that’s pointed to by this reference. Object’s instance data is shown.
# What does assert() do?
In debug compilation, assert takes in a Boolean condition as a parameter, and shows the error dialog if the condition is false. The program proceeds without any interruption if the condition is true.
# What’s the difference between the Debug class and Trace class?
Documentation looks the same. Use Debug class for debug builds, use Trace class for both debug and release builds.
# Why are there five tracing levels in System.Diagnostics.TraceSwitcher?
The tracing dumps can be quite verbose and for some applications that are constantly running you run the risk of overloading the machine and the hard drive there. Five levels range from None to Verbose, allowing to fine-tune the tracing activities.
# Where is the output of TextWriterTraceListener redirected?
To the Console or a text file depending on the parameter passed to the constructor.
# How do you debug an ASP.NET Web application?
Attach the aspnet_wp.exe process to the DbgClr debugger.
# What are three test cases you should go through in unit testing?
Positive test cases (correct data, correct output), negative test cases (broken or missing data, proper handling), exception test cases (exceptions are thrown and caught properly).
# Can you change the value of a variable while debugging a C# application?
Yes, if you are debugging via Visual Studio.NET, just go to Immediate window.
# What are advantages and disadvantages of Microsoft-provided data provider classes in ADO.NET?
SQLServer.NET data provider is high-speed and robust, but requires SQL Server license purchased from Microsoft. OLE-DB.NET is universal for accessing other sources, like Oracle, DB2, Microsoft Access and Informix, but it’s a .NET layer on top of OLE layer, so not the fastest thing in the world. ODBC.NET is a deprecated layer provided for backward compatibility to ODBC engines.
# What’s the role of the DataReader class in ADO.NET connections?
It returns a read-only dataset from the data source when the command is executed.
# What is the wildcard character in SQL?
Let’s say you want to query database with LIKE for all employees whose name starts with La. The wildcard character is %, the proper query with LIKE would involve ‘La%’.
# What connections does Microsoft SQL Server support?
Windows Authentication (via Active Directory) and SQL Server authentication (via Microsoft SQL Server username and passwords).
# Which one is trusted and which one is untrusted?
Windows Authentication is trusted because the username and password are checked with the Active Directory, the SQL Server authentication is untrusted, since SQL Server is the only verifier participating in the transaction.
# Why would you use untrusted verificaion?
Web Services might use it, as well as non-Windows applications.
# What does the parameter Initial Catalog define inside Connection String?
The database name to connect to.
# What’s the data provider name to connect to Access database?
Microsoft.Access.
# What does Dispose method do with the connection object?
Deletes it from the memory.
# What is a pre-requisite for connection pooling?
Multiple processes must agree that they will share the same connection, where every parameter is the same, including the security settings.
StringBuilder is more efficient in the cases, where a lot of manipulation is done to the text. Strings are immutable, so each time it’s being operated on, a new instance is created.
# Can you store multiple data types in System.Array?
No.
# What’s the difference between the System.Array.CopyTo() and System.Array.Clone()?
The first one performs a deep copy of the array, the second one is shallow.
# How can you sort the elements of the array in descending order?
By calling Sort() and then Reverse() methods.
# What’s the .NET datatype that allows the retrieval of data by a unique key?
HashTable.
# What’s class SortedList underneath?
A sorted HashTable.
# Will finally block get executed if the exception had not occurred?
Yes.
# What’s the C# equivalent of C++ catch (…), which was a catch-all statement for any possible exception?
A catch block that catches the exception of type System.Exception. You can also omit the parameter data type in this case and just write catch {}.
# Can multiple catch blocks be executed?
No, once the proper catch code fires off, the control is transferred to the finally block (if there are any), and then whatever follows the finally block.
# Why is it a bad idea to throw your own exceptions?
Well, if at that point you know that an error has occurred, then why not write the proper code to handle that error instead of passing a new Exception object to the catch block? Throwing your own exceptions signifies some design flaws in the project.
# What’s a delegate?
A delegate object encapsulates a reference to a method. In C++ they were referred to as function pointers.
# What’s a multicast delegate?
It’s a delegate that points to and eventually fires off several methods.
# How’s the DLL Hell problem solved in .NET?
Assembly versioning allows the application to specify not only the library it needs to run (which was available under Win32), but also the version of the assembly.
# What are the ways to deploy an assembly?
An MSI installer, a CAB archive, and XCOPY command.
# What’s a satellite assembly?
When you write a multilingual or multi-cultural application in .NET, and want to distribute the core application separately from the localized modules, the localized assemblies that modify the core application are called satellite assemblies.
# What namespaces are necessary to create a localized application?
System.Globalization, System.Resources.
# What’s the difference between // comments, /* */ comments and /// comments?
Single-line, multi-line and XML documentation comments.
# How do you generate documentation from the C# file commented properly with a command-line compiler?
Compile it with a /doc switch.
# What’s the difference between
XML documentation tag?
Single line code example and multiple-line code example.
# Is XML case-sensitive?
Yes, so
# What debugging tools come with the .NET SDK?
CorDBG – command-line debugger, and DbgCLR – graphic debugger. Visual Studio .NET uses the DbgCLR. To use CorDbg, you must compile the original C# file using the /debug switch.
# What does the This window show in the debugger?
It points to the object that’s pointed to by this reference. Object’s instance data is shown.
# What does assert() do?
In debug compilation, assert takes in a Boolean condition as a parameter, and shows the error dialog if the condition is false. The program proceeds without any interruption if the condition is true.
# What’s the difference between the Debug class and Trace class?
Documentation looks the same. Use Debug class for debug builds, use Trace class for both debug and release builds.
# Why are there five tracing levels in System.Diagnostics.TraceSwitcher?
The tracing dumps can be quite verbose and for some applications that are constantly running you run the risk of overloading the machine and the hard drive there. Five levels range from None to Verbose, allowing to fine-tune the tracing activities.
# Where is the output of TextWriterTraceListener redirected?
To the Console or a text file depending on the parameter passed to the constructor.
# How do you debug an ASP.NET Web application?
Attach the aspnet_wp.exe process to the DbgClr debugger.
# What are three test cases you should go through in unit testing?
Positive test cases (correct data, correct output), negative test cases (broken or missing data, proper handling), exception test cases (exceptions are thrown and caught properly).
# Can you change the value of a variable while debugging a C# application?
Yes, if you are debugging via Visual Studio.NET, just go to Immediate window.
# What are advantages and disadvantages of Microsoft-provided data provider classes in ADO.NET?
SQLServer.NET data provider is high-speed and robust, but requires SQL Server license purchased from Microsoft. OLE-DB.NET is universal for accessing other sources, like Oracle, DB2, Microsoft Access and Informix, but it’s a .NET layer on top of OLE layer, so not the fastest thing in the world. ODBC.NET is a deprecated layer provided for backward compatibility to ODBC engines.
# What’s the role of the DataReader class in ADO.NET connections?
It returns a read-only dataset from the data source when the command is executed.
# What is the wildcard character in SQL?
Let’s say you want to query database with LIKE for all employees whose name starts with La. The wildcard character is %, the proper query with LIKE would involve ‘La%’.
# What connections does Microsoft SQL Server support?
Windows Authentication (via Active Directory) and SQL Server authentication (via Microsoft SQL Server username and passwords).
# Which one is trusted and which one is untrusted?
Windows Authentication is trusted because the username and password are checked with the Active Directory, the SQL Server authentication is untrusted, since SQL Server is the only verifier participating in the transaction.
# Why would you use untrusted verificaion?
Web Services might use it, as well as non-Windows applications.
# What does the parameter Initial Catalog define inside Connection String?
The database name to connect to.
# What’s the data provider name to connect to Access database?
Microsoft.Access.
# What does Dispose method do with the connection object?
Deletes it from the memory.
# What is a pre-requisite for connection pooling?
Multiple processes must agree that they will share the same connection, where every parameter is the same, including the security settings.
Linux admin interview questions
4:57 AM, Posted by कैलास बधान, No Comment
1. How do you take a single line of input from the user in a shell script?
2. Write a script to convert all DOS style backslashes to UNIX style slashes in a list of files.
3. Write a regular expression (or sed script) to replace all occurrences of the letter ‘f’, followed by any number of characters, followed by the letter ‘a’, followed by one or more numeric characters, followed by the letter ‘n’, and replace what’s found with the string “UNIX”.
4. Write a script to list all the differences between two directories.
5. Write a program in any language you choose, to reverse a file.
6. What are the fields of the password file?
7. What does a plus at the beginning of a line in the password file signify?
8. Using the man pages, find the correct ioctl to send console output to an arbitrary pty.
9. What is an MX record?
10. What is the prom command on a Sun that shows the SCSI devices?
11. What is the factory default SCSI target for /dev/sd0?
12. Where is that value controlled?
13. What happens to a child process that dies and has no parent process to wait for it and what’s bad about this?
14. What’s wrong with sendmail? What would you fix?
15. What command do you run to check file system consistency?
16. What’s wrong with running shutdown on a network?
17. What can be wrong with setuid scripts?
18. What value does spawn return?
19. Write a script to send mail from three other machines on the network to root at the machine you’re on. Use a ‘here doc’, but include in the mail message the name of the machine the mail is sent from and the disk utilization statistics on each machine?
20. Why can’t root just cd to someone’s home directory and run a program called a.out sitting there by typing “a.out”, and why is this good?
21. What is the difference between UDP and TCP?
22. What is DNS?
23. What does nslookup do?
24. How do you create a swapfile?
25. How would you check the route table on a workstation/server?
26. How do you find which ypmaster you are bound to?
27. How do you fix a problem where a printer will cutoff anything over 1MB?
28. What is the largest file system size in solaris? SunOS?
29. What are the different RAID levels?
30. Advantages/disadvantages of script vs compiled program.
31. Name a replacement for PHP/Perl/MySQL/Linux/Apache and show main differences.
32. Why have you choosen such a combination of products?
33. Differences between two last MySQL versions. Which one would you choose and when/why?
34. Main differences between Apache 1.x and 2.x. Why is 2.x not so popular? Which one would you choose and when/why?
35. Which Linux distros do you have experience with?
36. Which distro you prefer? Why?
37. Which tool would you use to update Debian / Slackware / RedHat / Mandrake / SuSE ?
38. You’re asked to write an Apache module. What would you do?
39. Which tool do you prefer for Apache log reports?
40. Your portfolio. (even a PHP guest book may work well)
41. What does ‘route’ command do?
42. Differences between ipchains and iptables.
43. What’s eth0, ppp0, wlan0, ttyS0, etc.
44. What are different directories in / for?
45. Partitioning scheme for new webserver. Why ?
2. Write a script to convert all DOS style backslashes to UNIX style slashes in a list of files.
3. Write a regular expression (or sed script) to replace all occurrences of the letter ‘f’, followed by any number of characters, followed by the letter ‘a’, followed by one or more numeric characters, followed by the letter ‘n’, and replace what’s found with the string “UNIX”.
4. Write a script to list all the differences between two directories.
5. Write a program in any language you choose, to reverse a file.
6. What are the fields of the password file?
7. What does a plus at the beginning of a line in the password file signify?
8. Using the man pages, find the correct ioctl to send console output to an arbitrary pty.
9. What is an MX record?
10. What is the prom command on a Sun that shows the SCSI devices?
11. What is the factory default SCSI target for /dev/sd0?
12. Where is that value controlled?
13. What happens to a child process that dies and has no parent process to wait for it and what’s bad about this?
14. What’s wrong with sendmail? What would you fix?
15. What command do you run to check file system consistency?
16. What’s wrong with running shutdown on a network?
17. What can be wrong with setuid scripts?
18. What value does spawn return?
19. Write a script to send mail from three other machines on the network to root at the machine you’re on. Use a ‘here doc’, but include in the mail message the name of the machine the mail is sent from and the disk utilization statistics on each machine?
20. Why can’t root just cd to someone’s home directory and run a program called a.out sitting there by typing “a.out”, and why is this good?
21. What is the difference between UDP and TCP?
22. What is DNS?
23. What does nslookup do?
24. How do you create a swapfile?
25. How would you check the route table on a workstation/server?
26. How do you find which ypmaster you are bound to?
27. How do you fix a problem where a printer will cutoff anything over 1MB?
28. What is the largest file system size in solaris? SunOS?
29. What are the different RAID levels?
30. Advantages/disadvantages of script vs compiled program.
31. Name a replacement for PHP/Perl/MySQL/Linux/Apache and show main differences.
32. Why have you choosen such a combination of products?
33. Differences between two last MySQL versions. Which one would you choose and when/why?
34. Main differences between Apache 1.x and 2.x. Why is 2.x not so popular? Which one would you choose and when/why?
35. Which Linux distros do you have experience with?
36. Which distro you prefer? Why?
37. Which tool would you use to update Debian / Slackware / RedHat / Mandrake / SuSE ?
38. You’re asked to write an Apache module. What would you do?
39. Which tool do you prefer for Apache log reports?
40. Your portfolio. (even a PHP guest book may work well)
41. What does ‘route’ command do?
42. Differences between ipchains and iptables.
43. What’s eth0, ppp0, wlan0, ttyS0, etc.
44. What are different directories in / for?
45. Partitioning scheme for new webserver. Why ?
Webhosting Interview Questions
4:47 AM, Posted by कैलास बधान, No Comment
1. What is Web Hosting? | ||
Web hosting is the act of renting space and bandwidth through a company so that you may publish your web site online. | ||
2. What is Virtual Hosting? | ||
Also known as shared hosting, this form of web hosting should suffice for most everyone. Virtual hosting simple refers to the fact that your site is on one server, and that this server hosts mulitple sites. You are virtually shared - your site will not be the only one on this specific server. Very few sites would actually need the power of a dedicated server, so this option provides to be a reliable and cheap solution. | ||
3. What is a Domain Name? | ||
A domain name is a word along with a TLD that uniquely identifies your website. | ||
4. What is uptime? | ||
Uptime is the percentage of time that a web site is working. For example, if some host has an uptime average of 99.86%, this means that your site will be down for a total about 1 hour each month. We monitor uptime of customer websites of many web hosts and we display this data on the host's details page. Some hosts also offer "uptime guarantees" but this is not as valuable as it might appear | ||
5. How do I upload my site? | ||
he main method of uploading files to your site's account is by using FTP. When you sign up with a host, you will probably get an FTP account that lets you access files in your account (usually ftp.yoursitename.com, your main account name and password). Then you can use a built-in Windows or Internet Explorer FTP client, or some other software that supports FTP such as CuteFTP, WS_FTP, or Total Commander, to transfer files from your hard drive to your account. If you don't get an FTP account or if you prefer a Web interface, you can use your account control panel's File Manager instead. | ||
6. What is full-service web hosting? | ||
"Full-service" can refer to a variety of services offered in addition to providing web space, transfer, and emails for a web site. For example, it could be 24/7 toll free phone support, web design services, or web site content maintenance services. | ||
7. What is domain parking? | ||
Domain parking lets you cheaply reserve a domain name for future use and display an "under construction" default page on it. You can register a domain and not park it anywhere but then your site will simply be inaccessible until you get a web host. Some registrar let you park your domain for free. | ||
8. Can I run my own software on my site? | ||
This depends on a web host and a plan. Most plans will allow running scripts in languages such as Perl or PHP. Some plans will also allow you to compile program in C/C++ and run them. Some Unix plans will also allow you to run "cron" which enables you to automatically execute programs or scripts at a specific time and date. However to get a full control over all aspects of your server, you will need a dedicated or co-located server instead of a shared plan. | ||
9. What is the difference between UNIX hosting and Windows hosting? | ||
If you need to support Microsoft products such as ASP, MS Access, or VBScript, then Windows hosting would be better. Furthermore, if you are comfortable with IIS and do not have the time to understand how UNIX works, Windows hosting would again be a better choice. | ||
10. How do I track how many hits my website gets? | ||
There are a few things that need to be cleared in terms of terminology: * Hits - this simply refers to the number of 'elements' loaded on your site. If one page has five images in it, viewing that page once adds 6 hits (one page + five images). * Impressions - the number of times all the pages on your site are seen (also simply called pageviews). Impressions are sometimes referred to as 'hits' which can cause confusion * Uniques - the number of people that visited your site |