HeadSpin Technologies
10+ BIM SERVICES. DDG Interview Questions and Answers
Q1. On what 3 conditions are two tables joined in sql?
Tables are joined in SQL based on common columns, specified conditions, and join type.
Common columns: Tables are joined based on columns that have the same values in both tables.
Specified conditions: Join conditions are specified using the ON keyword in SQL.
Join type: Different types of joins like INNER JOIN, LEFT JOIN, RIGHT JOIN, and FULL JOIN determine how the tables are joined.
Q2. How to do context management in python?
Context management in Python is handled using the 'with' statement to ensure resources are properly managed and released.
Use the 'with' statement to create a context manager
Implement the __enter__() and __exit__() methods in a class to define the behavior of the context manager
Resources like files, database connections, or locks can be managed using context managers
Example: with open('file.txt', 'r') as file: # File operations here
Q3. How to do file operations in Python?
File operations in Python involve opening, reading, writing, and closing files.
Use the 'open()' function to open a file in different modes (read, write, append, etc.)
Use 'read()' or 'readline()' to read content from a file
Use 'write()' to write content to a file
Remember to close the file using 'close()' to free up system resources
Q4. What are some common git commands?
Common git commands include add, commit, push, pull, clone, and merge.
git add
: Add file changes to the staging area git commit -m 'message': Commit staged changes with a message
git push: Push committed changes to a remote repository
git pull: Fetch and merge changes from a remote repository
git clone
: Clone a repository from a remote location git merge
: Merge changes from a different branch
Q5. Difference between "==" operator and "is" keyword?
The '==' operator compares the values of two objects, while the 'is' keyword checks if two objects are the same instance.
Use '==' for value comparison, use 'is' for object identity comparison
Example: x == y (compares values), x is y (checks if same instance)
The '==' operator can be overloaded by classes, but 'is' cannot be overloaded
Q6. What is init method in python?
The init method in Python is a special method used to initialize objects of a class.
The init method is called when a new object is created from a class.
It is used to initialize the attributes of the object.
The init method is defined with the __init__ keyword in Python.
Example: class MyClass: def __init__(self, x): self.x = x obj = MyClass(5)
Q7. What are types of Join in SQL?
Types of joins in SQL include INNER JOIN, LEFT JOIN, RIGHT JOIN, and FULL JOIN.
INNER JOIN: Returns rows when there is at least one match in both tables.
LEFT JOIN: Returns all rows from the left table and the matched rows from the right table.
RIGHT JOIN: Returns all rows from the right table and the matched rows from the left table.
FULL JOIN: Returns rows when there is a match in one of the tables.
Q8. What does sudo mean in linux?
sudo stands for 'superuser do' and is a command in Unix/Linux systems that allows a permitted user to execute a command as the superuser or another user.
sudo allows users to perform administrative tasks without logging in as the root user
It is commonly used to run commands that require elevated privileges, such as installing software or modifying system files
Example: sudo apt-get update
Q9. What is indexing in SQL?
Indexing in SQL is a way to optimize the performance of queries by creating a data structure that allows for faster retrieval of data.
Indexes are created on columns in a table to speed up the retrieval of rows based on certain conditions.
Types of indexes include clustered, non-clustered, unique, and composite indexes.
Examples of SQL indexing commands include CREATE INDEX, DROP INDEX, and ALTER INDEX.
Q10. What are callback functions?
Callback functions are functions that are passed as arguments to other functions and are executed after a certain task is completed.
Callback functions are commonly used in asynchronous programming to handle tasks that take time to complete.
They allow for more flexible and modular code by separating concerns.
An example of a callback function is the setTimeout function in JavaScript, where a function is executed after a specified time interval.
Q11. Difference between Lists and Tuples?
Lists are mutable, ordered collections while tuples are immutable, ordered collections.
Lists can be modified after creation, tuples cannot.
Lists are denoted by square brackets [], tuples by parentheses ().
Lists are typically used for collections of similar items, tuples for fixed collections of different items.
Interview Process at BIM SERVICES. DDG
Top Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month