Add office photos
Engaged Employer

TCS

3.7
based on 84k Reviews
Filter interviews by

10+ Interview Questions and Answers

Updated 5 Feb 2024
Popular Designations

Q1. Write a Program for reversing a string without using inbuilt methods

Ans.

Program to reverse a string without using inbuilt methods

  • Create an empty string to store the reversed string

  • Loop through the original string from the end to the beginning

  • Add each character to the empty string

  • Return the reversed string

Add your answer

Q2. What are the Python data structures and about oops

Ans.

Python data structures include lists, tuples, sets, and dictionaries. OOPs is a programming paradigm.

  • Python data structures are used to store and organize data in a program

  • Lists are ordered and mutable, tuples are ordered and immutable, sets are unordered and unique, and dictionaries are unordered key-value pairs

  • OOPs is a programming paradigm that focuses on creating objects that have properties and methods

  • In Python, classes are used to create objects and encapsulate data and...read more

Add your answer

Q3. What is decorator with an example

Ans.

Decorator is a design pattern that allows behavior to be added to an individual object, either statically or dynamically.

  • Decorator pattern involves a set of decorator classes that are used to wrap concrete components.

  • Decorators provide a flexible alternative to subclassing for extending functionality.

  • An example of decorator pattern is adding toppings to a pizza. Each topping is a decorator that wraps the pizza object.

  • Another example is adding borders, shadows, and other effec...read more

Add your answer

Q4. How to perform crud operations in python

Ans.

CRUD operations in Python can be performed using various libraries and frameworks.

  • Use SQLalchemy ORM for database operations

  • Use Flask or Django for building web applications

  • Use pandas library for data manipulation

  • Use file handling functions for file operations

Add your answer
Discover null interview dos and don'ts from real experiences

Q5. Types of path and which one is used

Ans.

There are two types of paths - relative and absolute. Both are used depending on the context.

  • Relative paths are used to navigate within the current directory or subdirectories.

  • Absolute paths are used to navigate to a specific location in the file system.

  • Examples of relative paths: './file.txt', '../folder/file.txt'

  • Examples of absolute paths: '/home/user/file.txt', 'C:/Users/user/Documents/file.txt'

Add your answer

Q6. Program for create list from given dictionary

Ans.

A program to create a list from a given dictionary.

  • Iterate through the dictionary and append each key-value pair to a list.

  • Use list comprehension to create a list from the dictionary.

  • Sort the list based on keys or values if required.

Add your answer

Q7. What is pickling and unpickling

Ans.

Pickling is the process of converting a Python object into a byte stream, while unpickling is the reverse process.

  • Pickling is used to store Python objects in a file or transfer them over a network.

  • Unpickling is used to retrieve the original Python object from the stored byte stream.

  • The pickle module in Python is used for pickling and unpickling.

  • Example: Pickling a list - pickle.dump([1, 2, 3], open('data.pkl', 'wb'))

  • Example: Unpickling a list - pickle.load(open('data.pkl', 'r...read more

Add your answer

Q8. Difference of deep copy and shallow copy

Ans.

Deep copy creates a new object with the same values as the original, while shallow copy creates a new object with references to the original's values.

  • Deep copy duplicates all nested objects and their values, while shallow copy only duplicates the top-level object.

  • Deep copy is more memory-intensive and time-consuming than shallow copy.

  • Example of deep copy: copying a list of dictionaries using deepcopy() in Python.

  • Example of shallow copy: copying a list using slice notation in ...read more

Add your answer

Q9. Explain Django Architecture

Ans.

Django follows Model-View-Controller (MVC) architectural pattern.

  • Django has a high-level architecture that follows the Model-View-Controller (MVC) architectural pattern.

  • The Model layer represents the database schema and business logic.

  • The View layer handles the presentation logic and renders the templates.

  • The Controller layer acts as an intermediary between the Model and View layers.

  • Django also includes a URL routing system and middleware for handling HTTP requests and respon...read more

Add your answer

Q10. Types of locators in selenium

Ans.

Locators in Selenium are used to identify web elements on a web page. There are several types of locators available.

  • Types of locators in Selenium include ID, Name, Class Name, Tag Name, Link Text, Partial Link Text, CSS Selector, and XPath.

  • ID and Name locators are the most commonly used and are unique to each element.

  • Class Name and Tag Name locators are used to identify multiple elements with the same class or tag name.

  • Link Text and Partial Link Text locators are used to iden...read more

Add your answer
Contribute & help others!
Write a review
Share interview
Contribute salary
Add office photos

Interview Process at null

based on 4 interviews in the last 1 year
1 Interview rounds
Technical Round
View more
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories
Share an Interview
Stay ahead in your career. Get AmbitionBox app
qr-code
Helping over 1 Crore job seekers every month in choosing their right fit company
70 Lakh+

Reviews

5 Lakh+

Interviews

4 Crore+

Salaries

1 Cr+

Users/Month

Contribute to help millions
Get AmbitionBox app

Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2024 Info Edge (India) Ltd.

Follow us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter