Object-oriented programming is one of most important part of interviews.This post covers almost all the basic definitions that are asked in interviews.All the key terms with their definitions are as follows- Object-Oriented Programming: OOP is a programming technique for developing software solutions wherein the real world is represented in terms of objects. It is a real-world entity, in which data and function are hidden from outside the world the only object of the class can access the data and functionality of the class. e.g: If the animal is the class then the dog is the object if a human is a class then man is the object. A dog has legs and eyes, then eyes are the variable in the technical concept, this is the property and the dog may run or may walk, these are methods, and the same concept we used in OOPS concept. Advantage of object-oriented programming: Faster development: Reuse enables faster development. Improved...
Posts
Machine learning interview questions are one of the most important part in data science interview. There are some answers to go along with them so you don’t get stumped. You’ll be able to tackle basic questions on machine learning in any job interview after reading through this piece. What is Machine Learning? Machine learning is a field of study that gives computers ability to learn without being explicitly programmed. or A computer is said to learn from experience E with respect to some task T and some performance measure P, if it's performance on T as measured by P increases with E. What are the types of Machine Learning? -Supervised learning -Unsupervised learning -Reinforcement learning -Recommendation system What do you mean by training sample? A training sample is a data point...
We require three dimensional geometric and co-ordinate transformation to change the view of a three dimensional object.Three dimensional transformations are extended from two dimensional transformations by considering the 'z' co-ordinate also in the plane.Just like two dimensional transformation in three dimensional transformations are formed by composing three basic transformations of translation, scaling and rotation. Here we are going to discuss about the scaling. What is scaling? A scaling transform can be used to make objects bigger or smaller. Mathematically, a scaling transform simply multiplies each x-coordinate by a given amount and each y-coordinate by a given amount. That is, if a point ( x , y ) is scaled by a factor of a in the x direction and by a factor of d in the y direction, then the resulting point ( x1 , y1 ) is given by ...
We require three dimensional geometric and co-ordinate transformation to change the view of a three dimensional object.Three dimensional transformations are extended from two dimensional transformations by considering the 'z' co-ordinate also in the plane.Just like two dimensional transformation in three dimensional transformations are formed by composing three basic transformations of translation, scaling and rotation. Here we are going to discuss about the translation. What is translation? A translation transform simply moves every point by a certain amount horizontally and a certain amount vertically. If ( x , y ) is the original point and ( x1 , y1 ) is the transformed point, then the formula for a translation is- x1=x+e ...
This generally happens with all of us.We save our password of websites in our browser and forget it later. Although when we open that website we don't need to enter the password.But if we want to know what is the password we see only ( ......... ) in our password section even after we logout from our dashboard. It is very easy to find these password.Follow the steps given below- Open the login section of the website whose password you want to retrieve. Suppose we are retrieving the password of facebook.If password is saved you will not get login window, so logout from your account and you will see a window like this- ...
Compilation of a C program is a four stage process- Preprocessing (creates file.i ) Compilation (creates file.s ) Assembly (creates file.o ) Linking (creates executable file ) Note- when we will generate all intermediate files for a cpp program preprocessing generates file.ii while other are same as C program intermediate files. We will discuss details of these steps later.First of all make a .c or .cpp file- Open your terminal and type this command- gedit hello.c and write the following code in this file. After saving this type this command in your terminal- gcc -save-temps hello hello.c (for .c file) g++ -save-temps hello hello.cpp (for .cpp file) Now open your folder where you have created the progra...
When we run C program it loaded into the ram in a very organized fashion.There are various segments to store code data and code instructions. The memory layout of a C program consist following sections- Text or code segment Initialized Data segment Uninitialized Data segment or .bss segment Heap segment Stack segment Command line argumets Text or Code segment - It is the segment in memory which contains executable instructions or compiled program(./a.out or .exe file). Usually, the text segment is sharable so that only a single copy needs to be in memory for frequently executed programs, such as text editors, the C compiler, the shells, and so on. Also, the text segment is often read-only, to prevent a program from accidentally modifying its instructions. Initialized data segment- It is basically a data segment which contains all global , static , constant , external (variable with extern keyword) variables that are initialized in the program. This is not just a read-...
Definition- structured programming does not means programming with structure.It is a programing done by using type of code structures given below- 1-Sequence of sequentially executed statements 2-Conditioanal execution statements (i.e. If ,Else) 3-Looping or iterations (i.e.For,do..while,while) 4-Structured subroutine calls (Functions) Advantage of structured programming- 1-Complexity can be reduced by dividing the problem in substructures. 2-Structure will give us clear control to the problem 3-Substructures or modules can be used repeatedly 4-Easy to update and add modules Disadvantage of structured programming- The main disadvantage of this style of programming is that all decisions are to be made from the start of the project and we know that specification changes by the time so whenever we need to change specification we have a great risk of rewriting a large part of project.
Definition- A header linked list is a type of linked list which always contains a special node called the header node at the very beginning of the linked list.It is an extra node kept at the front of a list. Such a node does not represent an item in the linked list.The information part of this node can be used to store any global information about the whole linked list. Source- pages.cs.wisc.edu Advantages of having a header node- In header node, you can maintain count variable which gives number of nodes in the list. You can update header node count member whenever you add /delete any node. It will help in getting list count without traversing in O(1) time. In addition to address of first node you can also store the address of last node. So that if you want to insert node at the rear end you don't have to iterate from the beginning of the list. Also in tcase of DLL(Doubly Linked List) if you want to traverse from rear end it helps. We can also use it to store the poi...
DDA algorithm is the basic algorithm for line drawing.In this method, we start from the starting point and then on each step a fixed increment is added to the current point to get the next point on the line.We repeat these steps till the end of the line. Let us suppose (x1,y1) and (x2,y2) are the end points of the line and the equation of the line is y=mx+c. slope of the line=(y2-y1)/(x2-x1) suppose dx=(x2-x1) and dy=(y2-y1) dx=dy/m and dy=m*dx dx and dy will be the values for incrementing x and y values of current point.so- X i+1 =X i + dy/m Y i+1 =Y i + m*dx DDA Algorithm- Read the points (x...