Add office photos
Employer?
Claim Account for FREE

Visa

3.5
based on 364 Reviews
Video summary
Filter interviews by

10+ MarginEdge Interview Questions and Answers

Updated 12 Mar 2024
Popular Designations

Q1. Maximum Equal Elements After K Operations

You are provided with an array/list of integers named 'ARR' of size 'N' and an integer 'K'. Your task is to determine the maximum number of elements that can be made eq...read more

Ans.

Determine the maximum number of elements that can be made equal by performing at most K operations on an array of integers.

  • Sort the array in non-decreasing order to easily identify the elements that need to be increased

  • Calculate the difference between adjacent elements to determine the number of operations needed to make them equal

  • Keep track of the total number of operations used and the maximum number of elements that can be made equal

Add your answer

Q2. Ninja's Dance Competition Pairing Problem

Ninja is organizing a dance competition and wants to pair participants using a unique method. Each participant chooses a number upon entry, and Ninja selects a number ‘...read more

Ans.

Find the number of distinct pairs of participants with a given difference in chosen numbers.

  • Iterate through the array and for each element, check if the pair exists with the required difference 'K'.

  • Use a hash set to keep track of unique pairs to avoid counting duplicates.

  • Return the size of the hash set as the final count of distinct pairs.

Add your answer

Q3. Find Maximum Length Sub-array with Specific Adjacent Differences

Given an array of integers ‘A’ of length ‘N’, find the maximum length of a sub-array where the absolute difference between adjacent elements is e...read more

Ans.

Find the maximum length of a sub-array with adjacent differences of 0 or 1 in an array of integers.

  • Iterate through the array and keep track of the current sub-array length with adjacent differences of 0 or 1.

  • Update the maximum length encountered so far as you traverse the array.

  • Return the maximum length found as the result.

View 1 answer

Q4. LRU Cache Design Question

Design a data structure for a Least Recently Used (LRU) cache that supports the following operations:

1. get(key) - Return the value of the key if it exists in the cache; otherwise, re...read more

Ans.

Design a Least Recently Used (LRU) cache data structure that supports get and put operations with capacity constraint.

  • Use a combination of hashmap and doubly linked list to implement the LRU cache.

  • Keep track of the least recently used item and evict it when the cache reaches its capacity.

  • Update the position of an item in the cache whenever it is accessed to maintain the order of recently used items.

Add your answer
Discover MarginEdge interview dos and don'ts from real experiences

Q5. Valid String Problem Statement

You are provided with a string S containing only three types of characters: ('), )'), and *.

Explanation:

A Valid String is characterized by the following conditions:

1. Each left...read more
Ans.

Check if a given string containing parentheses and asterisks is valid based on certain conditions.

  • Iterate through the string and keep track of the count of left parentheses, right parentheses, and asterisks.

  • Use a stack to keep track of the positions of left parentheses and asterisks.

  • If at any point the count of right parentheses exceeds the count of left parentheses and asterisks, the string is invalid.

Add your answer

Q6. Count Pairs with Given Sum

Given an integer array/list arr and an integer 'Sum', determine the total number of unique pairs in the array whose elements sum up to the given 'Sum'.

Input:

The first line contains ...read more
Ans.

Count the total number of unique pairs in an array whose elements sum up to a given value.

  • Use a hashmap to store the frequency of each element in the array.

  • Iterate through the array and for each element, check if (Sum - current element) exists in the hashmap.

  • Increment the count of pairs if the complement exists in the hashmap.

Add your answer
Are these interview questions helpful?

Q7. Minimum Cost to Reach End Problem

You are provided with an array ARR of integers of size 'N' and an integer 'K'. The goal is to move from the starting index to the end of the array with the minimum possible cos...read more

Ans.

Find minimum cost to reach end of array by jumping with constraints

  • Use dynamic programming to keep track of minimum cost at each index

  • Iterate through the array and update the minimum cost based on reachable indices within K steps

  • Calculate cost to jump from current index to reachable indices and update minimum cost accordingly

Add your answer

Q8. What is race condition and how can it be eliminated

Ans.

