Add office photos
Engaged Employer

Capgemini

3.7
based on 41.3k Reviews
Video summary
Proud winner of ABECA 2024 - AmbitionBox Employee Choice Awards
Filter interviews by

100+ Maersk Interview Questions and Answers

Updated 15 Jan 2025
Popular Designations

Q1. In a dark room,there is a box of 18 white and 5 black gloves. You are allowed to pick one and then you are allowed to keep it and check it outside. How many turns do you need to take in order for you to find a...

read more
Ans.

You need to take 36 turns to find a perfect pair.

  • You need to pick 19 gloves to ensure a perfect pair.

  • The worst case scenario is picking 18 white gloves and then the 19th glove is black.

  • In that case, you need to pick 17 more gloves to find a black one and complete the pair.

View 522 more answers

Q2. How can you cut a rectangular cake in 8 symmetric pieces in three cuts?

Ans.

Cut the cake in half horizontally, then vertically, and finally cut each half diagonally.

  • Cut the cake horizontally through the middle.

  • Cut the cake vertically through the middle.

  • Cut each half diagonally from corner to corner.

  • Ensure each cut is made symmetrically to get 8 equal pieces.

  • Example: https://www.youtube.com/watch?v=ZdGmuCJzQFo

View 176 more answers

Q3. One question of sorting for a list of people belonging to different cities and states.

Ans.

Sort a list of people by their cities and states.

  • Use a sorting algorithm like quicksort or mergesort.

  • Create a custom comparator function that compares the city and state of each person.

  • If two people belong to the same city and state, sort them by their names.

  • Example: [{name: 'John', city: 'New York', state: 'NY'}, {name: 'Jane', city: 'Boston', state: 'MA'}]

  • Example output: [{name: 'Jane', city: 'Boston', state: 'MA'}, {name: 'John', city: 'New York', state: 'NY'}]

View 56 more answers

Q4. What are seven layers of networking?

Ans.

The seven layers of networking refer to the OSI model which defines how data is transmitted over a network.

  • The seven layers are: Physical, Data Link, Network, Transport, Session, Presentation, and Application.

  • Each layer has a specific function and communicates with the layers above and below it.

  • For example, the Physical layer deals with the physical transmission of data, while the Application layer deals with user interfaces and applications.

  • Understanding the OSI model is imp...read more

View 106 more answers
Discover Maersk interview dos and don'ts from real experiences

Q5. Missing Number Problem Statement

You are provided with an array named BINARYNUMS consisting of N unique strings. Each string represents an integer in binary, covering every integer from 0 to N except for one. Y...read more

Add your answer

Q6. Maximum Difference Problem Statement

Given an array ARR of N elements, your task is to determine the maximum difference between any two elements in ARR.

If the maximum difference is even, print EVEN. If the max...read more

Add your answer
Are these interview questions helpful?

Q7. Non-Decreasing Array Problem Statement

Given an integer array ARR of size N, determine if it can be transformed into a non-decreasing array by modifying at most one element.

An array is defined as non-decreasin...read more

Add your answer

Q8. Majority Element III Problem Statement

You are given an array ARR and an integer K. Your task is to find all the elements in ARR that occur more than or equal to N/K times, where N is the length of the array AR...read more

Add your answer
Share interview questions and help millions of jobseekers 🌟

Q9. Recall any question from the quantitative ability section of the test and explain how did you approach the problem

Ans.

The question was about finding the average of a set of numbers.

  • I approached the problem by first summing all the numbers in the set.

  • Then, I divided the sum by the total number of elements in the set to find the average.

  • I used a loop to iterate through the set and keep track of the sum and count of elements.

Add your answer

Q10. Do you know C language? If yes then write a program to print numbers from 1 to 10 excluding 5

Ans.

Yes, I know C language. Here's a program to print numbers from 1 to 10 excluding 5.

  • Use a loop to iterate from 1 to 10

  • Inside the loop, check if the current number is equal to 5

  • If it is not equal to 5, print the number

Add your answer

Q11. If create 10 rest api and deploy it on server and create same 10rest api using jar package then which one is lighter and faster?

Ans.

The REST API deployed on the server is lighter and faster than the one created using jar package.

  • REST API is designed to be lightweight and efficient.

  • JAR packages are typically larger and require more resources to run.

  • Deploying REST API on a server allows for better scalability and performance.

  • JAR packages may be useful for certain use cases, such as offline applications or embedded systems.

Add your answer
Q12. How can you print the number of records available in a table?
Add your answer

Q13. How many objects will create when string created using New keyword ?

Ans.

One object will be created when string created using New keyword.

  • When a string is created using the New keyword, only one object is created.

  • This object is stored in the heap memory.

  • The string object created using the New keyword is mutable.

  • The string object created using the New keyword can be modified.

  • The string object created using the New keyword is slower than the string literal.

Add your answer

Q14. Why Notify, wait, NotifyAll methods are part of Object class ?

Ans.

Notify, wait, NotifyAll methods are part of Object class for thread synchronization.

  • Object class is the root of all classes in Java.

  • These methods are used for inter-thread communication and synchronization.

  • Notify wakes up a single thread waiting on the object, while NotifyAll wakes up all threads.

  • Wait method causes the current thread to wait until another thread notifies it.

  • These methods are used in multi-threaded programming to avoid race conditions and deadlocks.

