Monday, October 23, 2017

Python Interview Questions for freshers

In this post we will learn frequently asked Python Interview Questions and answers for freshers and also for experienced developers.In previous post we had discussed about why Python so powerful for Data Science, one of the frequently raised question that one so go through that post as well.

1) What is Python?

Ans: Python is a high level ,Object oriented,most successful interpreted language. It is a portable language,since it can run on different platforms such as Windows,Linux,Unix,Mac...It is a interpreted language that means when write a Python script it doesn't need to get compiled before execution.

2) What are the Benefits of Python?

Ans:

  1. Python is a Object Oriented Programming language as you can define classes along with the composition and Inheritance. It doesn't use any access specifier like Public or private
  2. It provides very high level dynamic data types and supports dynamic type checking
  3. It can be use as Scripting language or can be compiled to byte-code for building large applications.
  4. We can use Python for developing Web applications,automation,Scientific Modeling,Big Data applications etc..
  5. It can be easily integrated with C,C++,JAVA,COBRA,COM .
  6. It is extensible
3) What are the Data types in Python?

Ans: Python has 5 Standard Data types:

  1. Numbers
  2. String
  3. List
  4. Tuple
  5. Dictiornary
4) Is Multithreading supports in Python?

Ans: YES,Python has multi-threading package. It has a Construct called Global Interpreter Lock(GIL). This GIL makes you feeling only one thread is 'executing' at any one time.This happens very quickly so to the human eye it may seem like your threads are executing in parallel, but they are really just taking turns using the same CPU core.This means that if you want to make your code run faster then using the threading package often isn’t a good idea.

5)What is the output of print str if str = ‘Hello World!’?


Ans: Hello World!.

6) How to overload methods in Python?

Ans: Python's constructor: 
_init__ () is a first method of a class. Whenever we try to instantiate a object __init__() is automatically invoked by python to initialize members of an object.

7)How To Find Bugs Or Perform Static Analysis In A Python Application?

Ans: You can use PyChecker, which is a static analyzer. It identifies the bugs in Python project and also reveals the style and complexity related bugs.Another tool is Pylint, which checks whether the Python module satisfies the coding standard.

8) How to achieve Inheritance in Python?

Ans: Inheritance allows One class to gain all the members(say attributes and methods) of another class. Inheritance provides code re-usability, makes it easier to create and maintain an application. The class from which we are inheriting is called super-class and the class that is inherited is called a derived / child class.

9) What is the usage of help() and dir() function in Python?

Ans: Help() and dir() both functions are accessible from the Python interpreter and used for viewing a consolidated dump of built-in functions. 

Help() function: The help() function is used to display the documentation string and also facilitates you to see the help related to modules, keywords, attributes, etc.
Dir() function: The dir() function is used to display the defined symbols.

10)How is memory managed in Python?

Ans: Python memory is managed by Python private heap space. All Python objects and data structures are located in a private heap. The programmer does not have an access to this private heap and interpreter takes care of this Python private heap. 
The allocation of Python heap space for Python objects is done by Python memory manager. The core API gives access to some tools for the programmer to code.
Python also have an inbuilt garbage collector, which recycle all the unused memory and frees the memory and makes it available to the heap space.

11)What is dictionary in Python?

Ans: The built-in datatypes in Python is called dictionary. It defines one-to-one relationship between keys and values. Dictionaries contain pair of keys and their corresponding values. Dictionaries are indexed by keys.

Let’s take an example:

The following example contains some keys. Country, State & Captain. Their corresponding values are India, Andhra and Kohili respectively.


dict={'Country':'India','State':'Andhra','Captain':'kohli'}
print dict[Country]
India
print dict[State]
Andhra
print dict[Captian]
Kohli

12)What is pickling and unpickling in Python?

Ans: Pickling is a process in which a pickle module accepts any Python object, converts it into a string representation and dumps it into a file by using dump() function.
Unpickling is a process of retrieving original Python object from the stored string representation for use.

13) How Python does Compile-time and Run-time code checking?

Ans: In Python some amount of coding is done at compile time, but most of the checking such as type, name, etc. are postponed until code execution. Consequently, if the Python code references a user -defined function that does not exist, the code will compile successfully. The Python code will fail only with an exception when the code execution path does not exist.

