Basic and Advance Programming Interview Preparation Guide
Download PDF

Learn basic programming concepts with hundreds of Interview Questions and Answers with examples.

34 Programming Questions and Answers:

1 :: What is Python and what is scope of Python?

Python is an interpreted, interactive, object-oriented programming language. It is often compared to Tcl, P e r l, Scheme or Java.

Python combines remarkable power with very clear syntax. It has modules, classes, exceptions, very high level dynamic data types, and dynamic typing. There are interfaces to many system calls and libraries, as well as to various windowing systems (X11, Motif, Tk, Mac, MFC, wxWidgets). New built-in modules are easily written in C or C++. Python is also usable as an extension language for applications that need a programmable interface.

The Python implementation is portable: it runs on many brands of UNIX, on Windows, OS/2, Mac, Amiga, and many other platforms.

The Python implementation is copyrighted but freely usable and distributable, even for commercial use.

2 :: If a class is declared without any access modifiers, where may the class be accessed?

A class that is declared without any access modifiers is said to have package access. This means that the class can only be accessed by other classes and interfaces that are defined within the same package.

3 :: Does a class inherit the constructors of its superclass in programming?

A class does not inherit constructors from any of its super classes.

4 :: What is the difference between shadow and override in programming?

Overriding is used to redefines only the methods, but shadowing redefines the entire element.

5 :: What is multithreading in a programming language?

Multithreading is the mechanism in which more than one thread run independent of each other within the process in any programming language such as C, C++, Java etc...

6 :: What are inner class and anonymous class concept in Programming?

Inner class in Programming:
classes defined in other classes, including those defined in methods are called inner classes. An inner class can have any accessibility including private.

Anonymous class in Programming:
Anonymous class is a class defined inside a method without a name and is instantiated and declared in the same place and cannot have explicit constructors.

7 :: What is meant by “method-wars” in Programming?

Before 1994 there were different methodologies like Rumbaugh, Booch, Jacobson, Meyer etc who followed their own notations to model the systems.
The developers were in a dilemma to choose the method which best accomplishes their needs. This particular span was called as “method-wars”

8 :: Who were the three famous amigos and what was their contribution to the object community?

The Three amigos namely,
James Rumbaugh (OMT): A veteran in analysis who came up with an idea about the objects and their Relationships (in particular Associations).
Grady Booch: A veteran in design who came up with an idea about partitioning of systems into subsystems.
Ivar Jacobson (Objectory): The father of USECASES, who described about the user and system interaction.

9 :: What is Downcasting in Programming?

Downcasting concept is the casting from a general to a more specific type, i.e. casting down the hierarchy in programming.

10 :: Can a method be overloaded based on different return type but same argument type in programming?

No, method can not be overloaded because the methods can be called without using their return type in which case there is ambiguity for the compiler in programming languages.