Add your answer

Q15. How to find duplicate Words from String ?

Ans.

To find duplicate words from a string, we can split the string into words and use a hash table to keep track of the frequency of each word.

  • Split the string into words using a delimiter like space or punctuation.

  • Create a hash table to store the frequency of each word.

  • Iterate through each word and check if it already exists in the hash table.

  • If it does, increment the frequency count. If not, add it to the hash table with a frequency of 1.

  • Return the list of words with a frequenc...read more

Add your answer

Q16. How Concurrent HashMap works Internally ?

Ans.

Concurrent HashMap allows multiple threads to access and modify the map concurrently.

  • It uses a technique called lock striping to divide the map into segments and apply locks to each segment.

  • Each segment can be accessed and modified independently by different threads.

  • It uses a combination of volatile and CAS (Compare-And-Swap) operations to ensure thread-safety.

  • It provides better performance than synchronized HashMap in multi-threaded environments.

  • Example: ConcurrentHashMap in...read more

Add your answer

Q17. What types of transformation used in your project What is lookup and what are the types So many basic questions regarding organization

Ans.

Answering questions about transformation and lookup types used in a project

  • Transformation types used in the project may include data mapping, aggregation, filtering, and sorting

  • Lookup is a process of searching for a specific value in a table or database

  • Types of lookup include exact match, range match, and fuzzy match

  • Questions about organization may refer to project management, team collaboration, or software development methodologies

Add your answer

Q18. Parents class of exception Explain project Which technology which are used in project Set and list Java 8 features Functional interface Default method Multiple threading How to create thread Which design patter...

read more
Ans.

The project utilizes Java 8 features, functional interfaces, default methods, multithreading, design patterns, and demonstrates implementation of a Singleton class.

  • Java 8 features include lambda expressions, streams, and optional class.

  • Functional interfaces are interfaces with a single abstract method, like Runnable or Callable.

  • Default methods allow interfaces to have method implementations.

  • Multithreading is achieved by creating and starting threads using the Thread class or ...read more

Add your answer

Q19. What is restfull web services with example

Ans.

RESTful web services are APIs that use HTTP requests to GET, PUT, POST and DELETE data.

  • REST stands for Representational State Transfer

  • It is an architectural style for building web services

  • Uses HTTP methods to access resources

  • Resources are identified by URIs

  • Example: GET http://example.com/api/users retrieves a list of users

Add your answer

Q20. Difference between HashMap and Concurrent HashMap ?

Ans.

HashMap is not thread-safe while Concurrent HashMap is thread-safe.

  • HashMap allows multiple threads to access and modify the map simultaneously, which can lead to data inconsistency and race conditions.

  • Concurrent HashMap uses a different locking mechanism to allow multiple threads to access and modify the map concurrently without causing data inconsistency.

  • Concurrent HashMap is slower than HashMap due to the overhead of the locking mechanism.

  • Concurrent HashMap is useful in sce...read more

Add your answer

Q21. What is the production deployment process do you follow

Ans.

Our production deployment process involves continuous integration, automated testing, and manual approval.

  • We use a continuous integration tool like Jenkins to build and test our code.

  • Automated tests are run on the code to ensure it meets quality standards.

  • Once the tests pass, the code is deployed to a staging environment for manual testing.

  • If the code passes manual testing, it is approved for deployment to production.

  • We use a deployment tool like Ansible to automate the deplo...read more

Add your answer

Q22. How many toothpastes are sold in one month in Hyderabad

Ans.

It is not possible to accurately determine the number of toothpastes sold in one month in Hyderabad without available data.

  • The number of toothpastes sold can vary depending on various factors such as population, consumer behavior, and market trends.

  • To estimate the number, data from toothpaste manufacturers, distributors, and retailers would be required.

  • Factors like brand popularity, pricing, and promotional activities can also influence sales.

  • Without specific data, it is impo...read more

Add your answer

Q23. What is string pooling in java

Ans.

String pooling is a mechanism in Java that allows multiple String objects with the same value to share the same memory.

  • String literals are automatically pooled by the JVM

  • String objects created using the String constructor are not pooled

  • String.intern() method can be used to add a String to the pool if it is not already present

  • String pooling can improve performance and reduce memory usage

View 1 answer

Q24. How many programming languages do you know

Ans.

I know multiple programming languages.

  • I am proficient in Java, Python, and C++.

  • I have experience with web development languages such as HTML, CSS, and JavaScript.

  • I am familiar with scripting languages like Bash and PowerShell.

  • I am always eager to learn new languages and technologies.

View 1 answer

Q25. Is springboot support microservices? How? Explain?

Ans.

Yes, Spring Boot supports microservices through its lightweight and modular architecture.

  • Spring Boot provides a variety of features that make it easy to develop and deploy microservices.

  • It offers a simple and flexible configuration model, which allows developers to quickly create and configure microservices.

  • Spring Boot also includes a number of libraries and tools that are specifically designed for building microservices, such as Spring Cloud and Netflix OSS.

  • These libraries p...read more

Add your answer

Q26. How is abstract method different from other method

Ans.

