Ninja

100+ Ninja Interview Questions and Answers

Updated 9 Jul 2025

Asked in TCS

1w ago

Q. Can an array store different types of elements?

Ans.

Yes, an array can store different elements of different data types.

  • Arrays can store elements of different data types such as strings, numbers, and booleans.

  • For example, an array can store ['apple', 5, true, 'banana']

  • However, it is not recommended to mix data types in an array as it can lead to confusion and errors.

Asked in TCS

2d ago

Q. Write a program using runtime polymorphism to find the area of a square, circle, and rectangle.

Ans.

Program using runtime polymorphism to find area of square, circle, and rectangle.

  • Create a base class 'Shape' with a virtual function 'calculateArea'.

  • Derive classes 'Square', 'Circle', and 'Rectangle' from 'Shape' class.

  • Override 'calculateArea' function in each derived class to calculate area of respective shape.

5d ago

Q. What is a Dictionary?

Ans.

A dictionary is a collection of words and their meanings.

  • It is used to look up the meaning of a word.

  • It can also include synonyms, antonyms, and pronunciation guides.

  • Examples include Merriam-Webster, Oxford English Dictionary, and Urban Dictionary.

Asked in TCS

1w ago

Q. What was your B.Tech project?

Ans.

I am an AI language model and do not have a Btech project.

    Are these interview questions helpful?

    Asked in TCS

    1w ago

    Q. What is the difference between Artificial Intelligence and Machine Learning?

    Ans.

    Artificial intelligence is the broader concept of machines being able to carry out tasks in a way that we would consider 'smart', while machine learning is a subset of AI that allows machines to learn from data without being explicitly programmed.

    • AI is the broader concept of machines simulating human intelligence, while machine learning is a subset of AI that focuses on the development of computer programs that can access data and use it to learn for themselves.

    • AI can be appl...read more

    Asked in TCS

    2w ago

    Q. Write a program in your favorite programming language to sum the natural numbers in consecutive order.

    Ans.

    This program calculates the sum of natural numbers in consecutive orders using a simple loop or formula.

    • Natural numbers start from 1 and go up to any positive integer.

    • The sum of the first n natural numbers can be calculated using the formula: n * (n + 1) / 2.

    • Alternatively, you can use a loop to iterate through numbers and accumulate the sum.

    • Example: For n = 5, the sum is 1 + 2 + 3 + 4 + 5 = 15.

    Ninja Jobs

    Akrotics Digital Solutions Pvt Ltd. logo
    Creative Ninja 0-3 years
    Akrotics Digital Solutions Pvt Ltd.
    5.0
    Mumbai
    Akrotics Digital Solutions Pvt Ltd. logo
    Creative Ninjas 0-2 years
    Akrotics Digital Solutions Pvt Ltd.
    5.0
    Mumbai

    Asked in TCS

    1w ago

    Q. What is method overloading and method overriding?

    Ans.

    Method overloading is when multiple methods have the same name but different parameters. Method overriding is when a subclass provides a specific implementation of a method that is already provided by its superclass.

    • Method overloading involves creating multiple methods in the same class with the same name but different parameters.

    • Method overriding occurs in a subclass that provides a specific implementation of a method that is already provided by its superclass.

    • Example of met...read more

    Asked in TCS

    2w ago

    Q. What is Encapsulation?

    Ans.

    Encapsulation is the process of hiding implementation details and exposing only necessary information.

    • Encapsulation is a fundamental concept in object-oriented programming.

    • It helps in achieving data abstraction and information hiding.

    • It allows for better control over the data and prevents unauthorized access.

    • For example, a class can have private variables and public methods to access them.

    • This way, the internal details of the class are hidden from the outside world.

    Share interview questions and help millions of jobseekers 🌟

    man-with-laptop

    Asked in TCS

    2w ago

    Q. What is polymorphism?

    Ans.

    Polymorphism is the ability of an object to take on many forms.

    • It allows objects of different classes to be treated as if they were objects of the same class.

    • It is achieved through method overriding and method overloading.

    • Example: A shape class can have different subclasses like circle, square, and triangle, each with their own implementation of the draw method.

    • Example: A method can take in different types of objects as parameters, as long as they share a common interface or ...read more

    Asked in TCS

    2w ago

    Q. Can foreign keys store null values?

    Ans.

    Yes, foreign keys can store null values.

    • A foreign key can be set to NULL if the corresponding record in the parent table is deleted or updated.

    • This can be useful in cases where the relationship between the tables is optional.

    • However, it is important to ensure that the foreign key constraint is properly defined to avoid data inconsistencies.

    Asked in Nielsen

    2w ago

    Q. What is pip in Python?

    Ans.

    pip is a package management system used to install and manage software packages written in Python.

    • pip is included by default with Python installations since Python 3.4.

    • It allows you to easily install, uninstall, and manage Python packages.

    • You can use pip to install packages from the Python Package Index (PyPI) or from other sources.

    • Example: 'pip install numpy' installs the numpy package.

    Asked in TCS

    2w ago

    Q. Write a program to sort an array in descending order using only one variable.

    Ans.

    Sort array in descending order using one variable

    • Initialize a variable to store the current maximum value

    • Iterate through the array and find the maximum value

    • Swap the maximum value with the current element in the array

    Asked in TCS

    5d ago

    Q. What makes MongoDB different from Relational DBMS?

    Ans.

    MongoDB is a NoSQL database that stores data in flexible, JSON-like documents, unlike the structured tables of relational databases.

    • Data Model: MongoDB uses a document-oriented model, allowing for nested data structures, while relational DBMS use tables with fixed schemas.

    • Scalability: MongoDB is designed for horizontal scaling, making it easier to distribute data across multiple servers compared to relational databases.

    • Schema Flexibility: MongoDB allows for dynamic schemas, e...read more

    Asked in TCS

    1w ago

    Q. Can you show me your Identity card?

    Ans.

    I do not have my Identity card with me at the moment.

    • I do not have my ID card on me right now.

    • I can provide other forms of identification if needed.

    • I can provide my driver's license or passport as alternative IDs.

    Asked in TCS

    1w ago

    Q. How will you provide a solution for the customer?

    Ans.

    We will provide customized solutions based on the customer's specific needs and requirements.

    • Listen carefully to the customer's concerns and requirements

    • Analyze the problem and identify the root cause

    • Provide a range of possible solutions and discuss the pros and cons of each

    • Recommend the best solution based on the customer's needs and budget

    • Implement the solution and provide ongoing support and maintenance

    Asked in Infosys

    2w ago

    Q. What is SDLC?

    Ans.

    SDLC stands for Software Development Life Cycle. It is a process used to design, develop, and test software applications.

    • SDLC is a structured approach to software development.

    • It consists of several phases including requirements gathering, design, coding, testing, and maintenance.

    • Each phase has specific activities and deliverables.

    • SDLC helps ensure that software is developed efficiently and meets the needs of users.

    • Examples of SDLC models include Waterfall, Agile, and DevOps.

    Asked in TCS

    2w ago

    Q. What is the difference between DDL and DML?

    Ans.

    DDL stands for Data Definition Language and is used to define the structure of database objects. DML stands for Data Manipulation Language and is used to manipulate data within the database.

    • DDL is used to create, modify, and delete database objects such as tables, indexes, and views.

    • DML is used to insert, update, delete, and retrieve data from database tables.

    • Examples of DDL statements include CREATE TABLE, ALTER TABLE, and DROP TABLE.

    • Examples of DML statements include INSERT...read more

    Asked in TCS

    6d ago

    Q. Differentiate between tuple and dictionary What is a list

    Ans.

    A list is a collection of ordered and changeable elements of any data type in Python.

    • Lists are created using square brackets []

    • Elements in a list are separated by commas

    • Lists can contain duplicates and elements of different data types

    4d ago

    Q. What is IOT?

    Ans.

    IOT stands for Internet of Things. It refers to the network of physical devices, vehicles, home appliances, and other items embedded with sensors, software, and connectivity.

    • IOT enables devices to communicate with each other and with humans over the internet.

    • It allows for remote monitoring and control of devices and systems.

    • Examples include smart homes, wearable technology, and industrial automation.

    • IOT has the potential to improve efficiency, reduce costs, and enhance safety...read more

    Asked in Globant

    2w ago

    Q. What is the difference between range and xrange?

    Ans.

    range and xrange are used to generate a sequence of numbers, but xrange is deprecated in Python 3.

    • range generates a list of numbers from start to end (exclusive)

    • xrange generates a sequence of numbers on-the-fly, saving memory

    • xrange is deprecated in Python 3, range is used instead

    Asked in TCS

    1w ago

    Q. What is your take on AI?

    Ans.

    AI has the potential to revolutionize industries by automating tasks, improving efficiency, and enabling new capabilities.

    • AI can automate repetitive tasks, freeing up time for more complex work.

    • AI can analyze large amounts of data quickly and accurately, leading to better decision-making.

    • AI can enable new capabilities such as natural language processing and image recognition.

    • AI has the potential to transform industries like healthcare, finance, and transportation.

    Asked in Team Engine

    2w ago

    Q. What is monkey patching?

    Ans.

    Monkey patching is a technique in programming where existing code is changed or extended at runtime.

    • Monkey patching involves modifying or adding new methods to existing classes or modules.

    • It is often used in dynamic languages like Python or Ruby to alter behavior without modifying the original source code.

    • Example: Adding a new method to a built-in class in Python to customize its functionality.

    Asked in TCS

    1w ago

    Q. What is the GIL in Python?

    Ans.

    GIL stands for Global Interpreter Lock in Python, which is a mutex that protects access to Python objects.

    • GIL is a mechanism used in CPython to ensure that only one thread executes Python bytecode at a time.

    • It can limit the performance of multi-threaded Python programs, as only one thread can execute Python code at a time.

    • GIL is specific to CPython and does not apply to other Python implementations like Jython or IronPython.

    Asked in TCS

    1w ago

    Q. What is an Operating System (OS)?

    Ans.

    OS stands for Operating System, which is a software that manages computer hardware and software resources.

    • OS acts as an interface between the user and the computer hardware.

    • It manages memory, processes, and input/output devices.

    • Examples of OS include Windows, macOS, Linux, and Android.

    • OS determines the type of software that can be run on a computer.

    • It provides security features to protect the system from malware and unauthorized access.

    Asked in TCS

    2w ago

    Q. Explain the difference between the OSI/ISO model and the TCP/IP model.

    Ans.

    OSI/ISO and TCP/IP models are both networking models, but differ in their layer structure and protocols used.

    • OSI/ISO has 7 layers while TCP/IP has 4 layers

    • OSI/ISO is a theoretical model while TCP/IP is a practical model

    • OSI/ISO uses protocols such as X.25 and ISDN while TCP/IP uses protocols such as HTTP and FTP

    • OSI/ISO is more complex and difficult to implement than TCP/IP

    Asked in TCS

    2w ago

    Q. What is cloud computing?

    Ans.

    Cloud computing is the delivery of computing services over the internet.

    • Cloud computing allows users to access data and applications from anywhere with an internet connection.

    • It eliminates the need for physical servers and hardware, reducing costs and increasing scalability.

    • Examples include Amazon Web Services, Microsoft Azure, and Google Cloud Platform.

    Asked in TCS

    2w ago

    Q. Features of Django Explain your final year project What is meta class What is transaction

    Ans.

    Django is a high-level Python web framework known for its simplicity and flexibility.

    • Django is known for its built-in features like authentication, URL routing, template engine, and ORM.

    • Final year project likely involved building a web application using Django.

    • Meta class in Django is used to define custom behavior for models, forms, and views.

    • Transactions in Django are used to ensure the atomicity of database operations.

    Asked in TCS

    2w ago

    Q. what is git and github, how to use it

    Ans.

    Git is a version control system that tracks changes in code, while GitHub is a platform for hosting and collaborating on Git repositories.

    • Git is a distributed version control system used to track changes in code.

    • GitHub is a web-based platform for hosting Git repositories and collaborating with others.

    • To use Git, you can initialize a repository, add files, commit changes, create branches, merge branches, and push changes to a remote repository.

    • GitHub provides features like pul...read more

    Asked in TCS

    5d ago

    Q. What is a singleton class?

    Ans.

    A singleton class is a class that can only have one instance created at a time.

    • Singleton classes are often used for logging, caching, database connections, and thread pools.

    • They have a private constructor to prevent multiple instances from being created.

    • They provide a global point of access to the instance.

    Asked in TCS

    1w ago

    Q. What is DBMS?

    Ans.

    DBMS stands for Database Management System. It is a software system that manages and organizes data in a database.

    • DBMS is used to create, modify, and delete databases and their objects.

    • It provides a way to store and retrieve data efficiently.

    • Examples of DBMS include MySQL, Oracle, and Microsoft SQL Server.

    Previous
    1
    2
    3
    4
    5
    6
    Next

    Interview Experiences of Popular Companies

    TCS Logo
    3.6
     • 11.1k Interviews
    TCS iON Logo
    3.8
     • 386 Interviews
    Nexus Logo
    4.5
     • 7 Interviews
    View all
    interview tips and stories logo
    Interview Tips & Stories
    Ace your next interview with expert advice and inspiring stories
    Ninja Interview Questions
    Share an Interview
    Stay ahead in your career. Get AmbitionBox app
    play-icon
    play-icon
    qr-code
    Trusted by over 1.5 Crore job seekers to find their right fit company
    80 L+

    Reviews

    10L+

    Interviews

    4 Cr+

    Salaries

    1.5 Cr+

    Users

    Contribute to help millions

    Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2025 Info Edge (India) Ltd.

    Follow Us
    • Youtube
    • Instagram
    • LinkedIn
    • Facebook
    • Twitter
    Profile Image
    Hello, Guest
    AmbitionBox Employee Choice Awards 2025
    Winners announced!
    awards-icon
    Contribute to help millions!
    Write a review
    Write a review
    Share interview
    Share interview
    Contribute salary
    Contribute salary
    Add office photos
    Add office photos
    Add office benefits
    Add office benefits