14)Which command is used to exit help window or help command prompt?

Ans: "quit" command is used to exit help window or help command prompt.

15)What Is The Key Difference Between A List And The Tuple?
Ans: 
The major difference between a list and the tuple is that the list is mutable while tuple is not. A tuple is allowed to be hashed, for example, using it as a key for dictionaries.

16)Is There A Switch Or Case Statement In Python? If Not Then What Is The Reason For The Same?

Ans:
No, Python does not have a Switch statement, but you can write a Switch function and then use it.

 17)What Is A Built-In Function That Python Uses To Iterate Over A Number Sequence?

Ans: 
range() generates a list of numbers, which is used to iterate over for loops.
Example:
for i in range(5):
    print(i)

The range() function accompanies two sets of parameters.

range(stop)
stop: It is the no. of integers to generate and starts from zero. eg. range(4) == [0, 1, 2,3].
range([start], stop[, step])
start: It is the starting no. of the sequence.
stop: It specifies the upper limit of the sequence.
step: It is the incrementing factor for generating the sequence.

Points to note:
Only integer arguments are allowed.
Parameters can be positive or negative.
The <range()> function in Python starts from the zeroth index.





Sunday, March 12, 2017

TOP 30 Common Interview Questions

In this post i am sharing top common Interview Questions and answers.Review these typical interview questions and answers about how you would answers them. These questions for all IT fields or non-IT field and for students also.

1) Tell me about yourself?


Ans: This is the most often asked question in any interview. You need to prepare short answer in your mind. Be sure don't answer like rehearsed this before attend the interview. Be prepare for short answer like work-related items and talk about things you have done in the job.You can also provide some work experience,technologies you have worked upon and educational qualification. If you are a fresh graduate,you can tell some information about your family also.


2) Why did you leave your last job?


Ans: For this question,you should stay positive regardless of the circumstances. Never speak ill of supervisors,co-workers or the organization.If you do you will be the one looking bad. Keep smiling and say some positive reasons such as an opportunity,a chance to do something special or other forward looking reasons.


3)What you have learned from mistakes on the job?
 

Ans: Honestly says, i have learned time management and plan the tasks. I also learned how to analyze and understand the requirements. Now, i am able to manage any stress in workplace.

4)What do you do to improve your Knowledge? 
Ans: In IT field is very revolutionary so you need to be updated about the new technological developments. In my opinion answer to say about blogs you visit,technical websites etc.. 

5) What is your dream job?


Ans: You shouldn't tell about specific job. you can say something like this: A job where i love the work,like the people,can contribute and can't wait to get to work.

6) How would be an asset to this organization?
 

Ans: To answer this question,in my opinion tell like as per my knowledge the growth of the organization is depends on collective effort. I would improve my knowledge regularly to become leader in my field. I will dedicate my work. So,definitely, i can say that i will part this organization for long term and will be good asset to your organization.

7) What would your previous supervisor say your strongest point is?

Ans: There are numerous good possibilities: Loyalty,Energy,Positive attitude,Leadership,Team player,Expertise,Initiative,Patience,Hard Work,Creativity and Problem Solver.

8) Do you Consider yourself successful?

Ans: You should always answer YES and briefly explain why. A good explanation is that you have set goals,and you have met some and are on track to achieve the others.

9)What qualities do you look in a boss?
 

Ans: Be positive,a sense of humor,loyal to subordinates and holder of high standards. 

10) What is your Philosophy towards work?

Ans: The interviewer wants to know do you have strong feeling that the job gets done? so, state some positive points like Teamwork,motivation,unique,effort,leadership and learn from mistakes. Whatever you state that all those things shows benefit to the organization.


11) Tell me about a problem you had with a supervisor?
 

Ans:  This question is to test to see if you will speak ill of your boss. Don't say negative about boss, stay positive and develop a poor memory about any trouble with a supervisor.

12)Do you thing you are overqualified for this position?
 

Ans: Don't say YES, Since you applied for the job because of matching your skills. So, state that you are very well qualified for this position.

13)Tell me about a time when you helped resolve a dispute between others?
 