Abstract method is a method without implementation, must be overridden in subclass.

  • Abstract method has no implementation and must be overridden in subclass

  • Other methods have implementation and can be directly called

  • Abstract methods are declared using 'abstract' keyword

  • Example: abstract void draw();

Add your answer

Q27. Find the 5 records of High Salary employees in Table

Ans.

Query to find top 5 high salary employees from a table

  • Use SELECT statement to retrieve data from table

  • Use ORDER BY clause to sort the data in descending order of salary

  • Use LIMIT clause to limit the number of records to 5

Add your answer

Q28. What was your last sem project ? write code for fibonacci series write code for swapping two numbers

Ans.

I wrote code for Fibonacci series and swapping two numbers in my last semester project.

  • For Fibonacci series, I used a loop to generate the series up to a given number.

  • For swapping two numbers, I used a temporary variable to store one value while swapping the other.

  • Both codes were written in C++ language.

  • I also added error handling to ensure the input values were valid.

Add your answer

Q29. What is java class loader in java

Ans.

Java class loader is a part of Java Runtime Environment that loads classes dynamically at runtime.

  • Java class loader is responsible for loading Java classes into the JVM.

  • It searches for the class file in the classpath and loads it into memory.

  • There are three types of class loaders in Java: Bootstrap, Extension, and System class loader.

  • Custom class loaders can also be created to load classes from non-standard sources.

  • ClassLoader class is used to define custom class loaders in J...read more

Add your answer

Q30. How to write user defined exception in java

Ans.

How to write user defined exception in java

  • Create a class that extends Exception or any other subclass of Exception

  • Add constructors to the class to initialize the exception

  • Throw the exception using the 'throw' keyword

  • Catch the exception using try-catch block

  • Example: public class CustomException extends Exception { public CustomException(String message) { super(message); } }

  • Example usage: throw new CustomException("This is a custom exception message");

Add your answer

Q31. Difference between Static and Default method In Java 8

Ans.

Static methods are class-level methods while default methods are instance-level methods in Java 8.

  • Static methods can be called without creating an instance of the class.

  • Default methods are used to provide a default implementation for an interface method.

  • A class can have multiple static methods with the same name but different parameters.

  • An interface can have multiple default methods with the same name but must have different parameters.

  • Static methods cannot be overridden whil...read more

Add your answer

Q32. What is wrapper classes in java

Ans.

Wrapper classes in Java are classes that allow primitive data types to be used as objects.

  • Wrapper classes provide a way to convert primitive data types into objects.

  • They are used in situations where objects are required, such as in collections.

  • Examples of wrapper classes include Integer, Double, and Boolean.

  • Wrapper classes also provide useful methods for working with primitive data types.

  • They can be used to parse strings into primitive data types and vice versa.

Add your answer

Q33. Write a program to swap 2 number without using 3rd variable

Ans.

Swapping two numbers without using a third variable in a program.

  • Use bitwise XOR operation to swap two numbers without using a third variable.

  • Example: int a = 5, b = 10; a = a ^ b; b = a ^ b; a = a ^ b; // Now a = 10, b = 5

View 1 answer

Q34. Which programming language were used in your final year project

Ans.

The programming languages used in my final year project were Java and SQL.

  • Java was used for developing the front-end application

  • SQL was used for managing the database

Add your answer

Q35. Difference between Compiler and interpreter. What is DNS How web works

Ans.

Compiler translates source code to machine code while interpreter executes code line by line.

  • Compiler generates executable file while interpreter does not.

  • Compiler checks for errors before execution while interpreter checks during execution.

  • Examples of compilers are GCC, Clang while examples of interpreters are Python, Ruby.

  • DNS stands for Domain Name System and it translates domain names to IP addresses.

  • Web works by sending requests from client to server and receiving respons...read more

Add your answer

Q36. 1. Ac vs dc 2. Fibonacci series using recursion code in java 3. Project discussion of final year and 3rd year.

Ans.

