Publicis Sapient
Goodmaysys Software Technologies Pvt Ltd | Software Development Company Interview Questions and Answers
Q1. Next Greater Element Problem Statement
You are given an array arr
of length N
. For each element in the array, find the next greater element (NGE) that appears to the right. If there is no such greater element, ...read more
The task is to find the next greater element for each element in an array to its right, if no greater element exists, return -1.
Iterate through the array from right to left and use a stack to keep track of elements.
Pop elements from the stack until a greater element is found or the stack is empty.
Store the next greater element for each element in the output array.
Q2. Count Substrings with K Distinct Characters
Given a lowercase string 'STR' and an integer K, the task is to count all possible substrings that consist of exactly K distinct characters. These substrings are not ...read more
Count substrings with exactly K distinct characters in a given lowercase string.
Iterate through all substrings of the given string and count the number of distinct characters in each substring.
Keep track of substrings with exactly K distinct characters and increment the count.
Return the total count of substrings with exactly K distinct characters.
Q3. How to switch on and off the bulb by one button using JavaScript
Use JavaScript to switch on and off a bulb with one button.
Create a variable to store the state of the bulb (on/off)
Add an event listener to the button
Toggle the state of the bulb variable on each button click
Update the bulb image or class based on the state of the bulb variable
Q4. How to create table using html, how to color one row, how to merge specific coloum
To create a table using HTML, color one row, and merge specific columns, use <table>, <tr>, <td>, and <th> tags with CSS styling.
Create a table using <table>, <tr>, <td>, and <th> tags
Color one row using CSS by targeting the <tr> element with a specific class or inline style
Merge specific columns using the colspan attribute in the <td> or <th> tags
Q5. What is join in sql, how to join two table and what types of join used
Join in SQL is used to combine data from two or more tables based on a related column between them.
Types of joins: Inner join, Left join, Right join, Full outer join, Cross join
Syntax: SELECT * FROM table1 JOIN table2 ON table1.column = table2.column
Example: SELECT * FROM customers JOIN orders ON customers.customer_id = orders.customer_id
JOINS in SQL are used to combine rows from two or more tables based on a related column between them.
JOINS are used to retrieve data from multiple tables based on a related column
Types of JOINS include INNER JOIN, LEFT JOIN, RIGHT JOIN, and FULL JOIN
Example: SELECT * FROM table1 INNER JOIN table2 ON table1.column = table2.column
Interview Process at Goodmaysys Software Technologies Pvt Ltd | Software Development Company
Reviews
Interviews
Salaries
Users/Month