Ans: This was tricky !!! to answer this question should showcase your ability to take deliberate and relational approach to addressing workplace to conflict. So, Concentrate on your problem solving technique and not the dispute you settled.

14)What is your work style?

Ans: This is one of the among  the most favored behavioral interview question.Being thrown into a highly competitive environment owing to my job profile, I am adjustable to situations  throwing a highly challenging environment with a lot of pressure. So my work style always emphasized upon soaking up the pressure and delivering the project. 

15) Do you know anyone who works for us?

Ans: You should be aware of the policy on relatives working for the organization. This can affect your answer even though they asked about friends not relatives. Be careful to mention a friend only if they are well thought of.

16) What kind of salary do you need?

Ans: A nasty little game that you will probably lose if you answer first. So, do not answer it. instead,say something like,that's a tough question. In most cases,interviewer,taken off guard,will tell you,if not,say that it can depend on the details of the job.Then give a wide range.

17) What are your strengths and weakness?

Ans: The main purpose of asking to this question is to understand how much you know about yourself. In my opinion give answer to this question, list as many strengths as you can but briefly and one or two weakness.

18)Where do you see yourself after 5 years from now?

Ans: You could say confidently, i can see my self as being responsible person in this organization having right roles and responsibilities. I am sure that this organization can provide and offer me such growth opportunities to me. 

19)How would be an asset to this organization?

Ans: To answer this question,in my opinion tell like as per my knowledge the growth of the organization is depends on collective effort. I would improve my knowledge regularly to become leader in my field. I will dedicate my work. So,definitely, i can say that i will part this organization for long term and will be good asset to your organization.

20) Why should we hire you?

Ans: Point out how your assets meet what the organization needs. Do not mention any other candidates to make a comparison.

21)Why should i hire you from the outside when i could promote someone from within?

Ans: You could answer like yeah, you are right to promote someone from your organization. But sometimes give opportunity to outsider. Since, your employees can see only present aspect and routine thoughts,but as a outsider,we can see various aspects with fresh thoughts and ideas that would helps a lot. 

22)What is your greatest Accomplishment?

Ans: Honestly says, what you accomplish till date and talk about that exhibits how you will be a perfect fit for the company and for the position your are.

23)Are there any time you went beyond your current job?If so,how did you handle that to take up new challenges?

Ans: This is a bit tricky one, you could say, in current organization, i have been part of 4 years. Last year, we got project from one of the top organization. Then my manager asked me to take up that responsibility. I took that responsibility of initial prototype building. And i executed successfully with-in time limit. Users were felt happy with project outputs. Due to that today we got many projects from same client.I felt, so happy because i was in part of to add business and values to the organization. At the some time, i got appreciate and good bonus. It was great honour. 

24) Can you work under pressure?

Ans: Most of the time , the job of software development is that  of working under pressure. Sometimes,it will be the pressure of delivering on time while it can be that of a bug that has sprung all of a sudden in your code. So, expect pressure in everything you do. It is important to maintain your performance and develop to deliver under pressure. 

25)Have you ever fired anyone? How would you go about firing a person,if required?

Ans: The basic purpose of asking this question is to check your EQ and see if you have the guts to make tough decisions. If you have fired anyone in the past,discuss your experience and approach. If you have never done so in the past, discuss the approach you would take to make and implement such a decision. 

26)What position would you prefer while working on a project?

Ans:  This question is for you to answer based on the skills and qualities you have. If you have the capability to handle different positions,discuss that also in the interview.


27)What do you know about us?

Ans:  Research the company and its business a bit before appearing for the interview. Also, find out a bit about the technologies they work upon. You don't need to know everything inside out but having fair idea about the company makes you appear interested in the position,to be taken seriously. For example: I see that you company does lot of projects based on Open source platforms like JAVA, joomla which is  quite interesting as i have similar kind of experience.

28)who is your role model?

Ans: You can tell your role model as your choice...but my role model is my dad because i did not see up to now who worked so hard and still having time for his family.He always assist me like a friend, he used to share his experience and mistakes he did in his life so that we will not repeat them.Even though he had many problem he keeps his face smiley and never showed his odd behavior to our family. He put his whole life in working and never made us to look down.So, my dad is the world best father. 

