Tech Q Ware Technologies
CN Solutions Interview Questions and Answers
Q1. How to cut a cake in eight equal parts by using just three slices
Cut the cake horizontally with the first two slices, then stack the pieces and cut vertically with the third slice.
Cut the cake horizontally with the first slice, creating two equal halves.
Stack the two halves on top of each other and cut horizontally again with the second slice, creating four equal quarters.
Finally, stack the four quarters and cut vertically with the third slice, creating eight equal parts.
Q2. How to define models and connect with specific database?
Models are defined using classes or schemas in programming languages like Python or JavaScript, and connected to a specific database using ORM tools like SQLAlchemy or Mongoose.
Define models using classes or schemas that represent the structure of data in the database
Use ORM (Object-Relational Mapping) tools to connect models to the database
Specify the database connection details in the configuration file of the application
Use migrations to create or update database tables ba...read more
Q3. What is Oops and explain four pillars of Oops
Oops stands for Object-Oriented Programming. The four pillars of Oops are Inheritance, Encapsulation, Abstraction, and Polymorphism.
Inheritance allows a class to inherit properties and behavior from another class. For example, a 'Car' class can inherit from a 'Vehicle' class.
Encapsulation refers to the bundling of data and methods that operate on the data into a single unit. For example, using private variables and public methods in a class.
Abstraction involves hiding the com...read more
Q4. What is json and how to access elements in json
JSON is a lightweight data interchange format commonly used in web development to store and transmit data.
JSON stands for JavaScript Object Notation
It uses key-value pairs to store data
Access elements in JSON using dot notation or bracket notation
Example: accessing 'name' in JSON object - data.name
Example: accessing 'age' in JSON array - data[0].age
Q5. How to remove duplicates from an array
Use a Set to remove duplicates from an array of strings.
Create a Set from the array to automatically remove duplicates
Convert the Set back to an array to get unique values
Q6. Major difference between list and tuple?
List is mutable, tuple is immutable in Python.
List can be modified after creation, tuple cannot.
List uses square brackets [], tuple uses parentheses ().
List is slower than tuple due to mutability.
Example: list_example = [1, 2, 3], tuple_example = (1, 2, 3)
Interview Process at CN Solutions
Top Software Developer Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month