The interview questions cover topics like AC vs DC, Fibonacci series using recursion in Java, and discussion of final year and 3rd year projects.

  • AC vs DC: Alternating Current (AC) changes direction periodically while Direct Current (DC) flows in one direction. Example: AC is used in household electricity, while DC is used in batteries.

  • Fibonacci series using recursion in Java: Recursively calculate Fibonacci numbers. Example code: public int fibonacci(int n) { return n <= 1 ? ...read more

Add your answer

Q37. Difference between Unique Key and Primary Key ?

Ans.

Unique key allows null values, primary key does not.

  • Primary key is a unique identifier for a record in a table.

  • Unique key allows null values, but primary key does not.

  • A table can have only one primary key, but multiple unique keys.

  • Primary key is automatically indexed, but unique key is not necessarily indexed.

Add your answer

Q38. What is web api, Get, put post, delete, Asp. Net Oops

Ans.

Web API is a framework for building HTTP services that can be accessed by various clients.

  • GET, PUT, POST, and DELETE are HTTP methods used to interact with Web APIs.

  • ASP.NET is a popular framework for building Web APIs.

  • Object-Oriented Programming (OOP) concepts are used in building Web APIs.

  • Examples of Web APIs include Twitter API, Google Maps API, and Facebook Graph API.

Add your answer

Q39. What are the new features in java 8

Ans.

Java 8 introduces lambda expressions, functional interfaces, streams, and default methods.

  • Lambda expressions allow functional programming in Java

  • Functional interfaces enable the use of lambda expressions

  • Streams provide a concise way to perform operations on collections

  • Default methods allow interfaces to have implementation

  • Date and Time API improvements

  • Nashorn JavaScript engine

View 1 answer

Q40. What is OOPs ?

Ans.

OOPs stands for Object-Oriented Programming. It is a programming paradigm that uses objects to represent real-world entities.

  • OOPs focuses on encapsulation, inheritance, and polymorphism.

  • Encapsulation is the process of hiding data and methods within a class.

  • Inheritance allows a class to inherit properties and methods from another class.

  • Polymorphism allows objects to take on multiple forms or behaviors.

  • Examples of OOPs languages include Java, C++, and Python.

View 1 answer

Q41. Differentiate linkedlist and arrayList working? Primarykey and unique key difference? Functional interface? Use? Program to find sum of target value 19 in given array?

Ans.

LinkedList and ArrayList differ in implementation, primary key uniquely identifies a record while unique key allows null values, functional interfaces are interfaces with a single abstract method.

  • LinkedList uses pointers to connect elements while ArrayList uses dynamic arrays

  • Primary key uniquely identifies a record in a database table, while unique key allows null values

  • Functional interfaces are interfaces with a single abstract method, used in lambda expressions and streams ...read more

Add your answer

Q42. Difference between hashmap and hashtable in java

Ans.

Hashmap and Hashtable are both used to store key-value pairs in Java, but there are some differences.

  • Hashtable is synchronized, while Hashmap is not.

  • Hashtable does not allow null keys or values, while Hashmap allows one null key and any number of null values.

  • Hashtable is slower than Hashmap due to synchronization.

  • Hashmap is generally preferred over Hashtable unless synchronization is needed.

Add your answer

Q43. What is a Class &amp; Object . Give me a real-world example.

Ans.

A class is a blueprint for creating objects in object-oriented programming. An object is an instance of a class.

  • A class defines the properties and behaviors of objects.

  • An object is a specific instance of a class.

  • Real-world example: Class - Car, Object - Toyota Camry.

Add your answer

Q44. Why are you expecting more than 20% hike?

Ans.

I have gained valuable experience and skills that justify a higher salary.

  • I have consistently exceeded performance expectations in my current role.

  • I have acquired new certifications or completed advanced training relevant to the position.

  • I have received offers from other companies with higher salary packages.

  • I have taken on additional responsibilities or leadership roles within my current organization.

Add your answer

Q45. List vs Set ? SOLID principles Functional Interface Monolithic vs Microservices

Ans.

List is an ordered collection that allows duplicate elements, while Set is an unordered collection that does not allow duplicates.

  • List maintains the insertion order of elements, while Set does not guarantee any specific order.

  • List allows duplicate elements, while Set does not allow duplicates.

  • Examples of List implementations in Java include ArrayList and LinkedList, while examples of Set implementations include HashSet and TreeSet.

Add your answer

Q46. what do u understand by pointers

Ans.

Pointers are variables that store memory addresses of other variables in programming languages.

  • Pointers allow direct access and manipulation of memory locations.

  • They are commonly used in programming languages like C and C++.

  • Pointers can be used to pass variables by reference, allowing modifications to the original value.

  • They can also be used to dynamically allocate memory.

  • Example: int* ptr; // declares a pointer to an integer variable.

Add your answer

Q47. Difference between Functions and Stored Procedure

Ans.

Functions return a value while Stored Procedures do not.

  • Functions are used to perform a specific task and return a value to the caller.

  • Stored Procedures are used to execute a set of statements and do not return a value.

  • Functions can be used in SELECT, WHERE, and HAVING clauses while Stored Procedures cannot.

  • Functions can be called from Stored Procedures while Stored Procedures cannot be called from Functions.

Add your answer

Q48. What is normalization needed in database

Ans.

Normalization is needed in database to eliminate data redundancy and improve data integrity.

  • Normalization helps in organizing data in a structured manner

  • It reduces data redundancy and improves data consistency

  • It helps in avoiding data anomalies and inconsistencies

  • Normalization is achieved through a series of steps called normal forms

  • Examples of normal forms include 1NF, 2NF, 3NF, BCNF, etc.

View 1 answer

Q49. What is java, difference between java and C

Ans.

Java is an object-oriented programming language. C is a procedural programming language.

  • Java is platform-independent while C is platform-dependent

  • Java has automatic memory management while C requires manual memory management

  • Java has built-in support for multithreading while C does not

  • Java has a larger standard library compared to C

  • Java is used for developing web applications, mobile applications, and enterprise software while C is used for system programming and embedded syst...read more

Add your answer

Q50. What is OOPs and explain all pillars of it.

Ans.

OOPs stands for Object-Oriented Programming and it has four pillars: Encapsulation, Inheritance, Polymorphism, and Abstraction.

  • Encapsulation: bundling of data and methods that operate on that data within a single unit (class).

  • Inheritance: ability of a class to inherit properties and characteristics from a parent class.

  • Polymorphism: ability of objects to take on multiple forms or have multiple behaviors.

  • Abstraction: hiding of complex implementation details and providing a simp...read more

Add your answer

Q51. Types of Bean scope in spring ?

Ans.

Bean scope in Spring refers to the lifecycle of a bean instance.

  • Singleton: Only one instance of the bean is created and shared across the application.

  • Prototype: A new instance of the bean is created every time it is requested.

  • Request: A new instance of the bean is created for every HTTP request.

  • Session: A new instance of the bean is created for every HTTP session.

  • Global session: A new instance of the bean is created for every global HTTP session.

  • Example: @Scope("prototype") p...read more

Add your answer

Q52. How will u achieve polymorphism in python?

Ans.

Polymorphism in Python can be achieved through method overriding and method overloading.

  • Method overriding is when a subclass provides a different implementation of a method that is already defined in its superclass.

  • Method overloading is when multiple methods have the same name but different parameters.

  • Python supports method overriding but not method overloading as it is dynamically typed.

  • Polymorphism allows objects of different classes to be treated as if they are of the same...read more

Add your answer

Q53. Differentiate between DROP, DELETE, And TRUNCATE Command.

Ans.

DROP, DELETE, and TRUNCATE are SQL commands used to remove data from a table.

  • DROP command removes the entire table along with its structure

  • DELETE command removes specific rows from the table

  • TRUNCATE command removes all the rows from the table but keeps the structure intact

  • DROP and TRUNCATE cannot be rolled back, while DELETE can be rolled back if used with a transaction

Add your answer

Q54. What is the OOPS concept in Java?

Ans.

OOPS (Object-Oriented Programming) concept in Java is a programming paradigm based on the concept of objects.

  • OOPS allows for the creation of classes and objects, encapsulation, inheritance, and polymorphism.

  • Classes are templates for creating objects, which are instances of classes.

  • Encapsulation is the bundling of data and methods that operate on the data into a single unit.

  • Inheritance allows a class to inherit properties and behavior from another class.

  • Polymorphism allows obj...read more

Add your answer

Q55. what is the diffrence between java &amp; C

Ans.

Java is an object-oriented language while C is a procedural language.

  • Java is platform-independent while C is platform-dependent.

  • Java has automatic garbage collection while C requires manual memory management.

  • Java has built-in support for multithreading while C requires external libraries.

  • Java has a larger standard library compared to C.

  • Java is more secure than C due to its strong type checking and exception handling.

  • C is faster than Java in terms of execution speed.

  • C is commo...read more

Add your answer

Q56. what is polymorphism and it's types

Ans.

Polymorphism is the ability of a single function or method to operate on different data types.

  • Polymorphism allows objects of different classes to be treated as objects of a common superclass.

  • Types of polymorphism include compile-time (method overloading) and runtime (method overriding) polymorphism.

  • Example of compile-time polymorphism: function overloading in Java.

  • Example of runtime polymorphism: method overriding in Java.

Add your answer

Q57. How java and python are different

Ans.

Java is statically typed, compiled language while Python is dynamically typed, interpreted language.

  • Java is statically typed, meaning variable types are explicitly declared, while Python is dynamically typed, where variable types are determined at runtime.

  • Java code needs to be compiled before execution, while Python code is interpreted line by line.

  • Java is more verbose and requires more code to accomplish tasks compared to Python.

  • Java is commonly used for building enterprise-...read more

Add your answer

Q58. Scope of access specifier in java

Ans.

Access specifiers in Java control the visibility of class members.

  • There are four access specifiers in Java: public, private, protected, and default.

  • Public members are accessible from anywhere, private members are only accessible within the same class, protected members are accessible within the same package and subclasses, and default members are accessible within the same package.

  • Access specifiers are used to enforce encapsulation and prevent unauthorized access to class mem...read more

Add your answer

Q59. diff between list and tuple ,sql queries,normalization

Ans.

List and tuple are both data structures in Python, with list being mutable and tuple being immutable. SQL queries are used to retrieve data from databases, and normalization is the process of organizing data in a database to reduce redundancy.

  • List is mutable, tuple is immutable

  • List uses square brackets [], tuple uses parentheses ()

  • SQL queries are used to retrieve data from databases

  • Normalization is the process of organizing data in a database to reduce redundancy

Add your answer

Q60. What is OOPS? and What is Java?

Ans.

OOPS stands for Object-Oriented Programming System. Java is a high-level programming language known for its simplicity and versatility.

  • OOPS is a programming paradigm based on the concept of objects, which can contain data in the form of fields and code in the form of procedures.

  • Java is a class-based, object-oriented language that is designed to have as few implementation dependencies as possible.

  • In Java, everything is an object except primitive data types like int, float, etc...read more

Add your answer

Q61. What is Linked List and its type?

Ans.

A Linked List is a linear data structure where elements are stored in nodes with each node pointing to the next node in the sequence.

  • Types of Linked Lists include Singly Linked List, Doubly Linked List, and Circular Linked List.

  • In a Singly Linked List, each node points to the next node in the sequence.

  • In a Doubly Linked List, each node points to both the next and previous nodes in the sequence.

  • In a Circular Linked List, the last node points back to the first node, forming a c...read more

Add your answer

Q62. What is jvm ,jre,jdk

Ans.

JVM is a virtual machine that executes Java bytecode. JRE is a runtime environment that includes JVM and libraries. JDK is a development kit that includes JRE and tools for developing Java applications.

  • JVM stands for Java Virtual Machine

  • JRE stands for Java Runtime Environment

  • JDK stands for Java Development Kit

  • JVM executes Java bytecode

  • JRE includes JVM and libraries

  • JDK includes JRE and tools for developing Java applications

Add your answer

Q63. What are opp concepts

Ans.

OOP concepts refer to the principles of Object-Oriented Programming that help in designing and implementing software systems.

  • Encapsulation - bundling of data and methods that operate on that data

  • Inheritance - creating new classes from existing ones

  • Polymorphism - ability of objects to take on many forms

  • Abstraction - hiding implementation details and showing only functionality

  • Examples: Java, C++, Python

Add your answer

Q64. What is microservices?

Ans.

Microservices is an architectural style where an application is composed of small, independent services that communicate with each other.

  • Microservices are independently deployable and scalable.

  • Each microservice performs a single business capability.

  • Communication between microservices is usually through APIs.

  • Microservices can be developed using different programming languages and technologies.

  • Examples of companies using microservices include Netflix, Amazon, and Uber.

Add your answer

Q65. Organised any event in college?

Ans.

Yes, I organized multiple events in college.

  • Organized a tech fest in college with a team of 20 members

  • Managed logistics, sponsorships, and marketing for the event

  • Coordinated with various departments and student clubs for participation and support

Add your answer

Q66. Different types of SDLC.

Ans.

SDLC stands for Software Development Life Cycle. There are different types of SDLC models.

  • Waterfall model

  • Agile model

  • Spiral model

  • V-shaped model

  • Iterative model

Add your answer

Q67. What is process, threads.

Ans.

Processes are instances of a program running on a computer, while threads are smaller units within a process that can execute independently.

  • Processes are independent entities that contain their own memory space and resources.

  • Threads are lightweight units of execution within a process, sharing the same memory space and resources.

  • Processes have their own address space, while threads within the same process share the address space.

  • Processes communicate with each other through in...read more

Add your answer

Q68. What are different pointers

Ans.

Pointers are variables that store memory addresses of other variables in programming languages like C and C++.

  • Pointers are used to store memory addresses of variables.

  • Pointers can be dereferenced to access the value stored at the memory address.

  • Pointers can be used for dynamic memory allocation and deallocation.

  • Pointers are denoted by an asterisk (*) in C and C++.

  • Example: int *ptr; // declaring a pointer to an integer variable

Add your answer

Q69. What is marker and random access

Ans.

Marker and random access are methods used to access data in a data structure.

  • Marker access involves moving through data sequentially, like reading a book from start to finish.

  • Random access allows direct access to any element in the data structure, like jumping to a specific page in a book.

Add your answer

Q70. what is python and python interpreter

Ans.

Python is a high-level, interpreted programming language used for web development, data analysis, and artificial intelligence.

  • Python is easy to learn and has a simple syntax.

  • It supports multiple programming paradigms like object-oriented, functional, and procedural.

  • Python interpreter is a program that executes Python code.

  • It converts the code into bytecode and then runs it on the machine.

  • Python interpreter can be used in interactive mode or script mode.

  • Examples of popular Pyt...read more

Add your answer

Q71. What is the use of spring boot

Ans.

Spring Boot is a framework for building standalone, production-grade Spring-based applications.

  • Spring Boot simplifies the process of creating and deploying Spring-based applications.

  • It provides a pre-configured environment with a set of opinionated defaults.

  • It includes embedded servers like Tomcat, Jetty, and Undertow.

  • It supports a wide range of data sources and data access technologies.

  • It enables easy integration with other Spring projects like Spring Data, Spring Security, ...read more

Add your answer

Q72. what is oops dbms and sql query

Ans.

OOPs (Object-Oriented Programming) is a programming paradigm based on the concept of objects, DBMS (Database Management System) is software for managing databases, and SQL (Structured Query Language) is a language used to communicate with databases.

  • OOPs focuses on creating objects that contain data and methods to manipulate that data.

  • DBMS is a software system that allows users to interact with a database, storing and retrieving data efficiently.

  • SQL is a language used to query...read more

Add your answer

Q73. flowchart for the two program

Ans.

Flowchart for two programs

  • Identify inputs and outputs

  • Determine program logic

  • Create decision points and loops

  • Connect program components

  • Include error handling

  • Test and debug

  • Document the flowchart

Add your answer

Q74. Explain the oops concept in java with examples

Ans.

Object-oriented programming (OOP) is a programming paradigm that uses objects to represent and manipulate data.

  • OOP is based on the principles of encapsulation, inheritance, and polymorphism.

  • Encapsulation allows data hiding and protects data from being accessed directly.

  • Inheritance enables the creation of new classes by inheriting properties and behaviors from existing classes.

  • Polymorphism allows objects of different classes to be treated as objects of a common superclass.

  • Java...read more

Add your answer

Q75. Four principles of Object Oriented Programming

Ans.

Encapsulation, Inheritance, Polymorphism, Abstraction

  • Encapsulation: Bundling data and methods that operate on the data into a single unit

  • Inheritance: Ability of a class to inherit properties and behavior from another class

  • Polymorphism: Ability to present the same interface for different data types

  • Abstraction: Hiding the complex implementation details and showing only the necessary features

Add your answer

Q76. Java code to swap without using temp

Ans.

Swapping two numbers without using a temporary variable in Java

  • Use XOR operation to swap two numbers without using a temporary variable

  • Example: a = 5, b = 10; a = a ^ b; b = a ^ b; a = a ^ b; // Now a = 10, b = 5

Add your answer

Q77. Differentiate between Primary Key and Unique key.

Ans.

Primary key uniquely identifies a record in a table, while unique key ensures that all values in a column are distinct.

  • Primary key can't have null values, while unique key can have one null value.

  • A table can have only one primary key, but multiple unique keys.

  • Primary key is used as a foreign key in other tables, while unique key is not.

  • Example: Employee ID can be a primary key, while Email ID can be a unique key.

Add your answer

Q78. difference between for and while loop

Ans.

For loop is used for iterating over a sequence while while loop is used for iterating until a condition is met.

  • For loop is used when the number of iterations is known beforehand

  • While loop is used when the number of iterations is not known beforehand

  • For loop is faster than while loop for iterating over a sequence

  • While loop is useful for infinite loops or until a specific condition is met

Add your answer

Q79. What is JDK &amp; JRE in Java

Ans.

JDK stands for Java Development Kit, which is a software development kit used for developing Java applications. JRE stands for Java Runtime Environment, which is used to run Java applications.

  • JDK includes JRE, compiler, debugger, and other tools for developing Java applications

  • JRE includes JVM and libraries required to run Java applications

  • JDK is needed for developing Java applications, while JRE is needed for running Java applications

  • Example: JDK 8 includes JRE 8, Java compi...read more

Add your answer

Q80. Is pointer are used in Java

Ans.

No, Java does not have pointers like C or C++.

  • Java has references which are similar to pointers but with added safety features.

  • References cannot be manipulated like pointers.

  • Java uses garbage collection to automatically manage memory.

  • Example: String str = "Hello"; creates a reference to a String object.

  • Example: int[] arr = new int[5]; creates a reference to an array object.

Add your answer

Q81. Write any program

Ans.

A program to calculate the factorial of a number.

  • Take input from user

  • Use a loop to calculate the factorial

  • Print the result

Add your answer

Q82. What are OOPS concepts

Ans.

OOPS concepts refer to Object-Oriented Programming concepts which include inheritance, encapsulation, polymorphism, and abstraction.

  • Inheritance: Allows a class to inherit properties and behavior from another class.

  • Encapsulation: Bundling data and methods that operate on the data into a single unit.

  • Polymorphism: Ability to present the same interface for different data types.

  • Abstraction: Hiding the complex implementation details and showing only the necessary features.

Add your answer

Q83. what are delete, truncate?

Ans.

Delete and truncate are SQL commands used to remove data from a table.

  • DELETE is a DML command used to remove specific rows from a table based on a condition.

  • TRUNCATE is a DDL command used to remove all rows from a table, resetting auto-increment values.

  • DELETE is slower as it logs individual row deletions, while TRUNCATE is faster as it deallocates data pages.

  • Example: DELETE FROM table_name WHERE condition;

  • Example: TRUNCATE TABLE table_name;

Add your answer

Q84. What is Linked List? Data Structure?

Ans.

A Linked List is a linear data structure where each element is a separate object with a pointer to the next element.

  • Consists of nodes that contain data and a pointer to the next node

  • Can be singly or doubly linked

  • Used for dynamic memory allocation, implementing stacks and queues, and in hash tables

  • Example: Singly linked list - 1 -> 2 -> 3 -> null

  • Example: Doubly linked list - null <- 1 <-> 2 <-> 3 -> null

Add your answer

Q85. if,else,break,switch statements

Ans.

Control flow statements in programming for decision making and looping

  • if statement is used for conditional execution

  • else statement is used with if to execute code when the condition is false

  • break statement is used to exit a loop or switch statement

  • switch statement is used to select one of many code blocks to be executed

Add your answer

Q86. Any extra circular activities.

Ans.

Yes, I enjoy playing basketball and volunteering at a local coding club.

  • I play basketball twice a week with a local league.

  • I volunteer at a coding club for kids on weekends.

  • I also participate in hackathons and attend tech meetups.

Add your answer

Q87. Life cycle of spring mvc?

Ans.

Spring MVC life cycle involves several phases from initialization to destruction of the application.

  • Initialization of DispatcherServlet

  • Processing of client request

  • Handling of request by Controller

  • View resolution and rendering

  • Sending response to client

  • Destruction of DispatcherServlet

Add your answer

Q88. Write pseudocode of Basic DSA question

Ans.

Pseudocode for a basic DSA question

  • Start by defining the problem statement and input/output requirements

  • Identify the key data structures and algorithms needed to solve the problem

  • Write step-by-step instructions in pseudocode to solve the problem

  • Test the pseudocode with sample inputs to ensure correctness

Add your answer

Q89. Diff between .net core and framewrok?

Ans.

The main difference between .NET Core and .NET Framework is that .NET Core is cross-platform and open-source, while .NET Framework is Windows-only and closed-source.

  • NET Core is cross-platform, meaning it can run on Windows, macOS, and Linux, while .NET Framework is limited to Windows.

  • .NET Core is open-source, allowing for community contributions and transparency, while .NET Framework is closed-source.

  • .NET Core is modular, allowing developers to include only the necessary comp...read more

Add your answer

Q90. Write a SQL query for 3rd highest salary

Ans.

SQL query to find the 3rd highest salary in a table

  • Use the ORDER BY clause to sort the salaries in descending order

  • Use the LIMIT and OFFSET keywords to skip the first two highest salaries

  • Example: SELECT salary FROM employees ORDER BY salary DESC LIMIT 1 OFFSET 2

Add your answer

Q91. What is collections

Ans.

Collections are data structures that store and manipulate groups of objects.

  • Collections provide a way to organize and manage large amounts of data

  • They can be used to perform operations on groups of objects, such as sorting or searching

  • Examples of collections include arrays, lists, sets, and maps

Add your answer

Q92. What is encapsulation?

Ans.

Encapsulation is the concept of bundling data and methods that operate on the data into a single unit.

  • Encapsulation helps in hiding the internal state of an object and restricting access to it.

  • It allows for better control over the data by preventing outside interference.

  • Encapsulation also promotes code reusability and modularity.

  • Example: In object-oriented programming, a class encapsulates data (attributes) and methods (functions) that operate on that data.

Add your answer

Q93. What is java ? Oops conspect What is c

Ans.

Java is a high-level, object-oriented programming language used to develop applications for various platforms.

  • Java is platform-independent, meaning it can run on any platform with a Java Virtual Machine (JVM)

  • It is known for its security features and automatic memory management

  • Java is used to develop a wide range of applications, from mobile apps to enterprise-level software

  • Some popular Java frameworks include Spring, Hibernate, and Struts

Add your answer

Q94. Oops concepts, explain your projects

Ans.

I have a strong understanding of OOP concepts and have worked on various projects utilizing them.

  • I have implemented inheritance, encapsulation, and polymorphism in my projects.

  • For example, in a project for a banking system, I used inheritance to create different types of accounts with common functionalities.

  • I have also used encapsulation to hide the implementation details of certain classes from other classes.

  • In a project for a car rental system, I used polymorphism to allow ...read more

Add your answer

Q95. What is JPA

Ans.

JPA stands for Java Persistence API, a specification for object-relational mapping in Java applications.

  • JPA is used to map Java objects to relational database tables.

  • It provides a set of annotations to define the mapping between Java classes and database tables.

  • JPA also supports querying data using the Java Persistence Query Language (JPQL).

Add your answer

Q96. Code flow for the MVC architecture

Ans.

MVC architecture separates application into Model, View, and Controller components for efficient code flow.

  • Model represents data and business logic

  • View displays the data to the user

  • Controller handles user input and updates the model and view accordingly

Add your answer

Q97. Print Fibonacci series upto n terms

Ans.

Print Fibonacci series upto n terms using iterative approach

  • Initialize variables for first two terms of Fibonacci series

  • Use a loop to calculate and print the next term based on previous two terms

  • Continue the loop until n terms are printed

Add your answer

Q98. String difference between equals and ==

Ans.

Equals compares the content of two strings, while == compares their references.

  • Equals method checks if two strings have the same content.

  • == operator checks if two strings refer to the same object in memory.

  • Equals method is case-sensitive by default, but can be made case-insensitive.

  • Example: String str1 = "hello"; String str2 = "hello"; str1.equals(str2) returns true, str1 == str2 returns true because of string interning.

  • Example: String str1 = new String("hello"); String str2 ...read more

Add your answer

Q99. What is multi-threading

Ans.

Multi-threading is the ability of a CPU to execute multiple threads concurrently, allowing for parallel processing.

  • Allows for parallel execution of multiple tasks

  • Improves performance by utilizing CPU resources efficiently

  • Requires synchronization to prevent data corruption

  • Examples: running multiple tasks simultaneously in a web server, video editing software

Add your answer

Q100. What is slicing in python

Ans.

Slicing in Python is a way to extract a subset of elements from a list, tuple, or string.

  • Slicing is done using square brackets and specifying start, stop, and step values.

  • The syntax for slicing is myList[start:stop:step].

  • Slicing can be used to extract a range of elements or every nth element from a sequence.

Add your answer
1
2
Contribute & help others!
Write a review
Share interview
Contribute salary
Add office photos

Interview Process at Maersk

based on 222 interviews
6 Interview rounds
Technical Round - 1
Technical Round - 2
Technical Round - 3
HR Round
Personal Interview1 Round - 1
Personal Interview1 Round - 2
View more
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories

Top Software Engineer Interview Questions from Similar Companies

3.3
 • 79 Interview Questions
3.4
 • 17 Interview Questions
4.0
 • 14 Interview Questions
4.1
 • 11 Interview Questions
View all
Share an Interview
Stay ahead in your career. Get AmbitionBox app
qr-code
Helping over 1 Crore job seekers every month in choosing their right fit company
70 Lakh+

Reviews

5 Lakh+

Interviews

4 Crore+

Salaries

1 Cr+

Users/Month

Contribute to help millions

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

Follow us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter