Alcon
Jobility Interview Questions and Answers
Q1. write a program to show if a program is prime or not
A program to determine if a number is prime or not.
A prime number is a number greater than 1 that has no positive divisors other than 1 and itself.
To check if a number is prime, iterate from 2 to the square root of the number and check if any of them divides the number evenly.
If any divisor is found, the number is not prime. Otherwise, it is prime.
Q2. what is mutable and immuatble data types give example
Mutable data types can be modified after creation, while immutable data types cannot be modified.
Examples of mutable data types: lists, sets, dictionaries
Examples of immutable data types: strings, tuples, frozensets
Q3. what is the difference between dictionary list and tuple
A dictionary is an unordered collection of key-value pairs, while a list is an ordered collection of elements.
Dictionaries are accessed by keys, while lists are accessed by indices.
Dictionaries are mutable, while tuples are immutable.
Dictionaries can have duplicate values, but not duplicate keys.
Lists can contain elements of different data types, while tuples can contain elements of the same or different data types.
Q4. write a program to add two numbers without using the "+" operator at all
Program to add two numbers without using the '+' operator.
Use bitwise operators like XOR and AND to perform addition without '+' operator.
XOR the two numbers to get the sum without carry.
AND the two numbers and left shift the result to get the carry.
Repeat the process until carry becomes zero.
Q5. find the second largest number in an array
Find the second largest number in an array.
Sort the array in descending order
Return the element at index 1
Q6. is a dictionary mutable
Yes, a dictionary is mutable in Python.
A dictionary in Python can be modified by adding, updating, or deleting key-value pairs.
The values associated with keys in a dictionary can be changed.
Dictionaries are mutable objects, meaning they can be modified in-place.
The 'update()' method can be used to add or update multiple key-value pairs at once.
Interview Process at Jobility
Top Intern Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month