29)What are your hobby?

Ans: My hobbies are solving puzzles specially sudoku,computer gaming,surfing the internet,drawing and i read books in my sparing time.

30)Do you have any question for me?


Ans: Always have some questions prepared where you will be asset to the organization are good. How soon will i be able to be productive? and what type of projects will i be able to assist are examples.

Saturday, February 25, 2017

Cloud Computing Interview Questions

In this post i am sharing Cloud Computing Interview Questions. These questions are helpful for freshers and for final year Students. Now a days,Cloud Computing is one one of the important technology. Cloud Computing is the computing which is completely based on the Internet. The main purpose of the cloud computing is that provides the way to deliver the services whenever and wherever the user of the cloud needs.

Companies use the cloud computing to fulfill the needs of their customers,partners and providers. The cloud computing includes vendors,partners,and business leaders as the three major contributors. Now we will see some important questions and answers

1) What is Cloud?

Ans: A cloud is a combination of hardware,software,storage,services and interfaces that helps in delivering computing as a service.It has broadly three users which are end user,business management user,and cloud service provider. The end user is the one who uses the services provided b the cloud. The business management user in the cloud takes the responsibility of the data and services provided by the cloud. Finally the cloud service provider is the one who takes care or is responsible for the maintenance of the IT assets of the cloud. The cloud acts as a common center for its users to fulfill their computing  needs.

2) What is Cloud Computing?

Ans: The Cloud Computing is the computing which is completely based on the internet.It uses the internet and remote servers to maintain data and applications. A simple example for Cloud computing is Gmail and Yahoo etc...

3) Why Cloud Computing is Important?

Ans: There are many applications of Cloud Computing,for both developers and end users. For developers,cloud computing provides increased amount of storage and processing power to run the applications they develop. Cloud computing also enables new ways to access information,process and analyze data,and connect people and resources from any location anywhere in the world.

For end users,cloud computing offers all those benefits and more. A person using a web-based application isn't physically bound to a single PC,location,or network. His applications and documents can be accessed wherever he is,whenever he wants.No fear of losing data if a computer crashes.Documents hosted in the cloud always exist,no matter what happens to the user's machine. It is a whole new world of collaborative computing all enabled by the notion of cloud computing.

Cloud computing does all this at lower costs because the cloud enables more efficient sharing of resources than does traditional network computing.Cloud infrastructure can be located anywhere,including and especially areas with lower real estate and electricity costs.

4) What are the basic characteristics of cloud computing?

Ans: There are four characteristics of cloud computing as follows:


  1. Elasticity and scalability
  2. Self-service provisioning and automatic de-provisioning
  3. Standardized interfaces
  4. Billing self-service based usage model
5) What is Cloud service?

Ans: A cloud service is a service that is used to build cloud applications. This service provides the facility of using the cloud applications.This service provides the facility of using the cloud application without installing it on the computer. It reduces the maintenance and support of the application as compared  to those applications that are not developed of users can use the application from the cloud service which may be public or private application

6) What are the features of Cloud Services?

Ans: The following are the some important features. They are


  • Accessing and managing the commercial software
  • Centralizing the activities of management of software in the web environment
  • Developing applications that are capable of managing several clients
  • Centralizing the updating feature of software that eliminates the need of downloading the upgrades.
7) What are the advantages of Cloud Service?

Ans: The following are some of the advantages of Cloud service: They are

  • Helps in the utilization of investment in the corporate sector and therefore,is cost saving.
  • Helps in the developing scalable and robust applications. Previously, the scaling took months,but now,scaling takes less time
  • Helps in saving time in terms of deployment and maintenance
8) What are the disadvantage of Cloud Computing?

Ans: The following are the some of the disadvantages of Cloud Computing: They are

  • Requires a constant internet connection
  • Doesn't work well with low speed Connections
  • Can be slow
  • Features might be limited
  • Stored data might not be secure
  • If the cloud loses the data,you are screwed
9) How many types of Cloud Services?

Ans: A cloud Service is any resource that is provided over  the internet. The most common cloud service resources are.

Software as a Service(SaaS)
Platform as a Service(PaaS)
Infrastructure as a Service(IaaS)


