Add office photos
Employer?
Claim Account for FREE

Google

4.4
based on 1.8k Reviews
Proud winner of ABECA 2024 - AmbitionBox Employee Choice Awards
Filter interviews by

80+ Interview Questions and Answers

Updated 11 Dec 2024
Popular Designations
Q1. Painter's Partition Problem

Given an array/list of length ‘N’, where the array/list represents the boards and each element of the given array/list represents the length of each board. Some ‘K’ numbers of painter...read more

View 4 more answers
Q2. Special Numbers

You are given an integer, ‘MAXVAL’. Your task is to determine the total number of special numbers present in the range, 1 to ‘MAXVAL’.

Note:
A special number is a number, which when rotated 180 d...read more
View 3 more answers
Q3. Shopping Spree

Preeti has decided to go to the Grand Mall to buy some stuff for her father’s birthday. On reaching the place, she found a fascinating shop that has an unlimited quantity of each item they sell. T...read more

View 4 more answers
Q4. Chocolate Problem

Given an array/list of integer numbers 'CHOCOLATES' of size 'N', where each value of the array/list represents the number of chocolates in the packet. There are ‘M’ number of students and the t...read more

View 2 more answers
Discover null interview dos and don'ts from real experiences
Q5. Running Median

You are given a stream of 'N' integers. For every 'i-th' integer added to the running list of integers, print the resulting median.

Input Format :
The fi...read more
View 3 more answers
Q6. Longest Palindromic Substring

You are given a string (STR) of length N.

Your task is to find the longest palindromic substring. If there is more than one palindromic substring with the maximum length, return the...read more

View 3 more answers
Are these interview questions helpful?
Q7. Minimum and Maximum Cost to buy N Candies

Ram went to a specialty candy store in Ninjaland which has 'N' candies with different costs.

The Candy shop gives a special offer to its customers. A customer can buy a ...read more

View 2 more answers

Q8. Say you have three tables WORK, USERS, MANAGERS WORK - work_id - user_id - how_much USERS - user_id - team MANAGERS - manager_id - team If I am a manager, write a select statement to retrieve the work of all us...

read more
Ans.

Write a select statement to retrieve work of all users who belong to my team.

  • Join USERS and WORK tables on user_id

  • Join MANAGERS and USERS tables on team

  • Filter by manager_id

Add your answer
Share interview questions and help millions of jobseekers 🌟
Q9. Min Steps to one using DP

You are given a positive integer 'N’. Your task is to find and return the minimum number of steps that 'N' has to take to get reduced to 1.

You can perform any one of the following 3 st...read more

View 2 more answers
Q10. Minimize the Maximum

You are given an array of N integers and an integer K. For each array element, you are allowed to increase or decrease it by a value k. The task is to minimize the difference between the max...read more

View 2 more answers
Q11. Median in a stream

Given that integers are read from a data stream. Your task is to find the median of the elements read so far.

Median is the middle value in an ordered integer list. If the size of the list is ...read more

View 3 more answers
Q12. Count Ways To Reach The N-th Stairs

You have been given a number of stairs. Initially, you are at the 0th stair, and you need to reach the Nth stair. Each time you can either climb one step or two steps. You are...read more

View 4 more answers
Q13. Pattern Matching

You are given a pattern in the form of a string and a collection of words. Your task is to determine if the pattern string and the collection of words have the same order.

Note :
The strings are...read more
View 2 more answers
Q14. The Skyline Problem

You are given 'N' rectangular buildings in a 2-dimensional city. Your task is to compute the skyline of these buildings, eliminating hidden lines return the skyline formed by these buildings ...read more

View 2 more answers
Q15. Covid Vaccination

We are suffering from the Second wave of Covid-19. The Government is trying to increase its vaccination drives. Ninja wants to help the Government to plan an effective method to help increase v...read more

View 2 more answers
Q16. Boyer Moore Algorithm for Pattern Searching

