Software Engineer II

90+ Software Engineer II Interview Questions and Answers

Updated 29 Nov 2024

Popular Companies

search-icon

Q1. There are fifteen horses and a racing track that can run five horses at a time. You have to figure out the top 3 horses out of those and you don't have any timer machine to measure. How will you find the top 3 ...

read more
Ans.

Divide the horses into groups of 5 and race them. Take the top 2 from each race and race them again. Finally, race the top 2 horses to determine the top 3.

  • Divide the horses into 3 groups of 5 and race them.

  • Take the top 2 horses from each race and race them again.

  • Finally, race the top 2 horses to determine the top 3.

Q2. Title: Minimum steps required to make the product of array equal to 1 Description: Given an array arr[] containing N integers. In one step, any element of the array can either be changed by +1,-1,0. Find the mi...

read more
Ans.

Find minimum steps to make product of array equal to 1 by changing elements by +1,-1,0.

  • Calculate number of negative elements and number of zeroes in array.

  • If number of negative elements is even, add 1 to all elements.

  • If number of negative elements is odd, add 1 to all elements except the smallest negative element.

  • Count the number of steps taken to modify the array elements.

  • Return the count of steps taken.

Software Engineer II Interview Questions and Answers for Freshers

illustration image

Q3. What are interfaces and what is difference between an interface and abstract class

Ans.

Interfaces define a contract for behavior, while abstract classes provide partial implementation.

  • Interfaces only define method signatures, while abstract classes can have both abstract and concrete methods.

  • A class can implement multiple interfaces, but can only inherit from one abstract class.

  • Interfaces are used for loose coupling and flexibility in design.

  • Abstract classes are used for code reuse and to enforce a common implementation among subclasses.

Q4. Title: Next Greater Element for every element in the array Description: Given an array arr[] containing N integers. Print the next greater element for every element. Example: Input: arr[] = {4,5,2,25} Output = ...

read more
Ans.

Given an array, print the next greater element for every element.

  • Iterate through the array from right to left

  • Use a stack to keep track of the greater elements

  • Pop elements from the stack until a greater element is found or the stack is empty

  • If a greater element is found, it is the next greater element for the current element

  • If the stack is empty, there is no greater element for the current element

  • Store the next greater element in a result array

  • Reverse the result array to get t...read more

Are these interview questions helpful?

Q5. What is the difference between C++ and Objective C and where will you use it?

Ans.

C++ is a general-purpose programming language while Objective C is a superset of C used for iOS and macOS development.

  • C++ is widely used for developing applications, games, and system software.

  • Objective C is primarily used for iOS and macOS development.

  • C++ supports both procedural and object-oriented programming paradigms.

  • Objective C is an object-oriented language with dynamic runtime features.

  • C++ has a larger standard library compared to Objective C.

  • Objective C uses a Smallt...read more

Q6. To find sum of even numbers from given arraylist using stream api

Ans.

Using stream API to find the sum of even numbers from an ArrayList

  • Convert the ArrayList to a stream using the stream() method

  • Filter the stream to keep only the even numbers using the filter() method

  • Use the mapToInt() method to convert the stream of even numbers to an IntStream

  • Finally, use the sum() method to calculate the sum of the even numbers

Share interview questions and help millions of jobseekers 🌟

man-with-laptop

Q7. What is the difference between class container and class composition?

Ans.

Class container is a class that holds objects of other classes, while class composition is a way to combine multiple classes to create a new class.

  • Class container holds objects of other classes, acting as a collection or container.

  • Class composition combines multiple classes to create a new class with its own behavior and attributes.

  • In class container, the objects are typically stored in a data structure like an array or a list.

  • In class composition, the classes are combined by...read more

Q8. What is a malloc function and where is it used and how is it different from new

Ans.

malloc is a function used in C programming to dynamically allocate memory. It is used in low-level programming and is different from new.

  • malloc is used to allocate memory on the heap in C programming.

  • It is used when the size of memory needed is not known at compile time.

  • malloc returns a void pointer to the allocated memory block.

  • Example: int* ptr = (int*) malloc(5 * sizeof(int));

  • new is used in C++ programming to dynamically allocate memory.

  • It is used with classes and objects ...read more

Software Engineer II Jobs

