InfoSYS c++ questions
What are lists and tuples python
Lists and Tuples are both sequence data types that can store a collection of objects in Python
Difference between lists and tuples python
Lists are represented with square brackets ['sara', 6, 0.19] tuples are represented with parantheses ('ansh', 5, 0.97)
examples of python namespace
Local namespace Global namespace Built-in Namespace
explain modules and mixins in Ruby
Modules are Ruby's way of grouping methods, classes, and constants together to provide a namespace for preventing name clashes. The second purpose of modules is to use them as mixins. Technically, Ruby only supports single inheritance, but by using modules as mixins, it is possible to share code among different classes—a key advantage of multiple inheritance—without having to give up the simplicity of the single inheritance paradigm.
Can you run C++ cod in C
NO
Are references, virtual and friend functions supported in C
No
Is exception handling supported in C
No
common built-in data types in Python
None int float complex bool list tuple range str dict set frozenset modules callable types
What is OOPS?
OOPS is a programming methodology where an application program is designed considering everything as objects
C++ what is OOPS
Object Oriented Programming System
How would you freeze an object in Ruby
Object.freeze prevents an object from being changed
Which is the most popular SDLC model
One of them is the waterfall model. The other is AGILE which is gaining more popularity now because of its continuous iteration methodology that is less prone to errors during production environment.
What is PEP 8 and why is it important
PEP stands for Python Enhancement Proposal. A PEP is an official design document providing information to the Python Community, or describing a new feature for Python or its processes.
What is a pointer
Pointer is a variable that stores the address of another variable.
What is a dynamically typed language
Python being an interpreted language, executes each statement line by line and thus type-checking is done on the fly, during execution. Hence, Python is a Dynamically Typed language.
what is RDBMS
Relational Database Management System (RDBMS) is a set of programs that helps a developer to interact with the database for creating, updating or deleting data
What is SDLC
Software Development Life Cycle (SDLC) is an end to end process that defines the flow of the development of a project from requirements stage to the maintenance and support stage
In C++ devs can write code for pointers(T/F)
T
Java Uses pointer internally. Devs cannot write pointers(T/F)
T
Can you explain how ruby looks up a method to invoke
The first place that Ruby looks for a method is in the object's metaclass or eigenclass—the class that contains methods directly defined on the object. If the method cannot be found in an object's metaclass, Ruby will then search for the method in the ancestors of an object's class. The list of ancestors for any class starts with the class of the object itself, and climbs parent classes until it reaches the Object, Kernel, and BasicObject classes at the top of the Ruby class hierarchy. If Ruby cannot find the method, it will internally send another method aptly called "method_missing?" to the object class. Ruby will repeat another search for this method, and will at least find it in the object class, provided the programmer did not see fit to define the "method_missing?" class earlier in the ancestry of the object.
Abstraction
Through abstraction, we can separate what an object does from how the object works and show only 'what' to the user.
Are references, virtual and friend functions supported in C++
Yes
Is exception handling supported in C++
Yes
Can you run C code in C++
You can run most C code in C++
What is Scope in Python
a block of code where an object in Python remains relevant
C++ What is a class
a blue print which relfects the entities attribute and action
Foreign key
a column that references the column of another table to establish the relationship between two tables
What is a virtual function C++
a function in a parent class that must be overridden in each child class
What are the beenefits of using Python
a general-purpose programming language that has simple, easy-to-learn syntax which emphasizes readability and therefore reduces the cost of program maintenance
What is python
a high-level, interpreted, general-purpose programming language
What is self if python
a keyword used to define an instance or an object of a class
C is
a procedural language, hence there is no concept of classes, objects, inheritance, encapsulation, and polymorphism.
what is a pure virutal functionC++
a virtual function with no function body
C++ is
an Object-Oriented language. Polymorphism, encapsulation and inheritance are the essences of OOPS
what is lambda in Python
an anonymous function, can accept any number of arguments, but can only have a single expression
what is PYTHONPATH
an environment variable which you can set to add additional directories where Python will look for modules and packages
In C main functions can be called from
any other function
what are decorators in python
are essentially functions that add functionality to an existing function in Python without changing the structure of the function itself.
What are SQL triggers
are stored procedures that are invoked when some event like insert, update or delete happens in the database on a particular table.
What is break, continue, and pass in python
break - terminates the loop immediately continue - terminate the current iteration of the loop pass - used to fill up empty space
what is a friend class
can access the protected and private members of that class.
what is a friend function
can access the protected and private members of the class.
What is a frame HTML
can divide the html page into separate windows
In C++ the main function
cannot be called from any other function
JS What is the difference between classical inheritance and prototypal inheritance?
class inheritance - instances inheriting from their parent class prototypal inheritance - inherits directly from other objects
what is an abstract class in C++
class with at least on pure virtual function. cannot instantiate an abstract class
What are dict and list comprehensions python
comprehensions, like decorators, are syntactic sugar constructs that help build altered and filtered lists, dictionaries or sets from a given list, dictionary or set
what is __init__ python
constructor method, automatically called to allocate memory when a new object/instance is created
what is operator overloading C++
defining a new job for an existing operator
what is function overloading C++
defining seeral functions with the same name with unique list of parameters
C++ is a platform _______ language
dependent
what are generators in python
functions that return an iterable collection of items, one at a time, in a set manner
Ruby provides four types of variables
global - begin with $ local variables - lowercase letter class variables - begin with @@ shared throughout a class instance variables - beign with @ only in class methods
what is the use of help() and dir() functions
help - used to display the doucmentation of modules, classes, functions, keywords dir - function that returns a valid list of attributes and methods of the object it is called upon
Primary key
identifies each row in a table
Java is a platform ________ language
independent
C++What is an object
instance of the class
example of a pointer int a = 23;...
int *ptr = &a;
What are structs
is a customized data type that contains other data types
Encapsulation
is based on the concept of having the data and code into a single unit to hide the internal workings of the code to an end-user.
How is memory managed in Python
is handled by the Python Memory Manager. The memory allocated by the manager is in form of a private heap space dedicated for Python. All Python objects are stored in this heap and being private, it is inaccessible to the programmer.
what is a unique key
key/id of each table entry
types of data structures in C++
linear/nonlinear
what is a database schema
logical represnetation or structure of the entire database
In C Dynamic memory allocation is done through
malloc() and calloc() functions
what is a constructor C++
member function of a class with same name. gets executed automatically on creation of an objecct
What is a destructor
member function of the class with same name as the class prefixed with a ~. gets executed automatically once the object loses scope. can not be overloaded
Difference between sturcts and classes
members of a classes are private by default and a class can be inherited. members of a struct are public by default and a struct cannot be inherited.
C++ supports _______ inheritances
multiple
java doesn't support _______ inheritances
multiple
In c is there operator and function overloading
no
Disadvantage of using C++
no built-in support threads, does not support garbage collection
How is python interpreted
not interpreted or compiled. these things are the property of the implementation. python is a bytecode interpreted generally
Scope resolution in Python
objects within the same scope have the same name but function differently
C++ supports operator
overloading
Java Does not support operator
overloading
C++ supports both
pass by value and refernce
What is pickling and unpickling?
pickling - name of serialization process unpickling - inverse of pickling, deserializes object
Difference between reference and pointer
pointer stores the address of a variable. Refernce is just a copy of a variable with a different name
C++What is inheritance
process fo acquiring the properties of the exiting class into the new class
C++ what is encapsulation
process of binding the data and funcctions acting on the data todgether in an entity
Name the three level of access control for ruby methods
public, private, protected
advantages of using ruby
pure Object Oriented language, open-source, metaprogramming, clean simple syntax
Difference between xrange and range in python
range returns a python list is a static list xrange returns an xrange object creates list values on the go
Polymorphism
redefine the way the certain thing works using a different implementation. Polymorphism can be achieved using overloading and overriding.
C++What is abstraction
refers to hiding the internal implementation and exhibiting only the necessary details
what is a pass in Python
represents a null operation in python
What are the stages in SDLC
requirements analysis, planning, definition, design, development, testing, deployment, and support (maintenance).
Input/Output in C is done with
scanf(input) printf(output)
what types of copies are there python
shallow copy - bit-wise copy of an object deep copy - all values recursively from source to target object
advantages of modules and packages in python
simplicity maintainability Reusability scoping
C++Types of inheritance supported
single, multileve, multiple, hieratchial, and hybrid
examples of data structures in c++. linear: nonlinear:
stack, queue, and linked list tree, graph
explain the role of thread pooling in relation to the thread lifecycle
starts automatically as soon as CPU resources are abailable. runs the code in the block where it was instantiated and obtains the value of the last expression then returns it upon completion. Thread pooling is a technique where multiple pre-installed reusable threads are left on standby, ready to perform work when needed
in C++ Dynamic memory allocation is done through
the 'new' operator.
Explain the pointer this
the pointer variable of the compiler that represents the current object
Do you know what is waterfall model
this approach follows breaking down of project activities into different phases. Once a stage is completed, the next stage in the sequence is followed. Each stage is dependent on the result of the previous stage
How is OOPS implemented in c++
through class, inheritance, polymorphism, abstraction, encapsulation
what are modules and packages in Python
two mechanisms that allow for modular programming in Python. module is a python file with a .py packages is a group of namespaced modules grouped in a single file
What are unittests in Python
unit testing framework for testing different components of software separately
how do you copy an object in python
use copy module, = sign only binds the objects together
What are SQL joins
used to get results from multiple tables using primary and foreign keys of related tables
C++ what is the purpose of the delete operator
used to release the dynamic memory which was created using new
Java supports pass variable only by
value
Inheritance
where a child class inherits methods and data used in parent class
Does python have garbage collection
yes
in C++ is there operator and function overloading
yes its easy to implement
dereference operator
*
difference between .py and .pyc files
.py files contain the source code of a program .pyc files contain the bytecode of the program, from compiling the .py file
When a class member is defined outside the class, which operator can be used to associate the function
:: scope resolution operator
What are blocks and procs
A block is basically Ruby's version of a closure—a block of code that can be wrapped up into a proc (a type of function) that can then be stored in a variable or passed to a method and run when desired.
Types of python scope
A local scope refers to the local objects available in the current function. A global scope refers to the objects available throught the code execution since their inception. A module-level scope refers to the global objects of the current module accessible in the program. An outermost scope refers to all the built-in names callable in the program. The objects in this scope are searched last to find the name referenced.
What are Python namespaces
A namespace in Python ensures that object names in a program are unique and can be used without any conflict. Python implements these namespaces as dictionaries with 'name as key' mapped to a corresponding 'object as value'.
What is a class
A template from which objects are created
What is an interpreted language
An Interpreted language executes its statements line by line. Languages such as Python, Javascript, R, PHP and Ruby are prime examples of Interpreted languages.
Input/output in C++ is done with
CIN(input) COUT(output)
C++ What is a default constructor
Every class does have a constructor provided by the compiler if the programmer doesn't provides one and known as default constructor. A programmer provided constructor with no parameters is called as default constructor. In such case compiler doesn't provides the constructor.
JS what is functional programming
Functional programming produces programs by composing mathematical functions and avoids shared state & mutable data.
What is global protected and private attributes in python
Global- public variables defined in the global scope Protected - attributes defined with an underscore, can be accessed from outsided the class they are defined in Private - attributes defined with double underscore, cannot be accessed from outside thier scope
What is the full form of HTML
Hypertext mark-up language
what is the role of protected access specifier
If a class member is protected then it is accessible in the inherited class. However, outside the both the private and protected members are not accessible.