10) How many types of deployment models are used in Cloud?

Ans: There are 4 types of deployment models are used in Cloud:

1)public cloud
2)private cloud
3)Community cloud
4)Hybrid Cloud

11) Why does the organization need to manage the workloads?

Ans: The workload can be defined as an independent service or a set of code that can be executed.
The organization manages workloads because of the following reasons:


  • To know how their applications are running
  • To know what functions they are performing
  • To know the charges of the individual department according to  the use of the service
12) Which services are provided by window Azure operating System?

Ans: Windows Azure provides three core services which are given as follows:


  • Compute
  • storage
  • Management
13) Explain Public and private cloud?

Ans: The public cloud(or external cloud) is freely available for access. You can use a public cloud to collect data of the purchasing of items from a web site on the internet. You can also use public cloud for the reasons which are given as follows:


  • Helps when an application is to be used by a large number of people,such as an e-mail application on the internet.
  • Helps when you want to test the application and also needs to develop the application code
  • Helps when you want to implement the security for the application
  • Helps when you want to increase the computing capacity
  • Helps when you are developing the project on an ad-hoc basis by using PaaS

The Private cloud allows the usage of services by a single client on a private network. The benefits of this model are data security,corporate governance,and reliability concerns. It offers a well managed environment. It provides capability to internal users allows provision of services.






Saturday, February 18, 2017

Tips to crack Toughest Interview

In this article we will know some important tips to crack toughest interviews. These tips useful for all either IT or NON-IT. For any given vacancy,at least hundreds,if not thousands of candidates apply for the job. It takes only a few seconds for interviewer to reject you. It is important to succinctly outline your career objective,work experience,projects,training's, personal strengths and so on.

The following steps help you to crack toughest interview:

Evaluate the nature of the question:

Evaluate whether the question demands a factual answer and is meant to test your general knowledge and awareness. A factual questions like - who developed Java? This type of question demands correct answer.

However, a subjective one, like what are your thoughts "whether tablets replace text books?". In this type of questions,give a balanced answer by including as many perspectives as one can.

My conclusion is  first understand the question what kind of answer interviewer expecting. In the case of factual questions,if you do not know the answer it is better to accept your ignorance and say: I'm sorry i do not know the answer.In case of subjective questions,give a balanced answer by including as many perspective as one can.

Your answer reflects who you are:

Interviewers ask tricky questions just so that they could gauge the candidate's  personality.

For example, a question like - Do you think it was right on the part of our company to introduce the new employee policy?

If you are going to consciously make an attempt to sound positive or agreeable just so that the company hiring you will consider you application,you could be mistaken.

It is important to be honest and at the same time,sound relevant and important.

You could say- I think what the company did was right. But if i were in your place, I would..depending on what you think is right.



Stay calm,Think:

  When faced with a tough interview or a tough question,it is important to stay calm.

Sometimes the questions is just to test the ability of the candidate to handle pressure and difficult situations.

Under pressure,one must not say anything, that could betray anxiety,nervousness,anger,
thoughtlesseness, biases and such other negative emotions.

Difficult situations are the true test of one's abilities. One must view these as opportunities and not threats.

Your positive attitude,confidence and presence of mind will alone help you cruise through a tough interview.






Wednesday, February 15, 2017

What is C Language

In this article we will learn the introduction of C programming Language. This is basic Programming Language who want become Programming Developer then he/she should learn C programming Language. C is a programming language developed at AT & T’s BellLaboratories of USA in 1972. It was designed and written by a man named Dennis Ritchie.

Ritchie seems to have been rather surprised that so many programmers preferred C to older languages like FORTRAN or PL/I, or the newer ones like Pascal and APL. But, that's what happened. Possibly why C seems so popular is because it is reliable, simple and easy to use. Moreover, in an industry where newer languages, tools and technologies emerge and vanish day in and day out, a language that has survived for more than 3 decades has to be really good.  



C has been already superceded by languages like C++, C# and Java, so why bother to 
learn C Language.Though many C++ and Java based programming tools and frameworks have evolved over the years the importance of C is still unchallenged because knowingly or unknowingly while using these frameworks and tools you would be still required to use the core C language elements—another good reason why one should learn C before C++, C# or Java. 