Software Engineer II - Python, Pyspark 2-6 years
JPMorgan Chase
4.1
Bangalore / Bengaluru
Software Engineer II 4-7 years
Electronic Arts
4.2
Hyderabad / Secunderabad
Software Engineer II 3-4 years
Electronic Arts
4.2
Hyderabad / Secunderabad

Q9. What was most challenging development and why you opted for customization over OOB feature of Salesforce. Lightning and sales cloud questions.

Ans.

Developing a custom solution for complex business processes in Sales Cloud

  • The business process required complex automation and customization

  • The OOB features of Sales Cloud were not sufficient to meet the requirements

  • Developed custom Lightning components and Apex code to automate the process

  • The solution was thoroughly tested and validated before deployment

Q10. Run a program in any prefered language to perform few core programming tasks.

Ans.

I would use Python to perform basic programming tasks such as sorting, searching, and manipulating data structures.

  • Use built-in functions like sorted() and filter() for sorting and filtering data

  • Use loops and conditional statements for searching and manipulating data structures

  • Use libraries like NumPy and Pandas for advanced data manipulation and analysis

Q11. what is difference between stored procedure and function

Ans.

Stored procedures are used to perform a set of actions, while functions return a single value.

  • Stored procedures are precompiled and stored in the database, while functions are compiled at runtime.

  • Functions can be used in SQL statements, while stored procedures cannot be used in SQL statements.

  • Functions can be called from within stored procedures, but stored procedures cannot be called from within functions.

Q12. Round 1 : DSA: 1)print all pairs with a target sum in an array (with frequency of elements). 2) Array to BST. 3) Top view of Binary Tree. 4) Minimum number of jumps to reach the end of an array

Ans.

DSA questions on array and binary tree manipulation

  • For printing pairs with target sum, use a hash table to store frequency of elements and check if complement exists

  • For converting array to BST, use binary search to find the middle element and recursively build left and right subtrees

  • For top view of binary tree, use a queue to traverse the tree level by level and store horizontal distance of nodes

  • For minimum number of jumps, use dynamic programming to find minimum jumps requir...read more

Q13. what is difference between virtual and override keywords

Ans.

Virtual keyword is used to declare a method in a base class that can be overridden in a derived class. Override keyword is used in the derived class to override the implementation of the virtual method.

  • Virtual keyword is used in the base class to declare a method that can be overridden in the derived class

  • Override keyword is used in the derived class to override the implementation of the virtual method

  • Virtual methods provide a way for a base class to define a default implemen...read more

Q14. 1. Difference between abstract and interface 2. OOPs concepts with examples 3. Solid principles 4. some Coding questions

Ans.

Interview questions for Software Engineer II

  • Abstract class is a class that cannot be instantiated and can have both abstract and non-abstract methods. Interface is a blueprint of a class that only has abstract methods.

  • OOPs concepts include inheritance, polymorphism, encapsulation, and abstraction. Example: Inheritance - a child class inheriting properties and methods from a parent class.

  • SOLID principles are Single Responsibility, Open-Closed, Liskov Substitution, Interface Se...read more

Q15. Which interface used to prevent SQL injection

Ans.

Prepared Statements interface is used to prevent SQL injection.

  • Prepared Statements interface is used to parameterize the SQL queries.

  • It allows the separation of SQL code and user input.

  • It helps to prevent SQL injection attacks by automatically escaping special characters.

  • Examples: PDO, mysqli, Java PreparedStatement, etc.

Q16. How will you calculate the width of the tree?

Ans.

The width of a tree can be calculated by finding the maximum number of nodes at any level.

  • Traverse the tree level by level using breadth-first search

  • Keep track of the maximum number of nodes at any level

  • Return the maximum number of nodes as the width of the tree

Q17. What is Redux and use casses in class based as well as functional components with example?

Ans.

Redux is a predictable state container for JavaScript apps.

  • Redux is used for managing the state of an application.

  • It is commonly used with React to manage the state of components.

  • Redux uses a single store to manage the state of an entire application.

  • Actions are dispatched to the store to update the state.

  • Reducers are used to update the state based on the dispatched actions.

  • Functional components can use the useSelector hook to access the state.

  • Class components can use the conn...read more

Q18. ConcurrentModificationException. Vertical Scaling vs Horizontal Scaling. Roles and responsibilties in previous org. Strengths and weakness. Describe a situation where you became angry.

Ans.

