Tech Q Ware Technologies
10+ DAR Engineering 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)
Q7. What is class method vs instance methods
Class methods are called on the class itself, while instance methods are called on instances of the class.
Class methods are defined using 'self' keyword in the method name.
Instance methods are defined without 'self' keyword in the method name.
Class methods are used for operations that are not specific to any instance of the class.
Instance methods are used for operations that are specific to individual instances of the class.
Q8. Difference between extend prepand include?
extend adds class methods, prepend adds instance methods, include adds module methods
extend adds methods to a class as class methods
prepend adds methods to a class as instance methods
include adds methods to a class as module methods
Q9. What is mixins in ruby
Mixins in Ruby are a way to add functionality to a class without inheritance.
Mixins are modules that can be included in a class to extend its functionality.
They allow for code reuse and help avoid duplication.
Mixins are included using the 'include' keyword in Ruby.
Q10. Write custom flatten in ruby
Custom implementation of flatten method in Ruby
Create a recursive function to iterate through the array elements
Check if each element is an array or not, if it is an array then call the function recursively
Concatenate the elements into a single array and return the result
Interview Process at DAR Engineering
Top Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month