Major parts of popular operating systems like Windows, UNIX, Linux is still written in C. This is because even today when it comes to performance (speed of execution) nothing beats C

Mobile devices like cellular phones and palmtops are becoming increasingly popular. Also, common consumer devices like microwave oven, washing machines and digital cameras are getting smarter by the day. This smartness comes from a microprocessor, an operating system and a program embedded in this devices. These programs not only have to run fast but also have to work in limited amount of memory. No wonder that such programs are written in C

You must have seen several professional 3D computer games where the user navigates some object, like say a spaceship and fires bullets at the invaders. The essence of all such games is speed. Needless to say, such games won't become popular if they takes a long time to move the spaceship or to fire a bullet. To match the expectations of the player the game has to react fast to the user inputs. This is where C language scores over other languages. Many popular gaming frameworks have been built using C language

At times one is required to very closely interact with the hardware devices. Since C provides several language elements that make this interaction feasible without compromising the performance it is the preferred choice of the programmer.

I hope that these are very convincing reasons why one should adopt C as the first and the very important step in your quest for learning programming languages










Monday, February 13, 2017

what is Hacking

In this post we will discuss about Hacking and how hackers employ a variety of techniques for hacking. Now a days, data networks became by far the most common target of hackers and hacking.

In computer networking,hacking is any technical effort to manipulate the normal behavior of network. The term "hacking" historically referred to constructive,clever technical work that was not necessarily related to computer systems.Now a days,hacking and hackers are most commonly associated with malicious programming attacks on the internet and other networks.

Hacking is unauthorized intrusion into a computer or a network. The person engaged in hacking activities is generally referred to as a hacker. This hacker may alter system or security features to accomplish a goal that differs from the original purpose.

Hackers employ a variety of techniques for hacking: They are

  1. password cracking: The process of recovering passwords from data stored or transmitted by computer systems
  2. Vulnerability scanner: Checks computers on networks for known weaknesses 
  3. Packet Sniffer: applications that capture data packets in order to view data and passwords in transit over networks.
  4. Trojan horse: Serves as a back door in a computer system to allow an intruder to gain access to the system later
  5. Viruses:  self-replicating programs that spread by inserting copies of the same program into other executable code files or documents
  6. Key loggers: This a tool designed to record every keystroke on the affected machine for later retrieval.
  7. Root kit: It represents a set of programs which work to subvert control of an OS from legitimate operators.
 Common networking Hacking Techniques:

Hacking on computer networks is often done through scripts and other network software. These specially designed software programs generally manipulate data passing through a network connection in ways designed to obtain more information about how the target system works. More advanced hackers may study and modify these scripts to develop new methods. A few highly skilled hackers work for commercial firms,hired to protect that company's software and data from outside hacking. 

                            Cracking techniques on networks include creating worms,initiating denial of service(Dos)attacks,or in establishing unauthorized remote access connections to a device.



Requirements for effective hacking the combination of technical skills and personality traits:

  • Ability to work with numbers and a background in mathematics. Hacking often requires sorting through large amounts of data,code and computer algorithms
  • Memory recall and logical reasoning,Hacking involves assembling small facts and details into a plan of attack based on the logic of how computer systems work.
  • patience.Hacks tend to get very complex and require large amounts of time to plan and execute.
 

Sunday, February 12, 2017

Operating System Interview Questions

In this post we will learn Operating System(OS) Interview Questions which every IT developer must have knowledge on these Q & A. These questions and answers come across Technical Written Test also. Let us see what are those Questions and Answers as follows..

1) What is Operating System?

Ans:  An Operating System is a software program that enables the computer hardware to communicate and operate with the computer software. Without a computer Operating system, a computer would be useless.

2) What are the different Operating Systems?

Ans: There are different types OS they are

1) Multi-programming OS
2) Distributed OS
3)Batched OS
4)Time-sharing OS
5)Real-time OS

3) Why paging is used in OS?

Ans: Paging is solution to external fragmentation problem which is to permit the logical address space of a process to be noncontinuous,thus allowing a process to be allocating physical memory wherever the latter is available.