Questions on software engineering concepts, previous roles and responsibilities, and personal strengths and weaknesses.

  • ConcurrentModificationException: occurs when a collection is modified while being iterated over

  • Vertical Scaling vs Horizontal Scaling: vertical scaling involves adding more resources to a single machine, while horizontal scaling involves adding more machines to a system

  • Roles and responsibilities in previous org: discuss previous job titles and duties

  • Strengths...read more

Q19. Program to find the second largest element from a 4-digit number, ex: input 1245 return 4

Ans.

Program to find the second largest element from a 4-digit number

  • Convert the number to a string and split it into an array of characters

  • Sort the array in descending order

  • Return the second element of the array

Q20. what are solid principles and explain them

Ans.

SOLID principles are a set of five design principles for writing maintainable and scalable code.

  • Single Responsibility Principle (SRP) - a class should have only one reason to change

  • Open-Closed Principle (OCP) - a class should be open for extension but closed for modification

  • Liskov Substitution Principle (LSP) - subtypes should be substitutable for their base types

  • Interface Segregation Principle (ISP) - clients should not be forced to depend on interfaces they do not use

  • Depend...read more

Q21. 1. How is session authenticated in facebook and other websites when we login? 2. How to store large databases? Hashing related.

Ans.

Session authentication in websites and storing large databases using hashing.

  • Session authentication in websites involves creating a unique session ID for each user upon login and storing it in a cookie or server-side session storage.

  • The session ID is then used to authenticate subsequent requests from the user.

  • Large databases can be stored using hashing techniques such as sharding, consistent hashing, and hash tables.

  • Sharding involves dividing the database into smaller partiti...read more

Q22. what is a singleton design pattern

Ans.

Singleton design pattern restricts the instantiation of a class to a single instance and provides a global point of access to it.

  • Used when only one instance of a class is required throughout the system

  • Provides a global point of access to the instance

  • Implemented using a private constructor, static method, and static variable

  • Example: Logger class, Database connection class

Q23. SOLID design principles and Design Patterns use cases

Ans.

SOLID design principles and Design Patterns are used to create maintainable and scalable software.

  • SOLID principles help in creating loosely coupled and modular code.

  • Design Patterns provide reusable solutions to common software problems.

  • Examples of SOLID principles include Single Responsibility, Open/Closed, and Liskov Substitution.

  • Examples of Design Patterns include Factory, Singleton, and Observer.

  • Using SOLID principles and Design Patterns can improve code quality, reduce bu...read more

Q24. Work experience in different segments and use cases of some custom implementations.

Ans.

I have experience in implementing custom solutions across various segments and use cases.

  • Developed a custom CRM system for a retail company

  • Implemented a custom inventory management system for a manufacturing company

  • Created a custom payment gateway integration for an e-commerce website

  • Designed a custom data analytics solution for a healthcare organization

Q25. What is the width of a tree?

Ans.

The width of a tree refers to the maximum number of nodes at any level in the tree.

  • The width of a tree can be determined by traversing the tree level by level and counting the maximum number of nodes at any level.

  • The width of a tree can also be calculated using breadth-first search (BFS) algorithm.

  • The width of a tree is not related to the height or depth of the tree.

Q26. Difference b/w UDP, TCP Linux commands Python basics in dict,tuple

Ans.

UDP is connectionless, faster but less reliable. TCP is connection-oriented, slower but more reliable. Linux commands are used for system management. Python basics include dict and tuple data structures.

  • UDP is connectionless and does not guarantee delivery of data packets.

  • TCP is connection-oriented and ensures reliable delivery of data packets.

  • Linux commands like ls, cd, mkdir are used for system management.

  • Python dict is a key-value pair data structure, while tuple is an imm...read more

Q27. does c# support multiple inheritence

Ans.

No, C# does not support multiple inheritance.

  • C# only supports single inheritance, where a class can inherit from only one base class.

  • However, C# does support multiple interface inheritance, where a class can implement multiple interfaces.

  • This is achieved using the 'interface' keyword instead of 'class'.

Q28. how routing is performed in asp.net core api

Ans.

Routing in ASP.NET Core API is performed using the built-in middleware called Endpoint Routing.

  • Endpoint Routing is responsible for mapping incoming requests to the appropriate action methods in the controller.

  • It uses the HTTP verb, URL pattern, and route data to determine the correct action method.

  • Routes can be defined using attributes on the controller and action methods or in the Startup.cs file.

  • Middleware like authentication and authorization can be added to the routing pi...read more

Q29. Java oops concept and example each type

