Software Engineer II
90+ Software Engineer II Interview Questions and Answers
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 moreDivide 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 moreFind 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
Q3. What are interfaces and what is difference between an interface and abstract class
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 moreGiven 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
Q5. What is the difference between C++ and Objective C and where will you use it?
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
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 🌟
Q7. What is the difference between class container and class composition?
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
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
Q9. What was most challenging development and why you opted for customization over OOB feature of Salesforce. Lightning and sales cloud questions.
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. If I give you a coding problem to solve in the language you don’t know, can you solve it, when you’re allowed to refer Google search?
Yes, I can solve a coding problem in a language I don't know with Google search.
Utilize Google search to understand syntax and concepts in the unfamiliar language
Break down the problem into smaller parts and search for solutions to each part
Refer to online resources, forums, and documentation for guidance
Practice writing and testing code snippets in the new language before attempting the full solution
Q11. Run a program in any prefered language to perform few core programming tasks.
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
Q12. what is difference between stored procedure and function
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.
Q13. What are software development design patterns? Can you explain singleton design pattern and code an example to show that?
Software development design patterns are reusable solutions to common problems encountered in software design.
Design patterns help in creating maintainable, scalable, and efficient software.
Singleton design pattern ensures a class has only one instance and provides a global point of access to it.
Example: Implementing a singleton class in Java -
public class Singleton { private static Singleton instance; private Singleton() {} public static Singleton getInstance() { if(instance...read more
Q14. 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
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
Q15. what is difference between virtual and override keywords
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
Q16. 1. Difference between abstract and interface 2. OOPs concepts with examples 3. Solid principles 4. some Coding questions
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
Q17. How you can parse location and shop name from a card transaction string?
Use regex to extract location and shop name from transaction string.
Use regular expressions to match patterns for location and shop name.
Look for keywords like 'at', 'from', 'in' to identify location.
Consider variations in transaction strings and account for them in regex patterns.
Example: 'Spent $50 at Starbucks Coffee' -> Location: Starbucks Coffee, Shop Name: Starbucks Coffee
Q18. What kind of databases you’ve worked on? And explain what is DML!
I have worked on relational databases like MySQL and PostgreSQL. DML stands for Data Manipulation Language.
Worked on MySQL and PostgreSQL databases
Familiar with writing SQL queries for data manipulation
DML stands for Data Manipulation Language
Q19. Which interface used to prevent SQL injection
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.
Q20. How will you calculate the width of the tree?
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
Q21. What is Redux and use casses in class based as well as functional components with example?
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
Q22. ConcurrentModificationException. Vertical Scaling vs Horizontal Scaling. Roles and responsibilties in previous org. Strengths and weakness. Describe a situation where you became angry.
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
Q23. Program to find the second largest element from a 4-digit number, ex: input 1245 return 4
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
Q24. what are solid principles and explain them
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
Q25. 1. How is session authenticated in facebook and other websites when we login? 2. How to store large databases? Hashing related.
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
Q26. what is a singleton design pattern
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
Q27. SOLID design principles and Design Patterns use cases
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
Q28. Work experience in different segments and use cases of some custom implementations.
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
Q29. What is the width of a tree?
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.
Q30. Difference b/w UDP, TCP Linux commands Python basics in dict,tuple
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
Q31. does c# support multiple inheritence
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'.
Q32. how routing is performed in asp.net core api
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
Q33. What are the types of deployments?
Types of deployments include blue-green, canary, rolling, and immutable.
Blue-green deployment involves running two identical production environments and switching between them.
Canary deployment gradually rolls out changes to a small subset of users before deploying to the entire infrastructure.
Rolling deployment updates a few instances at a time, ensuring continuous availability.
Immutable deployment creates new instances for each update, avoiding in-place updates.
Q34. What is Blue Green Deployment ?
Blue Green Deployment is a software release strategy that reduces downtime and risk by running two identical production environments.
In Blue Green Deployment, one environment (blue) is live and serving production traffic while the other (green) is idle and ready to be switched to at any time.
This strategy allows for zero downtime deployments, as the switch between blue and green environments can be done seamlessly.
Blue Green Deployment also helps in quickly rolling back to th...read more
Q35. Java oops concept and example each type
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)
Q36. Why was CUPS introduced as part of Release-14?
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
Q37. how routing is done in mvc
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
Q38. Why string is imutable
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.
Q39. No user can claim more than once. You can over distribute but not under distribute
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
Q40. How to create a dictionary with list as key
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
Q41. What are the algorithms used for object detection
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
Q42. what is singleton design pattern
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
Q43. Implement stack that can do push, pop, getmin in O(1)
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
Q44. what are extension methods
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
Q45. What is api and why do we use it
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
Q46. 1. Binary Search tree and B+ trees difference
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
Q47. 1. Max Sum subarray 2. Detect loop in linked list
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.
Q48. what are filters in mvc
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.
Q49. Count occurence of element in an array
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
Q50. System design of snake and ladder
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
Top Interview Questions for Software Engineer II Related Skills
Interview experiences of popular companies
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
Reviews
Interviews
Salaries
Users/Month