NeenOpal Intelligent Solutions
International Industrial Springs Interview Questions and Answers
Q1. Q2.) Difference between list and tuple? a = [1,2,3,4,5,6,7,8,9] print(a[-1:-5]) Without running this code in compiler, tell the output
The code will output an empty list as a result of slicing from -1 to -5 in the list 'a'.
Slicing in Python allows you to access a subset of elements in a list or tuple.
When slicing, the start index is inclusive and the end index is exclusive.
In this case, a[-1:-5] will result in an empty list because the start index -1 is greater than the end index -5.
Q2. Q1.) Given sample data in text, read it in python Solution: Take the text to notepad, save it as CSV and then read it in python Check the number of null values Check the number of unique values Make a new colum...
read moreRead sample data in text, check for null and unique values, create new column by multiplying two features
Save text data as CSV and read in Python using pandas
Use isnull() to check for null values
Use nunique() to check for unique values
Create a new column by multiplying two existing columns
Add the new column to the existing dataframe
Q3. Q4.) Fibonacci series in python
Fibonacci series is a sequence of numbers where each number is the sum of the two preceding ones.
Use a loop or recursion to generate Fibonacci series in Python.
Start with 0 and 1 as the first two numbers in the series.
Add the previous two numbers to get the next number in the series.
Q4. You have a 7 minutes hourglass and a 4 minutes hourglass, now figure out a way to calculate 9 minutes
To measure 9 minutes using 7 and 4 minutes hourglasses
Start both hourglasses at the same time
When the 4 minutes hourglass runs out, flip it immediately
When the 7 minutes hourglass runs out, flip the 4 minutes hourglass
When the 4 minutes hourglass runs out again, a total of 9 minutes have passed
Q5. Remove duplicates from an array without using any functions
Remove duplicates from an array without using any functions
Create an empty array to store unique values
Loop through the original array and check if the value is already in the unique array before adding it
Use nested loops to compare each element with all other elements in the array
Q6. Create a single dimensional array from a multi dimensional array
To create a single dimensional array from a multi dimensional array, use the flatten method in Python.
Use the flatten method in Python to convert a multi dimensional array into a single dimensional array.
Example: multi_array = [[1, 2], [3, 4], [5, 6]]
single_array = [item for sublist in multi_array for item in sublist]
Q7. how to removes duplicates in spark
Use dropDuplicates() function in Spark to remove duplicates from a DataFrame.
Use dropDuplicates() function on the DataFrame to remove duplicates based on all columns
Specify columns to check for duplicates by passing them as arguments to dropDuplicates() function
Example: df.dropDuplicates() or df.dropDuplicates(['col1', 'col2'])
Q8. List vs tuple difference
List is mutable, tuple is immutable in Python.
List can be modified after creation, tuple cannot be modified
List uses square brackets [], tuple uses parentheses ()
List is used for collections of items that may need to be changed, tuple is used for fixed collections
More about working at NeenOpal Intelligent Solutions
Interview Process at International Industrial Springs
Top Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month