Ans.

Java OOPs concepts and examples

  • Encapsulation - hiding data and methods within a class (e.g. private variables)

  • Inheritance - creating new classes from existing ones (e.g. subclass extends superclass)

  • Polymorphism - using a single method to perform different actions (e.g. method overloading/overriding)

  • Abstraction - focusing on essential features and hiding implementation details (e.g. abstract classes/interfaces)

Q30. Why was CUPS introduced as part of Release-14?

Ans.

CUPS was introduced in Release-14 to provide a common printing system for Unix-like operating systems.

  • CUPS stands for Common Unix Printing System.

  • It was introduced to replace the traditional Unix printing system LPD.

  • CUPS provides a modular and extensible printing system that can support a variety of printers and print job formats.

  • It also includes a web-based administration interface for managing printers and print jobs.

  • CUPS has become the de facto standard printing system for...read more

Q31. how routing is done in mvc

Ans.

Routing in MVC is done through the use of routes, which map URLs to controller actions.

  • Routes are defined in the RouteConfig.cs file in the App_Start folder

  • Routes consist of a URL pattern and a corresponding controller action

  • Routes can also include optional parameters and constraints

  • Routing is done through the use of the ASP.NET routing engine

  • Routing can be customized by creating custom route handlers

Q32. No user can claim more than once. You can over distribute but not under distribute

Ans.

Ensure each user can only claim once, can distribute extra but not less

  • Implement a system to track claimed rewards by users

  • Set up validation to prevent users from claiming more than once

  • Consider implementing a queue system to distribute rewards fairly

  • Use a database to store user claims and track distribution

Q33. Why string is imutable

Ans.

String is immutable to ensure data integrity and thread safety.

  • Immutable strings prevent accidental modification of data.

  • Immutable strings allow for efficient memory allocation and sharing.

  • Immutable strings ensure thread safety by avoiding race conditions.

  • Examples of immutable string methods include substring, toLowerCase, and toUpperCase.

Q34. How to create a dictionary with list as key

Ans.

To create a dictionary with list as key, use tuple conversion

  • Convert the list to a tuple as lists are not hashable

  • Use the tuple as the key in the dictionary

  • Example: my_dict = {tuple(my_list): value}

  • Example: my_dict[tuple(my_list)] = value

Q35. What are the algorithms used for object detection

Ans.

Algorithms for object detection include YOLO, Faster R-CNN, SSD, and Mask R-CNN.

  • YOLO (You Only Look Once) is a real-time object detection algorithm that uses a single neural network to predict bounding boxes and class probabilities.

  • Faster R-CNN (Region-based Convolutional Neural Network) uses a two-stage approach to first propose regions of interest and then classify them.

  • SSD (Single Shot Detector) is a one-stage object detection algorithm that uses a single neural network to...read more

Q36. what is singleton design pattern

Ans.

Singleton design pattern restricts the instantiation of a class to a single instance and provides a global point of access to it.

  • Used when only one instance of a class is required throughout the system

  • Provides a global point of access to the instance

  • Implemented using a private constructor, static method, and static variable

  • Example: Logger class in Java

Q37. Implement stack that can do push, pop, getmin in O(1)

Ans.

Implement a stack with push, pop, and getmin operations in O(1) time complexity.

  • Use two stacks - one for storing the elements and the other for storing the minimum values

  • When pushing an element, check if it is smaller than the current minimum and push it to the minimum stack if it is

  • When popping an element, check if it is the current minimum and pop it from the minimum stack if it is

  • To get the minimum element, simply return the top element of the minimum stack

Q38. what are extension methods

Ans.

Extension methods are static methods that allow adding new functionality to existing types without modifying the original type.

  • Extension methods are defined in a static class.

  • They must be declared with the 'this' keyword before the first parameter.

  • They can be called as if they were instance methods of the extended type.

  • Extension methods can be used to add functionality to built-in types or custom types.

  • Example: adding a method to the string type to convert a string to title c...read more

Q39. What is api and why do we use it

Ans.

API is a set of protocols and tools for building software applications. It allows different applications to communicate with each other.

  • API stands for Application Programming Interface

  • It defines how different software components should interact with each other

  • APIs can be used to access data or functionality from other applications or services

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

Q40. 1. Binary Search tree and B+ trees difference

Ans.

