Software Engineer2
100+ Software Engineer2 Interview Questions and Answers
Q1. - Given a water -tight orientable 2-manifold, how to find if a point is inside or outside its volume? - Given a bunch of points with their coordinates, how to merge closeby points together? - How to determine i...
read moreAnswering technical questions for Software Engineer 2 position
To determine if a point is inside or outside a 2-manifold, use the ray casting algorithm
To merge closeby points, use clustering algorithms like k-means or DBSCAN
To determine if the normals of two triangles are wrongly oriented, use the cross product of their edges
Favorite research paper and why
Q2. Design a Order and Cart Page in iOS. The user should be able to order an item, see it in cart, the limit of each item is set to 1. Show the various classes, network requests, APIs, information flow, etc. No Aut...
read moreDesign an Order and Cart Page in iOS with limit of 1 item per order.
Create classes for Order, Cart, Item
Implement network requests to fetch item details
Use APIs to add item to cart and place order
Design information flow from selecting item to placing order
Software Engineer2 Interview Questions and Answers for Freshers
Q3. How to process large amount of data? Which tool would you prefer?
To process large amount of data, use tools like Apache Hadoop, Apache Spark, or Google BigQuery.
Utilize distributed computing frameworks like Apache Hadoop or Apache Spark for parallel processing of data
Consider using cloud-based solutions like Google BigQuery for scalability and cost-effectiveness
Optimize data processing pipelines by using tools like Apache Kafka for real-time data streaming
Implement data compression techniques to reduce storage and processing overhead
Q4. Can you describe the system design for the checkout feature on Amazon, including the request body, API calls, load balancing, database caching, and content delivery network (CDN) considerations?
The system design for the checkout feature on Amazon involves request body, API calls, load balancing, database caching, and CDN considerations.
Request body includes user's selected items, shipping address, payment details, etc.
API calls are made to process payment, update inventory, and send confirmation emails.
Load balancing ensures even distribution of traffic across multiple servers to handle checkout requests efficiently.
Database caching helps in storing frequently acces...read more
Q5. Given an integer array , and a target k , we need to find the pair of elements from array whose sum will be equal to target k.
Find pair of elements in array whose sum is equal to target k.
Use a hashmap to store the difference between target k and each element in the array.
Iterate through the array and check if the current element's complement exists in the hashmap.
Return the indices of the pair that sums up to target k.
Q6. How to find if an array has duplicates, in linear time?
To find duplicates in an array of strings in linear time
Create a hash table to store the frequency of each string
Iterate through the array and check if the frequency of any string is greater than 1
If yes, then it is a duplicate
Return true if duplicates are found, else false
Share interview questions and help millions of jobseekers 🌟
Q7. How will a live migration occur in a production database where 100% uptime is expected ?
Live migration in a production database with 100% uptime
Use database replication to create a secondary database that mirrors the primary one
Gradually switch traffic from the primary to the secondary database
Once traffic is fully switched, perform the migration on the primary database
Switch traffic back to the primary database once migration is complete
Monitor for any issues during the migration process
Q8. What is the difference between abstract class and interface? Give a use case for both.
Abstract class allows partial implementation while interface allows full abstraction.
Abstract class can have both abstract and non-abstract methods, while interface can only have abstract methods.
A class can only extend one abstract class, but can implement multiple interfaces.
Abstract class is used when some common functionality needs to be shared among subclasses, while interface is used to define a contract for classes to implement.
Example: Abstract class 'Shape' with abst...read more
Software Engineer2 Jobs
Q9. What is TDD and BDD? What are the differences and which one do you prefer?
TDD stands for Test-Driven Development and BDD stands for Behavior-Driven Development. TDD focuses on writing tests before writing code, while BDD focuses on the behavior of the system.
TDD involves writing a failing test, writing code to make the test pass, and then refactoring the code.
BDD focuses on defining the behavior of the system through examples written in a specific format like Given-When-Then.
TDD is more developer-centric, while BDD involves collaboration between de...read more
Q10. How will you optimise a frequently searched items list ?
Optimise frequently searched items list by implementing caching, indexing, and prioritising popular items.
Implement caching to store frequently searched items in memory for quick access.
Use indexing to efficiently search and retrieve items from the list.
Prioritise popular items by tracking search frequency and displaying them prominently.
Consider implementing autocomplete or predictive search to suggest items as users type.
Regularly update the list based on search trends to e...read more
Q11. How you will handle if a customer requesting for a mysql upgrade
I would assess the impact of the upgrade, plan the process, communicate with the customer, and ensure a smooth transition.
Assess the current version of MySQL and the customer's requirements for the upgrade
Plan the upgrade process including backups, testing, and rollback procedures
Communicate with the customer about the timeline, potential downtime, and any impact on their system
Ensure a smooth transition by monitoring the upgrade process and addressing any issues promptly
Q12. Create cusom hook in react Explain react's virtual DOM Sort an array
Creating custom hook, explaining virtual DOM, sorting an array in React
To create a custom hook in React, you can define a function that starts with 'use' and can be reused across components.
React's virtual DOM is a lightweight copy of the actual DOM, which allows React to efficiently update the real DOM.
To sort an array in JavaScript, you can use the built-in 'sort' method or write a custom sorting function.
Q13. What has been your experience with framework design and implementation?
I have extensive experience in designing and implementing frameworks for various software projects.
Designed and implemented a custom testing framework for automated testing of web applications.
Utilized Spring framework for developing enterprise applications, including dependency injection and aspect-oriented programming.
Contributed to the design and implementation of a microservices architecture using Netflix OSS frameworks like Eureka and Zuul.
Q14. how is react different from angular ? write a custom component in angular
React is a JavaScript library for building user interfaces, while Angular is a full-fledged framework for building web applications.
React is a library, while Angular is a framework
React uses a virtual DOM for performance optimization, while Angular uses two-way data binding
React components are simpler and more flexible, while Angular components are more opinionated and structured
Angular has a built-in dependency injection system, while React relies on external libraries for s...read more
Q15. String permutations with atleast 3 letters in it and first letter vowel
Generate string permutations with first letter as vowel and atleast 3 letters
Create a list of vowels and a list of consonants
Generate all possible permutations of length 3 or more using itertools.permutations
Filter out permutations that do not start with a vowel
Join the remaining permutations into strings
Q16. How to process large amount of logs?
Process large amount of logs by using log aggregation tools like ELK stack or Splunk.
Utilize log aggregation tools like ELK stack (Elasticsearch, Logstash, Kibana) or Splunk to collect, index, search, and visualize logs.
Implement proper log rotation and retention policies to manage the volume of logs efficiently.
Leverage distributed systems and parallel processing to handle large volumes of logs effectively.
Use filtering and parsing techniques to extract relevant information ...read more
Q17. Given an input string "aaabbCCaaDD" , O/p : a3b2C2a2D2 , we need to find the frequency of subsequent characters.
The task is to find the frequency of subsequent characters in a given input string.
Iterate through the input string while keeping track of the current character and its frequency.
If the current character is the same as the previous character, increment the frequency count.
If the current character is different, append the previous character and its frequency to the output string.
Repeat until the end of the input string is reached.
Q18. concat 3 columns and handle when null: select concat(a, b, c) from table
Concatenate 3 columns and handle null values in SQL query
Use CONCAT_WS function to concatenate columns and handle null values
Provide a separator as the first argument in CONCAT_WS function
Use IFNULL function to replace null values with a specified value
Q19. Actuator in spring boot and what are the actuator endpoints
Actuator in Spring Boot provides production-ready features like monitoring and metrics.
Actuator is a set of tools provided by Spring Boot to monitor and manage your application.
Actuator endpoints are URLs that provide information about your application, such as health, metrics, info, etc.
Examples of actuator endpoints include /actuator/health, /actuator/metrics, /actuator/info, etc.
Q20. What teconologies are you interested in ?
I am interested in technologies related to artificial intelligence, machine learning, and cloud computing.
Artificial Intelligence
Machine Learning
Cloud Computing
Q21. What are the methods for enabling communication between microservices?
Methods for enabling communication between microservices
RESTful APIs
Message queues (e.g. RabbitMQ, Kafka)
gRPC (Google Remote Procedure Call)
Service mesh (e.g. Istio, Linkerd)
Event-driven architecture (e.g. using Apache Kafka)
Q22. Coding challenges with screen sharing.
Coding challenges with screen sharing involve solving programming problems while sharing your screen with an interviewer.
Prepare by practicing coding challenges beforehand
Ensure your internet connection and screen sharing software are working properly
Communicate your thought process and ask questions during the challenge
Test your code thoroughly before submitting
Be open to feedback and suggestions from the interviewer
Q23. Write a program to check if the sum of digits of.the given number is a prime number
Program to check if sum of digits of a number is prime
Convert the number to a string to iterate through each digit
Calculate the sum of digits
Check if the sum is a prime number
Q24. Write a program to find the frequency of word in a sentence
Program to find frequency of words in a sentence
Split the sentence into words using space as delimiter
Create a map to store word frequencies
Iterate through the words and update the map accordingly
Handle case sensitivity and punctuation if needed
Q25. Write an SQL query to get the second highest salary in the table
SQL query to get the second highest salary in a table
Use the MAX() function to find the highest salary
Use the WHERE clause to exclude the highest salary
Order the salaries in descending order and limit the result to 1
Q26. Difference between standard ADSO and write optimise DSO. Why do define keys in ADSO.
Standard ADSO is for persistent storage and reporting, while write optimized DSO is for temporary storage. Keys in ADSO are used for data modeling and performance optimization.
Standard ADSO is used for persistent storage and reporting, while write optimized DSO is used for temporary storage before loading data to a standard ADSO.
Write optimized DSO does not store data persistently, making it suitable for temporary data storage during data loads.
Keys in ADSO are defined to uni...read more
Q27. What is the difference between abstract and interface
Abstract class can have both abstract and non-abstract methods, while interface can only have abstract methods.
Abstract class can have constructors, fields, and methods, while interface can only have constants and method signatures.
A class can extend only one abstract class, but can implement multiple interfaces.
Abstract classes are used to define a common behavior for subclasses, while interfaces are used to define a contract for classes to implement.
Example: Abstract class ...read more
Q28. How you will check the load issue and spamming
To check load issue and spamming, monitor server performance, analyze traffic patterns, implement CAPTCHA, and use machine learning algorithms.
Monitor server performance to identify any spikes in traffic or unusual activity
Analyze traffic patterns to detect any abnormal behavior or patterns consistent with spamming
Implement CAPTCHA or other verification methods to prevent automated spamming
Utilize machine learning algorithms to continuously learn and adapt to new spamming tec...read more
Q29. in depth practice of String Manipulations using looping and conditional statements
String manipulation using loops and conditionals for software engineering
Use loops to iterate through each character in the string
Use conditional statements to check for specific conditions and manipulate the string accordingly
Examples: reversing a string, counting occurrences of a specific character, removing whitespace
Q30. On what basis would you consider sharding the database on
Sharding the database is based on factors like scalability, performance, and data distribution.
Consider sharding when the database is growing rapidly and needs to handle increased load.
Shard based on geographical location to reduce latency for users in different regions.
Shard based on specific data types or access patterns to optimize performance.
Consider sharding when the database becomes too large to efficiently handle queries and transactions.
Evaluate the trade-offs betwee...read more
Q31. find the number of ways to reach to rightmost cell from topmost cell in 2D matrix
The number of ways to reach the rightmost cell from the topmost cell in a 2D matrix can be calculated using dynamic programming.
Use dynamic programming to calculate the number of ways to reach each cell in the matrix.
At each cell, the number of ways to reach it is the sum of the number of ways to reach the cell above it and the cell to the left of it.
The value in the rightmost cell will give the total number of ways to reach it from the topmost cell.
Q32. Where are objects stored in memory?
Objects are stored in memory in the heap or stack depending on their scope and lifetime.
Objects with local scope are stored on the stack, while objects with dynamic memory allocation are stored on the heap.
Primitive data types like int, float are stored on the stack, while complex objects like arrays, classes are stored on the heap.
Objects stored on the stack have faster access but limited size, while objects on the heap have slower access but can grow dynamically.
Q33. What is the difference between var let and const?
var, let, and const are all used for variable declaration in JavaScript, but they have different scopes and mutability.
var is function-scoped and can be redeclared and reassigned
let is block-scoped and can be reassigned but not redeclared
const is block-scoped and cannot be reassigned or redeclared
Q34. System design of Paytm and Microservices Architecture.
Paytm uses microservices architecture for scalability and flexibility in system design.
Paytm's system design is based on microservices architecture to break down the application into smaller, independent services.
Each service in Paytm's architecture handles a specific function, such as payments, wallet, or shopping.
Microservices communicate with each other through APIs, allowing for easier scalability and maintenance.
This architecture enables Paytm to quickly add new features...read more
Q35. Should an abstract class always have an abstract method
No, an abstract class can have concrete methods as well.
An abstract class can have both abstract and concrete methods.
Abstract methods are meant to be implemented by subclasses, while concrete methods can have a default implementation.
Having only abstract methods in an abstract class is not a requirement.
Q36. Check if rectangles overlap or not and some pointers dicsussion
Check if rectangles overlap by comparing their coordinates
Compare the x and y coordinates of the two rectangles to see if they overlap
If one rectangle is to the left of the other, or above the other, they do not overlap
If the rectangles overlap, the x and y ranges will intersect
Q37. Design a e2e payment system with components explanation in detail
Designing an e2e payment system with detailed component explanation
1. Define user roles and permissions (e.g. customer, merchant, admin)
2. Implement secure payment gateway integration (e.g. Stripe, PayPal)
3. Develop user-friendly interfaces for payment processing
4. Ensure data encryption and compliance with PCI DSS standards
5. Set up automated payment notifications and transaction tracking
Q38. Design APIs for user based content
Design APIs for user generated content to allow users to create, read, update, and delete their own content.
Create API endpoint for users to create new content
Read API endpoint to retrieve user's content
Update API endpoint to allow users to modify their content
Delete API endpoint to enable users to remove their content
Q39. SQL query to fetch progress for given user id and course id
SQL query to fetch progress for given user id and course id
Use SELECT statement to retrieve progress data
Filter results using WHERE clause with user id and course id
Join tables if progress data is stored in a separate table
Q40. What is dns and uts architecture
DNS (Domain Name System) is a system that translates domain names to IP addresses. UTS (User Thread Scheduler) architecture manages user-level threads.
DNS is used to translate human-readable domain names (like www.example.com) to IP addresses (like 192.0.2.1).
DNS operates through a distributed database system that stores domain name records.
UTS architecture manages user-level threads in a multi-threaded environment, allowing for efficient scheduling and execution.
UTS architec...read more
Q41. Code to be written on notepad not on IDE
Writing code on notepad instead of an IDE
Ensure proper indentation and formatting
Use comments to explain code
Compile and test code manually
Save frequently to avoid losing work
Q42. Do you want to do a Puzzle round?
Yes, I enjoy solving puzzles as it challenges my problem-solving skills.
I enjoy the mental challenge of puzzles
It helps me improve my problem-solving skills
Examples: Sudoku, crosswords, logic puzzles
Q43. How you can handle the pressure
I handle pressure by prioritizing tasks, staying organized, seeking support when needed, and practicing stress-relief techniques.
Prioritize tasks based on deadlines and importance
Stay organized with to-do lists and calendars
Seek support from colleagues or supervisors when feeling overwhelmed
Practice stress-relief techniques such as deep breathing or exercise
Maintain a positive attitude and focus on problem-solving
Q44. Delete the node in a linked list with given pointer
To delete a node in a linked list with a given pointer, update the node's value and next pointer to the next node's value and next pointer.
Set the value of the node to the value of the next node
Set the next pointer of the node to the next node's next pointer
Q45. Currying in javascript and implement the sum(1)(2)(3)(4)......
Currying in JavaScript is a technique of transforming a function that takes multiple arguments into a sequence of functions, each taking a single argument.
Create a function that takes a single argument and returns a new function that takes the next argument.
Repeat this process until all arguments are received and then return the final result.
Example: function sum(a) { return function(b) { return function(c) { return function(d) { return a + b + c + d; }; }; }; } sum(1)(2)(3)(...read more
Q46. Difference between SQL and NoSQL databases?
SQL databases are relational databases with structured data and predefined schema, while NoSQL databases are non-relational databases with flexible schema and unstructured data.
SQL databases use structured query language for defining and manipulating data, while NoSQL databases use different query languages or APIs.
SQL databases are table-based, with rows and columns, while NoSQL databases can be document-based, key-value pairs, graph databases, etc.
SQL databases are good for...read more
Q47. Cloning a Singly Linked List with Random Pointers
Cloning a singly linked list with random pointers involves creating a deep copy of the list while maintaining the random pointers.
Create a new node for each node in the original list and insert it next to the original node.
Update the random pointers of the new nodes to point to the corresponding new nodes.
Separate the original and cloned lists by adjusting the next pointers.
Q48. Generate the Permutations for the given String
Generate permutations of a given string
Use recursion to generate all possible permutations
Swap characters in the string to create different permutations
Base case: when the string length is 1, return the string as a permutation
Q49. DSA question to find maximum subarray sum
Find the maximum subarray sum using Kadane's algorithm
Initialize max_sum and current_sum to 0
Iterate through the array and update current_sum by adding the current element
If current_sum becomes negative, reset it to 0
Update max_sum if current_sum is greater than max_sum
Q50. Find distinct without distinct keyword in SQL
Use GROUP BY to find distinct values in SQL without using the DISTINCT keyword.
Use GROUP BY clause with all columns in the SELECT statement
This will group the rows with the same values together, effectively giving distinct values
Top Interview Questions for Software Engineer2 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