4) What is the state of the processor,when a process is waiting for some event to occur?

Ans: The state of the processor is : Waiting state

5) What is Virtual Memory?

Ans: Virtual Memory is hardware technique where the system appears to have more memory that it actually does. This is done by time-sharing ,the physical memory and storage parts of the memory one disk when they are not actively being used.

6) What is fragmentation?

Ans:  Fragmentation occurs in a dynamic memory allocation system when many of the free blocks are too small to satisfy any request.

7) What is the cause of thrashing? How does the system detect thrashing?

Ans:  Once it detects thrashing,what can the system do to eliminate this problem? Thrashing is caused by under allocation of the minimum number of pages required by a process,forcing it to continuously page fault. The system can detect thrashing by evaluating the level of CPU utilization as compared to the level of multi programming. It can be eliminated by reducing the level of multi programming.



8) While running DOS on PC,which command would be used to duplicate the entire diskette?

Ans: This command will be use to duplicate the entire diskette diskcopy.

9) What is cache-memory?

Ans: Cache memory is random access memory(RAM) that a computer microprocessor can access more quickly that it can access regular RAM. As the microprocessor process data,it looks first in the cache memory and if if finds the data there(from the previous reading of data). It does not have to do the more time-consuming reading of data from larger memory.

10) What is Kernal?

Ans: Kernal is the core and essential part of computer operating system that provides basic services for all parts of OS.

11) What is a process?

Ans: A program in execution is called a process or it may be called unit of work. A process needs some system resources as CPU time,memory,files and I/O devices to accomplish the task.

12) What is semaphore?

Ans: Semaphore is a variable,whose status reports common resources,Semaphore is of two types one is Binary semaphore and other is Counting semaphore.

13) What is deadlock?

Ans: Deadlock is a situation or condition where two processes are waiting for each other to complete so that they can start. This result both the processes to hang

14) What are system calls?

Ans: System calls provide the interface between process and the OS. System calls for modern Microsoft windows platforms are part of the win 32 API. Which is available for all the compilers written for Microsoft Windows.

15) What are the states of Process?

Ans: There are 5 states of Process. They are

1) NEW
2) Running
3) Waiting
4) Ready
5) Terminated


Thursday, February 9, 2017

PHP Interview Questions

In this page i am sharing frequently asked PHP interview Questions for Freshers and experienced candidates. These questions are frequently asked when you attend technical round in the companies.

1) What is PHP?

Ans: PHP is a server-side scripting language that is widely used for web development. By using we can write dynamic web pages efficiently and quickly. PHP is exectued on the server. It is open source scripting language,so it is free to download and use.It is very easy for learning.

2) Which Programming lanugage does PHP resemble to?

Ans: PHP programming language syntax is borrowed from perl,c. Thus PHP programming language looks same perl and C language. 

3) How do you execute a PHP script from the command line?

Ans: Just use the PHP command line interface(CLI) and specify the file name of the script to be executed as follows:
PHP

1
php script.php


4) what is meant by PEAR in PHP?

Ans: PEAR is short for "PHP extension and Application Repository". The main purpose of PEAR is to provides all kinds of php code snippets and libraries. Since PEAR is framework and repository for reusable PHP components. It also offers Command Line Interface(CLI) that can be used to automatically install "packages". A website,mailing lists and download mirrors to support the PHP/Pear community.

5) Is PHP a case sensitive programming Language?

Ans: PHP is a partially case sensitive programming language. We can use function names,class names in case sensitive manner.

6)Difference Between Echo and print statement in PHP?

Ans: Echo() and print() both are used to output strings. The speed of both statements is almost same. But the main difference is Echo() can take multiple expressions whereas print can not take multiple expression. Print() return true or false based on success or failure whereas Echo() does not return true or false.

7) How to include a file to a php page?

Ans: we can include a file using "include() or "require()" function with file path as its parameter.

8) What is difference between include() and require()?

Ans: If the file is not found by the require(),it will cause a fatal error and halt the execution of the script. If the file is not found by include() a warning will be issued but execution will continue.

9)What are the different types of errors in PHP?

Ans: There are three types of errors in PHP. They are Notices,Warnings and fatal errors.