Race condition is a situation where multiple threads/processes access and manipulate shared data simultaneously.

  • It can be eliminated by using synchronization techniques like locks, semaphores, and mutexes.

  • Another way is to use atomic operations that ensure the data is accessed and modified atomically.

  • Using thread-safe data structures can also prevent race conditions.

  • Example: Two threads trying to increment a shared variable simultaneously can cause a race condition.

  • Example: U...read more

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

Q9. Explain Testing principles and Design principles

Ans.

Testing principles ensure software quality, while design principles guide software development.

  • Testing principles include unit testing, integration testing, and acceptance testing.

  • Design principles include SOLID, DRY, and KISS.

  • Testing principles ensure that software meets requirements and is free of defects.

  • Design principles guide software development to be modular, maintainable, and scalable.

Add your answer

Q10. What is regression testing?

Ans.

Regression testing is the process of testing changes made to a software application to ensure that existing functionality still works.

  • It is performed after making changes to the software

  • It ensures that existing functionality is not affected by the changes

  • It helps to catch any defects or bugs that may have been introduced

  • It can be automated using testing tools

  • Examples include retesting after bug fixes, testing after new features are added

Add your answer

Q11. What is JCube?

Ans.

JCube is a Java library for creating and manipulating Rubik's Cube puzzles.

  • JCube provides classes for representing Rubik's Cube puzzles and algorithms for solving them.

  • It supports various cube sizes and can generate random scrambles.

  • JCube can be used in Java applications or as a standalone command-line tool.

  • It is open source and available on GitHub.

Add your answer

Q12. Software engineering principles

Ans.

Software engineering principles are the best practices and guidelines for developing high-quality software.

  • Software should be designed with modularity and scalability in mind.

  • Code should be well-documented and easy to read.

  • Testing and debugging should be an integral part of the development process.

  • Version control should be used to manage code changes.

  • Security and privacy should be considered throughout the development lifecycle.

Add your answer

Q13. Code a circular linked list

Ans.

A circular linked list is a data structure where the last node points back to the first node, forming a loop.

  • Create a Node class with data and next pointer

  • Initialize the head node and set its next pointer to itself

  • To add a node, create a new node and set its next pointer to the head node's next pointer, then update the head node's next pointer to the new node

  • To traverse the circular linked list, start from the head node and continue until reaching the head node again

Add your answer

Q14. Define Singleton class

Ans.

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

  • It restricts the instantiation of a class to a single object.

  • It provides a global point of access to that instance.

  • It is often used in situations where a single object is required to coordinate actions across a system.

  • Example: Database connection manager, Configuration manager, Logger manager.

Add your answer

Q15. Code a basic linked list

Ans.

Code a basic linked list

  • Create a Node class with data and next pointer

  • Create a LinkedList class with head pointer

  • Implement methods to add, delete, and search nodes in the linked list

Add your answer

Q16. Code a basic binary tree

Ans.

A binary tree is a data structure in which each node has at most two children.

  • Start with a root node

  • Each node has a left and right child

  • Nodes can be added or removed

  • Traversal can be done in-order, pre-order, or post-order

Add your answer

Q17. design google-pay

Ans.

Design Google Pay - a digital wallet platform for online payments and transactions.

  • Allow users to securely store payment information such as credit/debit cards, bank accounts, and loyalty cards.

  • Enable users to make payments in stores, online, and within apps using their stored payment methods.

  • Implement security features like biometric authentication, tokenization, and encryption to protect user data.

  • Provide features for splitting bills, requesting money, and sending money to ...read more

Add your answer

Q18. HLD of recursive

Ans.

High Level Design (HLD) of recursive functions in software development.

  • Recursive functions call themselves to solve smaller instances of the same problem.

  • HLD of recursive functions involves defining the base case, recursive case, and termination condition.

  • Example: HLD of a recursive function to calculate factorial of a number involves defining base case as factorial(0) = 1.

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

Interview Process at MarginEdge

based on 5 interviews
1 Interview rounds
Coding Test Round
View more
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories

Top Software Developer Interview Questions from Similar Companies

4.2
 • 122 Interview Questions
3.7
 • 107 Interview Questions
3.5
 • 46 Interview Questions
4.0
 • 39 Interview Questions
3.8
 • 20 Interview Questions
3.5
 • 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
75 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