Binary search trees are used for searching and sorting data, while B+ trees are used for indexing and storing data.

  • Binary search trees have a maximum of two children per node, while B+ trees have multiple children per node.

  • Binary search trees are best for small datasets, while B+ trees are better for large datasets.

  • Binary search trees have a faster search time, while B+ trees have a faster insertion and deletion time.

  • Binary search trees are used in databases for searching and...read more

Q41. 1. Max Sum subarray 2. Detect loop in linked list

Ans.

Two technical questions related to algorithms and data structures.

  • Max Sum subarray: Find the contiguous subarray with the largest sum. Kadane's algorithm is a popular solution.

  • Detect loop in linked list: Use two pointers, one moving at twice the speed of the other. If they meet, there is a loop.

Q42. what are filters in mvc

Ans.

Filters in MVC are used to intercept and modify HTTP requests and responses.

  • Filters can be used to implement authentication and authorization.

  • They can also be used for caching and logging.

  • Examples of filters include AuthorizationFilter, ActionFilter, and ExceptionFilter.

Q43. Design a system that distributes 6Million burgers in 10 min

Ans.

Utilize multiple distribution centers, automated assembly lines, and efficient transportation to distribute burgers quickly.

  • Set up multiple distribution centers in strategic locations to cover a wide area

  • Implement automated assembly lines to quickly prepare and package burgers

  • Utilize efficient transportation methods such as drones or high-speed delivery vehicles

  • Coordinate logistics and timing to ensure smooth and timely distribution

Q44. Take home assignment: Implement Custom Cron job parser

Ans.

Implement a custom cron job parser as a take-home assignment for Software Engineer II position.

  • Understand the cron syntax and how it works

  • Parse the cron expression into separate fields (minute, hour, day of month, month, day of week)

  • Implement logic to calculate the next execution time based on the current time and cron expression

  • Handle edge cases like leap years, different month lengths, etc.

  • Test your implementation with various cron expressions

Q45. Count occurence of element in an array

Ans.

Count occurrence of element in an array of strings

  • Use a loop to iterate through the array

  • Use a dictionary to store the count of each element

  • Increment the count for each element encountered

Q46. System design of snake and ladder

Ans.

System design for the game of Snake and Ladder

  • Create a board with 100 cells and mark the positions of snakes and ladders

  • Implement a player class with a current position on the board

  • Roll a dice to move the player and check for snakes and ladders

  • Keep track of player scores and winner at the end of the game

Q47. Some implementations in front end and backend.

Ans.

Implementations in front end and backend

  • Front end: React, Angular, Vue.js, HTML, CSS, JavaScript

  • Backend: Node.js, Python, Java, Ruby, PHP

  • Examples: Building a login page with React and Node.js, creating a REST API with Python and Flask

Q48. design of angular app with re-using components

Ans.

To design an Angular app with re-usable components, follow these pointers.

  • Identify common functionalities and create a separate component for each

  • Use input and output properties to pass data between components

  • Create a shared module to import and export commonly used components

  • Use lazy loading to load components only when needed

  • Use Angular CLI to generate components and modules

Q49. Explain oop concepts class, encapsulation etc

Ans.

OOP concepts include class, encapsulation, inheritance, and polymorphism.

  • Class is a blueprint for creating objects with shared properties and methods.

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

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

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

  • Example: A class 'Car' can have properties like 'make'...read more

Q50. rxjs operators and state management in ngrx

Ans.

RxJS operators are used for reactive programming and ngrx is a state management library for Angular applications.

  • RxJS operators are used to manipulate and transform data streams in a reactive way.

  • ngrx is a state management library for Angular applications that uses RxJS to manage state.

  • ngrx provides a store to manage application state and uses actions and reducers to update the store.

  • RxJS operators like map, filter, and switchMap can be used with ngrx to manipulate and transf...read more

1
2
Next
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories

Interview experiences of popular companies

3.7
 • 10k Interviews
3.6
 • 2.3k Interviews
3.7
 • 866 Interviews
3.9
 • 463 Interviews
4.1
 • 381 Interviews
3.9
 • 201 Interviews
4.2
 • 107 Interviews
View all

Calculate your in-hand salary

Confused about how your in-hand salary is calculated? Enter your annual salary (CTC) and get your in-hand salary

Software Engineer II Interview Questions
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
65 L+

Reviews

4 L+

Interviews

4 Cr+

Salaries

1 Cr+

Users/Month

Contribute to help millions
Get AmbitionBox app

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