Tech Questions
Tech Questions
Beginner-friendly:
1. What is the difference between JDK and JRE? [Beginner]
Answer: JDK stands for Java Development Kit, which includes tools for developing Java
applications. JRE stands for Java Runtime Environment, which is required to run Java applications.
Answer: You can declare a variable in Java using the following syntax: `type variableName;` For
example, `int age;`
Answer: The `==` operator compares the references of two objects, while the `equals()` method
compares the content or values of two objects.
Answer: The main() method is the entry point for a Java program and is where the program starts
its execution.
Answer: A constructor is a special method used to initialize objects in Java. It has the same name as
the class and is called when an object is created.
Answer: Method overloading is when a class has multiple methods with the same name but
different parameters.
Answer: Access modifiers determine the accessibility of classes, methods, and variables in Java.
Examples include public, private, and protected.
9. What is the difference between a class and an object in Java? [Beginner]
Answer: A class is a blueprint or template for creating objects, while an object is an instance of a
class.
Answer: Java has eight primitive data types: byte, short, int, long, float, double, char, and boolean.
Moderate:
11. Explain the concept of inheritance in Java. [Moderate]
Answer: Inheritance is a mechanism in Java where a class acquires the properties and methods of
another class. It allows code reuse and creates a parent-child relationship between classes.
12. What is the difference between an abstract class and an interface in Java? [Moderate]
Answer: An abstract class can have both concrete and abstract methods, while an interface can
only have abstract methods. A class can implement multiple interfaces but can extend only one
abstract class.
Answer: Exceptions in Java can be handled using try-catch blocks. The try block contains the code
that may throw an exception, and the catch block catches and handles the exception.
Answer: Method overriding is a feature in Java that allows a subclass to provide a different
implementation of a method that is already defined in its superclass.
15. What is the difference between checked and unchecked exceptions in Java? [Moderate]
Answer: Checked exceptions are checked at compile-time, and the programmer is required to
handle them using try-catch blocks or declaring them in the method signature. Unchecked
exceptions are not checked at compile-time and do not require explicit handling.
Advanced:
16. What are interfaces in Java? Provide an example. [Advanced]
Answer: An interface in Java is a collection of abstract methods. It defines a contract that
implementing classes must follow. Example: `interface Shape { void
draw(); }`
Answer: Lambda expressions are anonymous functions introduced in Java 8. They allow you to
pass behavior as a parameter to methods. Example: `(x, y) -> x + y`
18. What is the Java Virtual Machine (JVM)? Explain its role. [Advanced]
Answer: JVM is an abstract machine that executes Java bytecode. It provides platform
independence by converting bytecode into machine-specific instructions.
19. What are the synchronized and volatile keywords used for in Java? [Advanced]
Answer: The synchronized keyword is used for thread synchronization, ensuring only one thread
can access a synchronized block of code at a time. The volatile keyword is used to ensure visibility of
changes made by one thread to other threads.
Answer: The finalize() method is called by the garbage collector before reclaiming the memory
occupied by an object. It allows an object to perform cleanup operations before it is garbage
collected.
Python
Beginner:
1.how is memory managed in python.
2.difference between float and double(memory storage)
Moderate:
11. What are dictionaries in Python? Provide an example. [Moderate]
Answer: Dictionaries are unordered collections of key-value pairs. Example: `my_dict = {"name":
"John", "age": 30}`
13. What is the difference between `append()` and `extend()` methods in Python? [Moderate]
Answer: The `append()` method adds an element to the end of a list, while the `extend()` method
extends a list by appending elements from another iterable.
Advanced:
16. What are decorators in Python? Provide an example. [Advanced]
Answer: Decorators are a way to modify the behavior of functions or classes in Python. They are
indicated by the `@` symbol. Example: `@decorator_name`
18. What are the differences between shallow copy and deep copy in Python? [Advanced]
Answer: Shallow copy creates a new object but references the same elements, while deep copy
creates a new object and recursively copies all the elements.
Beginner-friendly:
1. What is the difference between `printf()` and `scanf()` functions in C? [Beginner]
Answer: `printf()` is used to display output to the console, while `scanf()` is used to read input from
the user.
8. How do you swap the values of two variables in C without using a temporary variable? [Beginner]
Answer:
```
a = a + b;
b = a - b;
a = a - b;
```
Moderate:
11. What is the difference between an array and a pointer in C? [Moderate]
Answer: An array is a fixed-size collection of elements, while a pointer is a variable that stores the
memory address of another variable.
Advanced:
16. What
17. What are the storage classes in C? Explain their differences. [Advanced]
Answer: The storage classes in C are `auto`, `static`, `register`, and `extern`. They differ in their
lifetime, scope, and memory allocation.
C++
Beginner-friendly:
1. What is the difference between C and C++? [Beginner]
Answer: C++ is an extension of C with additional features such as classes, objects, and inheritance.
Moderate:
11. What is the difference between a class and an object in C++? [Moderate]
Answer: A class is a blueprint or template for creating objects, while an object is an instance of a
class.
15. What
Advanced:
16. What are templates in C++? Provide an example. [Advanced]
Answer: Templates in C++ allow you to create generic types or functions that can work with
different data types. Example:
```
template <typename T>
T max(T a, T b) {
return (a > b) ? a : b;
}
```
20. What is the difference between function overloading and function overriding in C++? [Advanced]
Answer: Function overloading allows multiple functions with the same name but different
parameters in the same scope, while function overriding occurs when a derived class provides a
different implementation of a virtual function inherited from a base class.
Front end :
Beginner-friendly:
1. What is HTML? [Beginner]
Answer: HTML stands for HyperText Markup Language. It is the standard markup language used
for creating web pages.
6. What is the difference between inline and block elements in HTML? [Beginner]
Answer: Inline elements do not start on a new line and only take up as much width as necessary,
while block elements start on a new line and take up the full width available.
7. What is the purpose of the `class` attribute in HTML? [Beginner]
Answer: The `class` attribute is used to assign one or more CSS classes to an HTML element. It
allows you to apply specific styles to multiple elements.
Moderate:
11. What is the purpose of media queries in CSS? [Moderate]
Answer: Media queries in CSS allow you to apply different styles based on the characteristics of
the device or browser, such as screen size or orientation.
13. What is the difference between `display: block`, `display: inline`, and `display: inline-block` in
CSS? [Moderate]
Answer: `display: block` makes an element a block-level element, `display: inline` makes an
element an inline-level element, and `display: inline-block` makes an element an inline-level element
that respects margins and paddings.
implemented using HTML `<ul>` and `<li>` elements for the menu structure and CSS to control the
visibility and positioning of the menu.
Advanced:
16. What are CSS preprocessors? Provide an example. [Advanced]
Answer: CSS preprocessors like Sass or Less are tools that extend the capabilities of CSS by
introducing features such as variables, nesting, mixins, and functions. Example: Sass code using
variables: `$primary-color: #ff0000;`.
20. What are CSS animations and transitions? Provide an example. [Advanced]
Answer: CSS animations and transitions allow you to animate and add smooth transitions to HTML
elements without using JavaScript. Example: Transition on hover: `transition: background-color 0.5s
ease;`.
Android studio
Beginner-friendly:
1. What is Android Studio? [Beginner]
Answer: Android Studio is the official integrated development environment (IDE) for Android app
development. It provides tools and features for designing, coding, and testing Android applications.
8. What is the difference between `match_parent` and `wrap_content` in Android layouts? [Beginner]
Answer: `match_parent` (or `fill_parent`) tells the view to take up as much space as its parent
allows, while `wrap_content` tells the view to wrap its content tightly.
9. What is the purpose of the `findViewById()` method in Android? [Beginner]
Answer: The `findViewById()` method is used to find and retrieve a reference to a UI element in an
Activity or a fragment based on its resource ID.
Moderate:
11. What is the Android Support Library? [Moderate]
Answer: The Android Support Library is a set of libraries provided by Google that allows
developers to use newer features and APIs on older versions of Android.
Advanced:
16. What is the Android
Jetpack library? [Advanced]
Answer: Android Jetpack is a set of libraries, tools, and architectural guidance provided by Google
that helps developers build robust and maintainable Android apps.
Framework:
Beginner-friendly:
1. What is a framework in software development? [Beginner]
Answer: A framework is a pre-written codebase that provides a structure and set of tools to simplify
and accelerate the development of software applications.
7. How do you install a framework using a package manager like npm or Composer? [Beginner]
Answer: To install a framework using a package manager, you typically run a command like `npm
install framework-name` or `composer require framework-name` in the terminal or command prompt.
Moderate:
11. What is the concept of middleware in Express.js? [Moderate]
Answer: Middleware in Express.js is a function that sits between the server and the route handler. It
can modify the request and response objects, perform additional processing, and pass control to the
next middleware or route handler.
12. How do you handle authentication and authorization in a web application built with a framework
like Django or Ruby on Rails? [Moderate]
Answer: Authentication and authorization in frameworks like Django or Ruby on Rails can be
handled by using built-in features such as authentication middleware, user management systems, and
role-based access control.
the two.
15. How do you handle form validation in a framework like Laravel or ASP.NET MVC? [Moderate]
Answer: Form validation in frameworks like Laravel or ASP.NET MVC can be handled by using
validation libraries or built-in form validation features that validate input data based on specified
rules.
Advanced:
16. What is the concept of dependency injection in a framework like Symfony or Spring? [Advanced]
Answer: Dependency injection is a design pattern where the dependencies of a class are provided
from the outside rather than being created within the class itself. It promotes loose coupling and easier
testing.
17. How do you implement server-side rendering in a framework like Next.js or Nuxt.js? [Advanced]
Answer: Server-side rendering in frameworks like Next.js or Nuxt.js allows rendering the initial
HTML on the server before sending it to the client, providing better performance and SEO benefits.
20. What is the purpose of GraphQL in modern web development with frameworks like Apollo or
Relay? [Advanced]
Answer: GraphQL is a query language for APIs that provides a more efficient and flexible
alternative to REST. It allows clients to request specific data and reduces over-fetching and under-
fetching of data.
Please note that the answers provided are brief explanations. You can expand on them or provide
more details during the interview as necessary.