10) How can we display the output directly to the browser?

Ans: To display the output directly to the browser,we have to use the special tags<?=and?>

11) What is the main difference between PHP 4 and PHP 5?

Ans: PHP 5 presents many additional Object Oriented Programming Features.

12) What are difference between GET and POST methods?

Ans: We can send 1024 bytes using GET method but POST method can transfer large amount of data and POST is the secure method than GET method.

13) How can we submit form without a submit button?

Ans: we can use a simple java script code linked to an event trigger of any form filed. In the java script code,we can call the document.form.submit() function to submit the form.

14) How can we encrypt the username and password using PHP?

Ans: You can encrypt a password with the following:
Mysql>SET PASSWORD=PASSWORD(\"Password\");

we can encode data using
base64_encode($string) and 

we can decode data using 
base64_decode($string);

15) How can we register the variables into a session?

Ans: we can use the session_register($ur_session_var)function


16) Is multiple inheritance supported in PHP?

Ans:  PHP includes only single inheritance, it means that a class can be extended from only one single class using the keyword ? extended ?


17) How can PHP and HTML interact?

Ans: It is possible to generate HTML through PHP scripts,and it is possible to pass information from HTML to PHP.

18) What is session?

Ans: A PHP session is no different from a normal session. It can be used to store information on the server for future use.

19) How to declare an array in PHP?

Ans: var $arr=array('apple','banana','grape');

20) What is use of in_array() function in PHP?

Ans: in_array() is used to checks if a value exists in an array.

21) What is Cookies in PHP?

Ans: Cookies are used to track user information.

22) How to set cookies in php?

Ans: cookies are used to track the information.
Syntax: Setcookie(name,value,expire,path,domain);

Example: Setcookie(\"demo\",\"mahesh\",\time()+4000);

23) How we can connect to a MySql database from a PHP script?

Ans: To connect to MySql database from PHP script,we must use mysql_connect() function as follows:

PHP

1
<!--?php $database=mysql_connect("HOST","USER_NAME","PASSWORD");
mysql_select_db("DATABASE_NAME",$databse)?--


24) How can we access the data sent through the URL with the GET method?

Ans:  In order to access the data sent via the GET method,we use $_GET array like this:

www.url.com?var=value
$vairable=$_GET[?var?];this will now contain ?value?

25) What is the meaning of a persistent Cookies?

Ans: A persistent cookie is permanently stored in a cookie file on the browser's computer. By default,cookies are temporary and are erased if we close the browser.

26) How to initiate a session in PHP?

Ans: To activate a session we have to use a function as follows:
session_start();

27) What is the difference between session_unregister() and session_unset()?

Ans: The session_unregister() function unregister a global variable from the current session and the session_unset() function free all session variables.

28) How can we change the maximum size of the files to be uploaded?

Ans: we can change the maximum size of files to be uploaded by changing upload_max_filesize in php.ini.

29) Is it possible to submit a form with a dedicated button?

Ans:  It is possible to use the document.form.submit() function to submit the form.

For Example: <input type=button value=?SUBMIT?onClick=?document.form.submit()?>

30) How do you create sub domains using PHP?

Ans: To create domains using php Wild card domains can be used. Sub domains can be created by first creating.

31) When session ends?

Ans: Session automatically ends when the PHP script finishes executing,but can be manually ended using the session_write_close()

32) What is SSL?

Ans: SSL stands for Secure Sockets Layer. This is cryptographic protocols which provide secure communications on the internet.

33) What is difference between mysql_connect and mysql_pconnect?

Ans: Mysql_connect opens up a database connection every time a page is loaded whereas mysql_pconnect opens up a connection and keeps it open across multiple requests.

mysql_pconnect uses less resources,because it does not need to establish a database connection every time a page is loaded.

34) How do you make one way encryption for your passwords in PHP?

Ans:  By using md5 function or sha1 function

35) How can we repair Mysql table?

Ans: The syntax for repairing table is:

REPAIR TABLE tablename
REPAIR TABLE tablename QUICK
REPAIR TABLE tablename EXTENDED

This command will repair the table specified. If QUICK is given,Mysql will do a repair of only the index tree. If EXTENDED is given,it will create index row by row.