Kunal Interview Questions
Kunal Interview Questions
My name is Kunal Attri. I am currently pursuing B. Tech (CSE) from VIT Bhopal. Throughout my last 3
years of academic learning at VIT Bhopal, I have developed strong foundation in Java and Python. My
interests are in Machine Learning and Android Development, using which I have developed various
projects. One of my recent projects are Fruit Quality Detection. In this my role was to develop the
deep learning model for fruit quality detection and mobile app development. It was a wonderful
experience as I got deeper insights into integration of a deep learning model with a mobile app.
Other than this, I completed my schooling from Army Public School, in Delhi. During my school time, I
had the privilege of serving as the House captain, where I had the opportunity to lead my house to
numerous victories in various competitions. I was also appointed as the ATL Mentor and Ambassador
where I mentored my juniors about how to use basic electronics to solve everyday challenges. As the
ATL ambassador, I also organized ATL Tinkerfest, an event, where over 700 students from 29 schools
across Delhi participated. It was a great learning experience for me, as I organized 12 competitions
spread over just 2 days with a budget of 67k.
As for my hobbies, I also love to draw pencil sketches of landscapes and cartoons. I also enjoy playing
chess and solving sudokus in my free time. # I have a chess.com rating of 1637.
Q. You know about both Java and Python. Tell me some differences between Java and Python.
Java Python
It is compiled language It is Interpreted language
Statically typed Dynamically typed
Partially implement multiple inheritance Supports multiple inheritance
Lesser String ops More String ops
Uses braces for block of code Uses proper indentation
Has robust support for Multithreading and Less supportive for this.
Concurrency
Much faster Slower
Supports good DB connectivity Less support for DB connections
Used in many GUI and Web apps Used in Scientific and ML apps
Similarities:
Q. What is Python?
Python is an interpreted, high-level and OOP language that is dynamically typed and able to be used
in a wide range of apps. It supports dynamic binding and type casting.
It is simple and intuitive. Its syntax is similar to English language which makes it very easy to
understand. Various modules and packages allow modularity and code reuse.
Features:
Q. Disadvantages of Python.
Disadvantages:
1. Extremely weak in mobile computing, therefore not widely used in app dev.
2. It is interpreted language, that makes it slow.
3. It shows errors at runtime as it is dynamic and interpreted. It can result in loss of time for
running large chunks of code.
4. No commercial support
I have some experience in Android development. It basically involves creating mobile apps for
android devices. I am proficient in Java for android dev. I am also well versed in Android studio, IDE
for efficiently designing and developing android studio. I also have understanding about android
activity life cycle and data storage methods like Shared preferences. I also know about working with
APIs like Firebase in Android.
Machine learning is a branch of AI and CS which focuses on use of data and algorithms to imitate the
way humans learn. Primary goal of ML is to allow computers to identify patterns, make predictions,
or make data-driven decisions based on existing data. It is used in multiple applications like
recommendation systems, NLP, speech recognition, etc.
1. Supervised learning – Training on a labelled dataset. Algo learns to map i/p data to o/p labels
using examples in dataset. Suitable for classification and regression. e.g., DTs, SVMs, linear
regression, etc.
2. Unsupervised Learning – Training on unlabeled dataset. No output labels are provided. Algo
finds patterns or structures or relationships in the given data. Used in large, unstructured
datasets where humans are not able to find patterns easily, like customer segregation,
anomaly detection, etc. e.g., K-means clustering, hierarchical clustering, etc.
3. Reinforcement learning – In this, we focus on training agents to make decisions in an
environment to achieve a specific goal. It is inspired by behavioral psychology, where agent
learns by receiving feedback in form of rewards or penalties. Goal is to train agent to learn
best actions in diff situations to maximize rewards. Used in robotics, playing games, etc. e.g.,
Q-learning, Deep Q Networks.
Q. What is MySQL?
MySQL is an open-source relational DBMS that is widely used for managing and storing structured
data. It is popular for its reliability, scalability and ease of use. Features:
Stands for Relational Database Management System. It is a software system designed to manage and
store structured data in RDB. Data is organized in tables, and each table represents an entity, and
each row in the table represents specific instance of that entity.
Data is stored in rows and columns and relationships b/w tables are established using keys:
1. Primary Key – it is unique identifier for each record in a table. Ensures each row in a table is
uniquely identified. Cannot contain NULL.
2. Foreign Keys – It is a set of columns in a table that refers to the PK of another table. It
establishes a link or relationship b/w the data in two related tables. Can contain null.
3. Unique key – Constraint to not allow duplicates in a column or set of columns.
4. Composite key – Set of columns together act as a unique identifier.
5. Candidate key – Column that can be used as a primary key.
ACID properties ensure that DB transactions are reliable, consistent and maintain data integrity.
Widely used to ensure the correctness of DB operations and to guarantee that data remains in a valid
state, even in the event of a failure or concurrent access. Properties:
Can lead to performance overhead, in distributed and highly concurrent environments. In such
cases, some ACID properties might be relaxed like consistency or isolation to get better
performance.
Q. What are the difference between SQL and NoSQL based Databases?
SQL NoSQL
Relational DBMS Non-Relational DBMS
Has fixed or static schema Has Dynamic schema
Vertically Scalable Horizontally Scalable
Follow ACID (Atomicity, Consistency, Isolation, Follow CAP (Consistency, Availability, Partition
Durability) tolerance)
Suited for complex, well-defined data Suited for rapidly changing data requirements
Not suited for hierarchical data storage. Suited for hierarchical data storage.
Q. You have mentioned Efficient Net B5. Can you further elaborate on that?
Q. Why did you specifically chose Efficient Net B5, and why not B1, B3, B7?
Q. You mentioned about integration of DL model with android app. Would you like to tell how you
went about it?
Q. You achieved 84.36 % accuracy on test dataset. Don’t you think it is too less, specially for a
project like malware detection?
Q. Explain in detail about your third project? What was your role?
Q. What is DCGAN?
Q. What is a Captcha? And why do we need captchas? Where are they used?
Q. What was your role as R&D team Member at Cyber Warriors Club?
Q. Tell me more about POCSO Committee? And what was your role in that?
Q. Explain about the Cy-Hunt Competition in which you volunteered? What was your role?
Q. You organized ATL Tinkerfest. Would you like to tell me more about how you went about it’s
execution? What challenges did you face and how did you overcome those?
Q. You know German as well! Can you speak a few sentences to me about anything?
Technical Questions
Q. What is your favorite data structure? And why? … Be ready to tackle any question on that, incl
real-life examples.
Java
Java was dev by Sun Microsystem, and later acquired by Oracle Corporation.
It is a very popular programming language because it has lots of libraries built on top of it.
Feature of Java:
1. Object Oriented – Being OOP language, it offers a lot of imp features like Data Encapsulation,
Inheritance, Data Abstraction, etc. It makes Java suitable for real-world entities and sole real-
life problems.
2. Platform Independent – Compilation of code in Java is not specific to any platform but rather
happens in platform independent bytecode. Then, JVM interprets it.
3. Secure – It helps develop secure and tamper-free code using public key encryption. Even, the
concept of pointers is also not there, as security might be compromised by pointers.
4. Multithreaded – It can perform many tasks simultaneously.
5. High performance – It provides high performance with Just in Time (JIT) compilers by
compiling bytecode to native codes at runtime. It helps enhance the performance of Java.
6. Distributed – It works really well with distributed environments. I can create and manage
multiple distributed application simultaneously. Hence, the code can be saved on diff
machines and accessed at the same time.
7. Dynamic – It is designed to change acc to the way environment is modified.
Q. Disadvantages of Java?
Disadvantages:
Java is very popular because it has a great suite of high-level concurrency tools and packages that
make it possible to create highly scalable solutions. Also, java is a platform-independent and WORA
programming language.
Q. What are interfaces, abstract classes and classes? Difference between them with real life
examples.
1. Interfaces:
a. They are like blueprints of a class.
b. It can have static final variables and abstract methods.
c. Java 8 supports default and static method definition in interfaces.
d. Java 9 also supports private method definition in interfaces.
e. Allows loose coupling between classes.
f. It is a mechanism to achieve abstraction (100%) and multiple inheritance in Java.
g. Cannot be instantiated.
h. Code – `interface INTERFACE_NAME {…} `
2. Abstract Classes
a. Declared with an abstract keyword. Cannot be declared as final class.
b. It can have both abstract and non-abstract methods.
c. Concrete Methods and variables can be static, non-static, final, private, protected,
public, etc.
d. Abstract methods cannot be private, final, static.
e. Cannot be instantiated.
f. It can have concrete constructors also. Not abstract.
g. Code - `abstract class CLASS_NAME {int vars; void fn () {…}; abstract void fn2(); …} `
3. Classes
a. It is a blueprint for an object.
b. It encapsulates data members, methods, etc.
c. Enable abstraction by hiding implementation details, and exposing only relevant
functionalities.
d. Object are instances of classes, representing some real-world entity.
A final class in Java is a class that cannot be extended. It means, it must be a class complete by
nature.
All wrapper classes in java like String, Integer, etc. are final.
Final methods are those method in Java which cannot be changed or overridden once defined.
Hence, we cannot override a final method in a subclass.
It is a class in java which must only have once object instantiated at any point in time.
Steps to achieve:
Multi-threaded and DB apps use Singleton pattern for caching, logging, thread pooling, configuration
settings, Database connection management, etc.
Examples:
Static Final
Variables are associated with class, and not Variables are constant, and cannot be changed
objects. once a value is assigned.
Can be accessed using class name directly.
Methods are also related directly to class. Methods cannot be overridden by subclasses.
Cannot access object specific data.
Static code blocks run once when class is loaded Final class cannot be inherited by any other
into memory. class.
1. Java Development Kit (JDK) – it is a software development environment used for developing Java
applications. It includes JRE, Interpreter/loader, java compiler, java archiver, java documentation
generator and other tools needed in Java development.
2. Java Runtime Environment (JRE) – It provides the minimum requirements for executing a java
application. It consists of JVM, core classes and supporting files.
3. Java Virtual Machine (JVM) – Whatever Java program is run, JVM is responsible for executing the
java program line by line, hence it is also known as interpreter. It is instance of JRE at runtime of a
Java program. Widely aka Runtime interpreter. Responsible for Loading, Linking, Initialization.
Q. What is JIT?
Just-In-Time Compiler is important part of JRE. It is responsible for performance optimization of java
apps during runtime. JIT interacts with JVM at runtime and compile the suitable bytecode sequences
into native machine code. JIT Compiler aids in improving performance of Java programs by compiling
bytecode into native machine code at runtime.
Coupling refers to degree of direct knowledge that one element has of another, i.e., how often do
changes in class A force related changes in class B.
1. Tight Coupling: Two classes often change together. i.e., if A know more than it should about
the way B was implemented, then A and B are tightly coupled.
class Subject {
Topic t = new Topic();
public void startReading()
{
t.understand();
}
}
class Topic {
public void understand()
{
System.out.println("Tight coupling concept");
}
}
2. Loose Coupling: In this, they are mostly independent. Only knowledge class A has about B is
only through its interfaces.
If we want to add a new interface to interface, then its implementation code has to be provided in all
implementing classes. But we can just provide a default method which allows the interface to have
methods with implementation without affecting the classes that implement it.
Static methods are used to construct methods that will exist regardless of whether or not any
instances of classes are generated. It is part of class rather than the part of an instance of a class.
They can only access static variables.
1. Cloneable: indicates that it is legal for clone () method to make a field-for-field copy of
instances of that class.
2. Serializable: It makes an object eligible for saving its state into a file, aka serialize.
3. Remote: Makes an object eligible for remote object, and accessible by non-local machines.
It is way to handle runtime errors so that the regular flow of the application can be preserved.
Exception is an unwanted state or unexpected event, which occurs during the execution of a
program. They can be caught and handled by the program.
Errors are irrecoverable conditions such as JVM running out of memory, memory leaks, stack
overflow errors, library incompatibility, infinite recursion, etc. They are beyond the control of a
programmer.
Exceptions –
It is the process of automatic memory management. When java programs run on JVM, objects are
created on heap portion of program. When objects are no longer needed, garbage collector finds
these unused objects and deletes them to free up memory.
When?
It makes java memory-efficient because the garbage collector removes the unreferenced objects
from heap memory.
It is automatically done by the garbage collector(a part of JVM), so we don’t need extra effort.
1. Encapsulation
2. Inheritance
3. Polymorphism
4. Abstraction
5. All predefined types are objects
6. All user-defined types are objects
7. All operations performed on objects must be only through methods.
1. Primitive Datatypes are there in java which are not objects like int, char, boolean, byte, short,
long float, double, etc.
2. Static keyword – We can use methods of a static class without objects, which defies object
oriented.
3. Wrapper classes like Integer do convert primitives to objects, but still we can communicate
with objects without methods, like add, subtract, etc.
Basically -> we are using primitive data types like int, and while doing additions, we are still doing it
without methods.
Volatile - It is used to indicate that a variable’s value may be modified by multiple threads
simultaneously. It ensures that variable value is always read from and written to the main memory,
rather than thread specific caches, ensuring data consistency across threads. It guarantees that the
visibility of such variable is synchronized for all threads. But, do not guarantee operations atomicity.
Transient – It is a variable modifier used in serialization. If, at the time of serialization, we don’t want
to save the value of a variable, then we can use transient. JVM just considers its default value to be
stored in serialized form. It is used when we don’t want to save personal data or data which can be
calculated/derived using other serialized objects or mechanisms. It’s good to not store confidential
or unrequired data.
Static – such variables are not serialized as they are class specific.
Transient final – such variables data is stored whatever was declared initially and not default value.
Serialization is the process of converting the state of an object to a bytestream. Deserialization is the
reverse of serialization and converts bytestream back to the original object. For this, a class must
implement Serializable interface.
Q. What is Encapsulation?
Q. What is Abstraction?
Q. What is a destructor?
OPERATING SYSTEMS
Q. Explain term Operating System to a layman?
An OS acts as an intermediary b/w the user of a computer and the h/w. Its purpose is to provide an
environment in which a user can execute programs conveniently and efficient. It is a s/w that
manages the h/w. It is concerned with allocation of resources and services to programs.
To a layman, consider computer as a big house with many rooms and many different people. OS is
like the manager of the house who makes sure everything runs smoothly and all activities are
coordinated properly.
1. Manager schedules people living, OS schedules programs to run. It decides which program
gets to use the resources.
2. OS also takes care of security, making sure only certain programs or people get to access
certain parts of the house, ensuring personal information is kept safe.
3. Therefore, OS is like the manager of the house making sure, everything is organized. Secure
and runs smoothly so that you can use your computer effectively.
Functions:
1. Resource Management – Manages which process should get h/w, releasing and giving h/w
and other devices.
2. Process Management – Schedules and terminates processes with some algorithms.
3. Storage Management – Refers to management of file system on the hard disk. Eg file systems
are NTFS, ext4, FAT32, etc.
4. Memory Management – keep track of how much memory has been used and by whom.
Allocation and deallocation of memory space.
5. Security/Privacy Management – Uses passwords to prevent unauthorized apps from
accessing data. e.g., Windows uses Kerberos.
Inter process communication is the set of interfaces which is usually programmed in order for
programs to communicate between series of processes. This allows programs to run concurrently in
OS. Various Methods in IPC:
1. Pipes – it is a unidirectional communication channel, for IPC b/w two related processes. One
writes to the pipe, while other reads from it. Pipe is buffered.
2. Message Passing – Allows messages to be passed between processes using either a single or
multiple message queues. Can be one-to-one or one-to-many communication. Managed by
system kernel.
3. Shared Memory – Technique in which multiple processes can access the same region of the
memory. It allows high speed communication between processes.
4. Semaphores – They are integer values >= 0. Used for controlling access to shared resources.
To prevent multiple resources from accessing the same resource simultaneously. Basically,
used in situations associated with synchronization or to avoid race condition.
5. Socket – They are used to communicate between process running on different hosts. Provide
a standard interface for communication, independent of OS and language.
Posix: Shared memory; Mac: Message passing; Windows: Message passing w/ local procedural calls
Remote Procedural Calls – It is a technique for distributed computing. It allows processes running on
different hosts to call procedures on each other as if they were running on the same host.
Processes use mailbox (ports) for sending and receiving messages. Each mailbox has a unique id and
processes can communicate only if they share a mailbox. Can have many communication links
between processes, and multiple processes can use a single mailbox. Used in client-server
architecture, where server is receiver and many clients are senders.
In this, one process sends the message and keeps it in the mailbox, while other process receives it
from the mailbox. Can be direct communication or indirect communication – in direct, processes
must name the receiving process. In indirect, there is no such need, and a mailbox is used rather.
Send and receive can be blocking (synchronous) or non-blocking (asynchronous). Blocking send
means sender is blocked until the receiver receives the message. …!
Q. What is paging?
Q. What is a process?
Q. Questions on concurrency.
NETWORKING
Q. Explain in detail about what happens when you type www.google.com in your browser?
HR Questions
Q. Why do you want to join [COMPANY]?
Q. What other company interviews did you attend? Why did you fail to be selected?
Q. What was your most difficult obstacle in life and how did you overcome it? What preparations
did you made?
Other than this, [COMPANY]’s core values like customer satisfaction resonate with my values. I am
enthusiastic to join an organization which is at the forefront of innovation and is bringing positive
change in the industry. I believe that starting my journey at [COMPANY] will be a crucial step as I will
get to take on new challenges head on, develop myself and cater exponentially to company’s success.
Refer:
1. https://www.geeksforgeeks.org/object-oriented-
programming-oops-concept-in-java/
2. https://www.geeksforgeeks.org/oops-interview-
questions/
3. https://www.interviewbit.com/oops-interview-
questions/
4. https://www.interviewbit.com/operating-system-
interview-questions/
5. https://www.geeksforgeeks.org/top-20-puzzles-
commonly-asked-during-sde-interviews/
6. https://www.geeksforgeeks.org/operating-
systems-interview-questions/ (overkill)
7. https://www.interviewbit.com/dbms-interview-
questions/
8. https://www.geeksforgeeks.org/commonly-
asked-dbms-interview-questions/
9. https://www.geeksforgeeks.org/last-minute-
notes-operating-systems/
10.