You are given a string ‘text’ and a string ‘pattern’, your task is to find all occurrences of pattern in the string ‘text’ and return an array of indexes of all those ...read more

View 2 more answers
Q17. Alien dictionary

You have been given a sorted (lexical order) dictionary of an alien language. Write a function that finds the order of characters in the alien language. This dictionary will be given to you in t...read more

View 2 more answers
Q18. Ninjas's Robot

Ninja has a robot that can move in an infinite number line. The robot starts at position 0, with speed = +1. The robot moves automatically according to the sequence of instructions “A” (Accelerate...read more

View 2 more answers
Q19. Swap And Maximise

You are given a circular array consisting of N integers. You have to find the maximum sum of the absolute difference between adjacent elements with rearrangement of array element allowed i.e af...read more

Add your answer
Q20. Farthest Distance From Lands

You are given a binary square matrix ‘ARR’ with N rows and N columns, in which 0 represents the water and 1 represents the land.

You have to find a water cell such that its distance ...read more

View 2 more answers
Q21. Bridges In A Graph

Given an undirected graph of V vertices and E edges. Your task is to find all the bridges in the given undirected graph. A bridge in any graph is defined as an edge which, when removed, makes ...read more

View 2 more answers
Q22. Longest Palindromic Substring

Given a string ’S’ consisting of lower case English letters, you are supposed to return the longest palindromic substring of ‘S’.

Note that in case of more than one longest palindro...read more

View 3 more answers
Q23. Shortest alternate colored path

Consider a directed graph of ‘N’ nodes where each node is labeled from ‘0’ to ‘N - 1’. Each edge of the graph is either ‘red’ or ‘blue’ colored. The graph may contain self-edges o...read more

View 2 more answers
Q24. Spell Checker

You are given a list of strings, ‘DICTIONARY[]’ that represents the correct spelling of words and a query string ‘QUERY’ that may have incorrect spelling. You have to check whether the spelling of ...read more

Add your answer

Q25. a / b c / / d e f g Print the nodes in the following order: a, b, c, g, f, e, d, h, i, j, k, l ,m, n, o and so on. Which all data structures are used? Can we use just 1?

Ans.

Multiple data structures are used to print nodes in a specific order. One data structure cannot be used alone.

  • The given order suggests a depth-first search traversal of a tree-like structure.

  • A stack can be used to keep track of the nodes to be visited.

  • A queue can be used to store the children of a node in the order they are visited.

  • An array can be used to store the nodes in the required order.

  • A linked list can be used to connect the nodes in the required order.

  • Using just one ...read more

Add your answer

Q26. If you had an opportunity to design the Google Suggest system, please let us know how you would approach it and how you would execute the plan in terms of settings up systems like(data stores or databases, inde...

read more
Ans.

Designing Google Suggest system

  • I would start by analyzing user search patterns and frequently searched keywords

  • Then, I would create a database of these keywords and their associated search results

  • I would use indexing services to quickly retrieve relevant results for each keyword

  • I would also implement machine learning algorithms to improve the accuracy of suggestions over time

Add your answer

Q27. Given n pens and n tops, each pen (and each top) having a size different than the other and each pen fitting exactly one top, find the largest pen using minimum number of comparisons. A comparison involves pick...

read more
Ans.

Find largest pen using minimum comparisons with tops.

  • Divide pens into two groups and compare largest pen from each group with largest top.

  • Repeat the process with the group containing the largest pen until only one pen is left.

  • The remaining pen is the largest pen.

  • Total number of comparisons required is 2n-3.

Add your answer

Q28. How do you find out if a number is a power of 2? And how do you know if it is an odd number? Write code in the language of your choice

Ans.

Check if a number is a power of 2 and odd.

  • To check if a number is a power of 2, use bitwise AND operator with the number and its predecessor. If the result is 0, it is a power of 2.

  • To check if a number is odd, use modulus operator with 2. If the result is 1, it is odd.

  • Example code in Python:

  • def is_power_of_two(num):

  • return num & (num - 1) == 0

  • def is_odd(num):

  • return num % 2 == 1

View 2 more answers

Q29. Given a source array of integers with possible duplicates and a target integer, write algorithm to find out 2 numbers in source array whose sum is equal to target integer

Ans.

Algorithm to find 2 numbers in an array whose sum is equal to a target integer

  • Use a hash table to store the difference between target and each element in the array

  • Iterate through the array and check if the current element exists in the hash table

  • Return the pair of elements that sum up to the target integer

View 1 answer
Q30. Connect N Ropes With Minimum Cost

You have been given 'N' ropes of different lengths, we need to connect these ropes into one rope. The cost to connect two ropes is equal to sum of their lengths. We need to conn...read more

View 2 more answers

Q31. Given n dice, each of 'a' sides and a sum b, return the number of ways in which the sum b can be obtained. How can you reduce the time complexity and space complexity?

Ans.

Given n dice with 'a' sides and sum b, return no. of ways to obtain b. Optimize time and space complexity.

  • Use dynamic programming to reduce time complexity

  • Create a 2D array to store the number of ways to obtain each sum for each number of dice

  • Use rolling arrays to optimize space complexity

  • Example: n=2, a=6, b=7 -> 6 ways to obtain sum 7

  • Example: n=3, a=4, b=8 -> 21 ways to obtain sum 8

Add your answer

Q32. Which is faster: finding an item in a hashtable or in a sorted list? And Why?

Ans.

Hashtable is faster for finding an item than a sorted list.

  • Hashtable has constant time complexity O(1) for finding an item.

  • Sorted list has logarithmic time complexity O(log n) for finding an item.

  • Hashtable uses hashing to directly access the item's location.

  • Sorted list requires binary search to find the item's location.

  • Hashtable is ideal for large datasets with frequent lookups.

  • Sorted list is ideal for datasets that require frequent insertions and deletions.

View 2 more answers

Q33. Given 2 machines, each having 64 GB RAM, containing all integers (8 byte), sort the entire 128 GB data. You may assume a small amount of additional RAM. Extend this to sort data stored in 1000 machines

Ans.

Sort 128 GB data on 2 machines with 64 GB RAM each. Extend to 1000 machines.

  • Use external sorting algorithm like merge sort or quick sort

  • Divide data into smaller chunks and sort them individually

  • Merge sorted chunks using additional RAM

  • For 1000 machines, use distributed sorting algorithms like MapReduce or Hadoop

  • Ensure data consistency and fault tolerance in distributed sorting

Add your answer

Q34. In google adwords there are about 30 million ads from 42 lanuages . What will I do review the ads and reject ads that do not comply with specific rules

Ans.

Reviewing 30 million ads from 42 languages in Google AdWords and rejecting non-compliant ads requires a systematic approach.

  • Create a set of specific rules and guidelines for ad compliance

  • Use automated tools to filter out ads that violate the rules

  • Assign a team of reviewers to manually check the remaining ads

  • Ensure that the reviewers are fluent in the languages of the ads they are reviewing

  • Regularly update the rules and guidelines to keep up with changes in the industry

  • Provide...read more

Add your answer

Q35. How would you change the format of all the phone numbers in 1000 static html pages?

Ans.

Use a script to automate the process of changing phone number format in 1000 static html pages.

  • Create a script using a programming language like Python or JavaScript.

  • Use regular expressions to identify phone numbers in the HTML pages.

  • Use string manipulation functions to change the format of the phone numbers.

  • Test the script on a small sample of HTML pages before running it on all 1000 pages.

  • Make sure to backup the original HTML pages before making any changes.

Add your answer

Q36. What are some of the most popular Data interchange formats when using APIs

Ans.

JSON and XML are the most popular data interchange formats when using APIs.

  • JSON (JavaScript Object Notation) is a lightweight format that is easy to read and write. It is widely used in web APIs.

  • XML (Extensible Markup Language) is a more complex format that is also widely used in web APIs.

  • Other formats include CSV (Comma Separated Values), YAML (YAML Ain't Markup Language), and Protocol Buffers.

View 1 answer
Q37. DBMS Question

RDBMS vs Non RDBMS

Why SQL is very popular?

How do you get second largest salary

What is stored procedure?

Add your answer
Q38. Technical Questions

How to align a text in a larger web page context?

OOPS Concepts

Add your answer

Q39. Tell about ur strength? Tell about long term goal?

Ans.

My strength lies in my problem-solving skills and ability to work well in a team. My long term goal is to become a lead developer and contribute to innovative projects.

  • Strong problem-solving skills

  • Effective team player

  • Long term goal of becoming a lead developer

  • Contribute to innovative projects

View 4 more answers
Q40. OS Questions

Sleeping barber problem.

Disk scheduling algos

Process Scheduling algos

Turnaround time

Threads

Add your answer

Q41. How will improve the revenue of the cafeteria of the office.

Ans.

By introducing new menu items, optimizing pricing strategy, and improving the overall dining experience.

  • Conduct a survey to understand the preferences of employees

  • Introduce healthy and affordable meal options

  • Offer discounts for bulk orders or loyalty programs

  • Partner with local vendors to source fresh ingredients

  • Improve the ambiance and seating arrangements

  • Implement online ordering and delivery services

Add your answer

Q42. Which data structure will be better suited chain type data.

Ans.

Linked List is the best-suited data structure for chain type data.

  • Linked List is a dynamic data structure that can grow or shrink during runtime.

  • It allows efficient insertion and deletion operations.

  • Each node in the linked list contains a reference to the next node.

  • Examples of chain type data include a list of songs in a playlist or a list of tasks in a to-do list.

View 2 more answers

Q43. Name some popular APIs for each of these Social Commerce service(llike a photo service etc)

Ans.

Popular APIs for Social Commerce services

  • Facebook Graph API for social media integration

  • Instagram API for photo sharing and tagging

  • Twitter API for real-time updates and customer engagement

  • Pinterest API for product discovery and sharing

  • Google Maps API for location-based services

  • PayPal API for secure payment processing

View 1 answer

Q44. Why is Java a platform independent language?

Ans.

Java is platform independent due to its bytecode and JVM implementation.

  • Java code is compiled into bytecode, which can run on any platform with a Java Virtual Machine (JVM)

  • JVM acts as an interpreter, translating bytecode into machine code specific to the underlying platform

  • This allows Java programs to be written once and run anywhere, without the need for recompilation

View 1 answer
Q45. Technical Question

below are giving versions and there commit msg arrange them ascending order and merge all commit messages with same versions.1.0.0* Initial release—————1.0.2* feature 2xx updated—————1.0.0* In...read more

Add your answer

Q46. What are Static Binding and Dynamic Binding?

Ans.

Static binding is resolved at compile time, while dynamic binding is resolved at runtime.

  • Static binding is also known as early binding, where the method call is resolved at compile time based on the type of the object.

  • Dynamic binding is also known as late binding, where the method call is resolved at runtime based on the actual type of the object.

  • Example of static binding: method overloading.

  • Example of dynamic binding: method overriding.

Add your answer

Q47. input: { type: file, filename: in.txt } mode: strict output: { type: service, server: { hostname: myserver.com } person: { age: 12 } } How would you represent data of this kind in memory ?

Ans.

The data can be represented in memory using a combination of data structures like objects and arrays.

  • Use objects to represent the input, output, server, and person data

  • Use arrays to store multiple values like filenames or hostnames

  • Use key-value pairs to store specific information like age or type

Add your answer

Q48. What is the lambda expression in JAVA?

Ans.

Lambda expression in JAVA is a concise way to represent a method implementation using a functional interface.

  • Lambda expressions are used to provide a more concise way to implement functional interfaces in JAVA.

  • They are similar to anonymous classes but with less boilerplate code.

  • Lambda expressions can be used to pass behavior as an argument to a method.

  • Syntax: (parameters) -> expression or (parameters) -> { statements; }

  • Example: (int a, int b) -> a + b

Add your answer

Q49. Is the initial shortlisting conducted through an Applicant Tracking System (ATS)?

Ans.

Yes, many companies use Applicant Tracking Systems for initial shortlisting.

  • Many companies use ATS to manage and filter large volumes of applications

  • ATS can automatically screen resumes based on keywords and qualifications

  • Some examples of popular ATS include Greenhouse, Lever, and Workday

Add your answer

Q50. What type program language do you know?

Ans.

I am proficient in programming languages such as Java, Python, C++, and JavaScript.

  • Java

  • Python

  • C++

  • JavaScript

View 2 more answers

Q51. For i in pythonlife: If i=='l': Break Print(I)

Ans.

The code will iterate over the characters in 'pythonlife' and print each character until it reaches 'l', then it will stop.

  • The code uses a for loop to iterate over each character in the string 'pythonlife'.

  • When the character 'l' is encountered, the loop will break and stop iterating.

  • The loop will print each character until 'l' is reached, so the output will be 'python'.

Add your answer

Q52. Given a configuration stream, parse it in your data structure. interface Tokenizer { bool hasNext(); string nextToken(); }

Ans.

Implement a tokenizer interface to parse a configuration stream into a data structure.

  • Create a class that implements the Tokenizer interface

  • Use the hasNext method to check if there are more tokens to parse

  • Use the nextToken method to retrieve the next token from the stream

  • Store the tokens in a data structure such as a list or map

Add your answer

Q53. Explain Virtual Machine (JVM) architecture.

Ans.

JVM is a virtual machine that enables a computer to run Java programs.

  • JVM is platform-independent and converts Java bytecode into machine code.

  • It consists of class loader, runtime data areas, execution engine, and native method interface.

  • JVM manages memory, garbage collection, and exception handling.

  • Examples of JVM implementations include Oracle HotSpot, OpenJ9, and GraalVM.

Add your answer

Q54. For i in range (0,9): Print(i)

Ans.

The code will print numbers from 0 to 8 in separate lines.

  • The 'range' function generates a sequence of numbers from 0 to 8 (9 is exclusive).

  • The 'for' loop iterates through each number in the sequence and prints it.

View 2 more answers

Q55. Return the 4th largest data, can be solved using heap data structure

Ans.

Use a heap data structure to find the 4th largest data in an array.

  • Create a max heap from the array

  • Pop the top element from the heap 3 times to get the 4th largest element

  • Return the 4th largest element

Add your answer

Q56. Different cases used for software testing

Ans.

Different cases used for software testing include functional, performance, security, usability, and compatibility testing.

  • Functional testing ensures that the software meets the specified requirements

  • Performance testing checks the software's speed, scalability, and stability under different loads

  • Security testing identifies vulnerabilities and ensures data protection

  • Usability testing evaluates the software's user-friendliness

  • Compatibility testing checks the software's compatibi...read more

Add your answer

Q57. why is google better than facebook?

Ans.

Google is better than Facebook due to its focus on search and information retrieval.

  • Google's primary focus is on search and information retrieval, while Facebook is more focused on social networking.

  • Google's search algorithm is more advanced and accurate compared to Facebook's search functionality.

  • Google offers a wide range of services beyond social networking, such as Google Maps, Gmail, and Google Drive.

  • Google has a larger market share and is considered the go-to search eng...read more

Add your answer

Q58. what is dsa and what is advantages

Ans.

DSA stands for Data Structures and Algorithms. It is essential for efficient problem-solving in software development.

  • DSA helps in organizing and managing data effectively

  • It improves the efficiency and performance of algorithms

  • Common data structures include arrays, linked lists, trees, graphs

  • Common algorithms include sorting, searching, and dynamic programming

Add your answer

Q59. Remove unnecessary spaces in the given string.

Ans.

Remove unnecessary spaces in a given string.

  • Use the trim() method to remove leading and trailing spaces.

  • Use replace() method with regex to remove multiple spaces between words.

  • Example: ' Hello World ' -> 'Hello World'

Add your answer

Q60. Optimize a^b and write an appropriate program

Ans.

Optimize a^b calculation using bitwise operations

  • Use bitwise operations like left shift and AND to optimize exponentiation

  • Avoid using traditional multiplication for each iteration

  • Example: Optimized power function in C++ - int power(int a, int b) { int result = 1; while (b > 0) { if (b & 1) result *= a; a *= a; b >>= 1; } return result; }

Add your answer

Q61. Explain types of inheritances?

Ans.

Types of inheritances include single, multiple, multilevel, hierarchical, hybrid, and multipath.

  • Single inheritance: a class inherits from only one base class.

  • Multiple inheritance: a class inherits from more than one base class.

  • Multilevel inheritance: a class inherits from a class which in turn inherits from another class.

  • Hierarchical inheritance: multiple classes inherit from a single base class.

  • Hybrid inheritance: combination of multiple and multilevel inheritance.

  • Multipath ...read more

Add your answer

Q62. Write program for break program?

Ans.

A program that breaks another program into smaller parts or components.

  • Use functions or modules to break down the main program into smaller, more manageable parts

  • Consider using object-oriented programming principles to encapsulate related functionality

  • Utilize comments and documentation to explain the purpose and functionality of each part

Add your answer

Q63. what is windows functions in sql

Ans.

Windows functions in SQL are built-in functions that perform calculations across a set of rows and return a single value.

  • Windows functions are used to perform calculations on a specific subset of rows in a result set.

  • They are often used with the OVER clause to define the window of rows over which the function operates.

  • Examples of windows functions include ROW_NUMBER(), RANK(), and SUM().

Add your answer

Q64. How do you split search query

Ans.

Splitting search query involves breaking it down into individual keywords or phrases for more accurate results.

  • Identify key words or phrases in the search query

  • Use delimiters like spaces or commas to separate the query into individual components

  • Consider using regular expressions for more complex splitting requirements

Add your answer

Q65. What is ur goal?

Ans.

My goal is to continuously improve my technical skills, contribute to innovative projects, and advance in my career as a software developer.

  • Continuous learning and improvement in technical skills

  • Contributing to innovative projects

  • Advancing in my career as a software developer

Add your answer

Q66. Given a tree, find top k nodes with highest value

Ans.

Use a priority queue to find top k nodes with highest value in a tree

  • Traverse the tree and store nodes in a priority queue based on their values

  • Pop k nodes from the priority queue to get the top k nodes with highest value

Add your answer

Q67. Write program for for loop?

Ans.

A for loop is used to iterate over a sequence of elements for a specified number of times.

  • Initialize a counter variable before the loop

  • Set the condition for the loop to continue based on the counter variable

  • Update the counter variable after each iteration

  • Example: for(int i = 0; i < 5; i++) { // code block }

View 1 answer

Q68. c++ is bad that java why?

Ans.

C++ and Java have different strengths and weaknesses, it's not accurate to say one is 'bad' compared to the other.

  • C++ is closer to the hardware and allows for more low-level programming, while Java is more platform-independent and easier to learn.

  • C++ gives more control over memory management, but this can lead to more bugs if not handled properly.

  • Java has automatic garbage collection, making memory management easier for developers.

  • C++ is often used for system programming and ...read more

Add your answer

Q69. what is cpp and its use case

Ans.

C++ is a programming language used for developing software applications.

  • C++ is a high-level programming language known for its performance and flexibility.

  • It is commonly used for developing system software, game engines, and applications that require high performance.

  • C++ supports object-oriented programming, generic programming, and low-level memory manipulation.

  • Examples of software developed using C++ include operating systems like Windows, game engines like Unreal Engine, a...read more

Add your answer

Q70. what is java and its use case

Ans.

Java is a popular programming language used for developing a wide range of applications.

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

  • It is used for developing web applications, mobile apps, desktop applications, and enterprise software

  • Java is known for its security features and scalability

  • Examples of Java-based applications include Android apps, online banking systems, and e-commerce websites

Add your answer

Q71. What is main goal?

Ans.

The main goal of a Software Developer is to design, develop, and maintain software applications to meet the needs of users.

  • Designing software applications based on user requirements

  • Developing code to implement the design

  • Testing and debugging software to ensure functionality

  • Maintaining and updating software as needed

  • Collaborating with team members to achieve project goals

Add your answer

Q72. Average of each subtree on a node in N-arry tree

Ans.

Calculate the average of each subtree on a node in an N-arry tree.

  • Traverse the tree using depth-first search (DFS)

  • Maintain a sum and count for each subtree while traversing

  • Calculate the average by dividing the sum by the count for each subtree

Add your answer

Q73. How long do you code daily ?

Ans.

I typically code for 6-8 hours daily, with breaks in between for rest and refreshment.

  • I code for 6-8 hours daily to ensure productivity and progress on projects.

  • I take breaks in between coding sessions to rest my mind and prevent burnout.

  • I prioritize quality over quantity, focusing on writing clean and efficient code.

  • I enjoy coding and often spend extra time outside of work hours on personal projects or learning new technologies.

Add your answer

Q74. experinces and how you perform

Ans.

I have over 5 years of experience in software development, with a strong focus on web applications and database management.

  • Developed web applications using HTML, CSS, JavaScript, and various frameworks like Angular and React

  • Proficient in database management with SQL and NoSQL databases such as MySQL and MongoDB

  • Experience in version control systems like Git for collaborative development

  • Strong problem-solving skills and ability to work in a team environment

  • Continuously learning...read more

Add your answer

Q75. Find median of stream of integer numbers

Ans.

Use two heaps to keep track of the numbers and find median efficiently.

  • Use a max heap to store the smaller half of the numbers and a min heap to store the larger half.

  • Keep the size of the two heaps balanced or with a difference of at most 1.

  • If the total number of elements is odd, the median is the top element of the larger heap. If even, it's the average of the tops of both heaps.

Add your answer

Q76. Difference between MySQL and SQLite.

Ans.

MySQL is a full-featured relational database management system, while SQLite is a lightweight, serverless, self-contained database engine.

  • MySQL is designed for larger applications with client-server architecture, while SQLite is suitable for smaller projects or embedded systems.

  • MySQL supports multiple users and concurrent connections, while SQLite is limited to single-user access.

  • MySQL has more advanced features like stored procedures, triggers, and views, while SQLite is sim...read more

Add your answer

Q77. Sort an array without inbuilt methods

Ans.

Sorting an array of strings without using inbuilt methods

  • Use a sorting algorithm like bubble sort, selection sort, or insertion sort

  • Compare each element with the next one and swap if necessary

  • Repeat the process until the array is sorted

Add your answer

Q78. What is interfaces in java

Ans.

Interfaces in Java are a way to achieve abstraction and multiple inheritance by defining a contract that classes must implement.

  • Interfaces in Java are similar to classes but can only contain method signatures and constants, not method implementations.

  • Classes can implement multiple interfaces, allowing them to inherit behavior from multiple sources.

  • Interfaces are used to achieve abstraction and decouple the implementation from the interface, promoting flexibility and reusabili...read more

Add your answer

Q79. What is the javascript

Ans.

JavaScript is a programming language used for creating interactive web pages and web applications.

  • JavaScript is a high-level, interpreted language.

  • It is primarily used for client-side scripting.

  • JavaScript can be embedded directly into HTML pages.

  • It provides dynamic functionality and interactivity to websites.

  • Common uses include form validation, DOM manipulation, and AJAX requests.

View 1 answer

Q80. How I will reallocate

Ans.

I will reallocate resources based on project priorities and team needs.

  • Prioritize tasks based on project deadlines and importance

  • Communicate with team members to understand their workload and availability

  • Adjust resources as needed to ensure project success

  • Example: If a critical project is falling behind schedule, I may reallocate resources from less urgent projects to meet the deadline

Add your answer

Q81. what is linked list

Ans.

A linked list is a linear data structure where elements are stored in nodes that have a reference to the next node in the sequence.

  • Consists of nodes connected by pointers

  • Does not have a fixed size like arrays

  • Allows for efficient insertion and deletion operations

  • Example: Singly linked list, Doubly linked list

Add your answer

Q82. multi source bfs on the array

Ans.

Multi-source BFS on an array of strings involves finding the shortest path from multiple starting points to a target point.

  • Implement BFS algorithm to traverse the array of strings starting from multiple sources simultaneously.

  • Maintain a queue of nodes to visit next, and keep track of visited nodes to avoid revisiting.

  • Update the distance of each node from the sources as you traverse the array.

  • Example: Given an array of strings representing a grid, find the shortest path from m...read more

Add your answer

Q83. coding program and complexity

Ans.

Coding programs can vary in complexity depending on the requirements and functionalities needed.

  • Complexity can be measured using Big O notation, which describes the worst-case scenario for time and space complexity.

  • Factors affecting complexity include data structures used, algorithms implemented, and the size of input data.

  • Examples of complex programs include machine learning algorithms, large-scale distributed systems, and real-time processing applications.

Add your answer

Q84. Subarray finding maximum

Ans.

Find the maximum sum of a subarray within an array of strings.

  • Iterate through the array and keep track of the maximum sum of subarrays.

  • Use Kadane's algorithm to efficiently find the maximum sum subarray.

  • Example: ['1', '2', '-3', '4', '5', '-6'] -> Maximum sum subarray is ['4', '5'].

Add your answer

Q85. binary search on array

Ans.

Binary search is a fast search algorithm that finds the position of a target value within a sorted array.

  • Ensure the array is sorted before performing binary search.

  • Compare the target value with the middle element of the array.

  • If the target value is less than the middle element, search the left half of the array. If it is greater, search the right half.

  • Repeat the process until the target value is found or the subarray is empty.

Add your answer

Q86. HASHMAP ,find the all buddy

Ans.

A HashMap is a data structure that stores key-value pairs. To find all buddies in a HashMap, we need to iterate through the entries and compare values.

  • Iterate through the entries of the HashMap

  • Compare values to find buddies

  • Store buddies in an array of strings

Add your answer

Q87. Trees based on meduim problem

Ans.

Trees are data structures used to store hierarchical data. They are commonly used in algorithms and problem-solving.

  • Trees have a root node and branches that connect to other nodes.

  • Common tree traversal methods include in-order, pre-order, and post-order.

  • Examples of tree-based problems include finding the lowest common ancestor, balancing a binary search tree, and implementing a trie data structure.

Add your answer

Q88. develop Snake game

Ans.

Develop a classic Snake game using JavaScript and HTML5 canvas.

  • Use HTML5 canvas to draw the game board and snake.

  • Implement logic for snake movement and collision detection.

  • Add functionality for snake to grow when eating food.

  • Track score and display it on the screen.

  • Handle game over condition when snake collides with walls or itself.

Add your answer

More about working at Google

Top Rated Large Company - 2024
Top Rated Internet/Product Company - 2024
HQ - Mountain View,California, United States
Contribute & help others!
Write a review
Share interview
Contribute salary
Add office photos

Interview Process at null

based on 55 interviews in the last 1 year
3 Interview rounds
Coding Test Round 1
Coding Test Round 2
HR Round
View more
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories

Top Software Developer Interview Questions from Similar Companies

3.8
 • 40 Interview Questions
3.5
 • 26 Interview Questions
3.5
 • 24 Interview Questions
3.7
 • 24 Interview Questions
4.1
 • 11 Interview Questions
4.4
 • 10 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
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