Find Interview Questions for Top Companies
Faberwork Interview Questions and Answers
Ques:- What is serialization and why we are using it?
Right Answer:
Serialization is the process of converting a Python object into a format that can be easily stored or transmitted, such as JSON or XML. We use it to save the state of an object to a file or database, or to send it over a network, allowing it to be reconstructed later.
Ques:- Describe how exceptions are handled in python.
Comments
Admin May 17, 2020

Errors detected during execution of program are called exceptions. Exceptions can be handled using the try..except statement. We basically put our usual statements within the try-block and put all our error handlers in the except-block.
try…except demo code:
>>> while True:
try:
x = int(raw_input("Enter no. of your choice: "))
break
except ValueError:
print "Oops! Not a valid number. Attempt again"
Enter no. of your choice: 12ww
Oops! Not a valid number. Attempt again
Enter no. of your choice: hi there
Oops! Not a valid number. Attempt again
Enter no. of your choice: 22
>>>

Ques:- Explain how to create a multidimensional list.
Comments
Admin May 17, 2020

There are two ways in which Multidimensional list can be created:
By direct initializing the list as shown below to create multidimlist below
>>>multidimlist = [ [227, 122, 223],[222, 321, 192],[21, 122, 444]]
>>>print multidimlist[0]
>>>print multidimlist[1][2]
__________________________
Output
[227, 122, 223]
192
The second approach is to create a list of the desired length first and then fill in each element with a newly created lists demonstrated below :
>>>list=[0]*3
>>>for i in range(3):
>>> list[i]=[0]*2
>>>for i in range (3):
>>> for j in range(2):
>>> list[i][j] = i+j
>>>print list
__________________________
Output
[[0, 1], [1, 2], [2, 3]]

Ques:- What are the different types of APIs
Right Answer:
The different types of APIs are:

1. **Open APIs (Public APIs)** - Available to developers and third parties.
2. **Internal APIs (Private APIs)** - Used within an organization.
3. **Partner APIs** - Shared with specific business partners.
4. **Composite APIs** - Combine multiple endpoints into a single call.
5. **Web APIs** - Accessible over the internet using HTTP/HTTPS.
Ques:- What is a web service and how does it relate to an API
Right Answer:
A web service is a standardized way of allowing different applications to communicate over the internet using protocols like HTTP. It provides a method for applications to exchange data and perform operations. An API (Application Programming Interface) is a set of rules and tools that allows different software applications to interact with each other. A web service is a type of API that specifically uses web protocols to enable this interaction.
Ques:- What is rate limiting in APIs and how is it implemented
Right Answer:
Rate limiting in APIs is a technique used to control the number of requests a user can make to an API within a specific time period. It is implemented by setting thresholds (e.g., requests per minute) and using mechanisms like tokens, counters, or IP address tracking to monitor and restrict access when the limit is exceeded.
Ques:- What is the difference between synchronous and asynchronous API calls
Right Answer:
Synchronous API calls wait for the response before moving on to the next task, while asynchronous API calls allow the program to continue executing other tasks while waiting for the response.
Ques:- What is CORS and how does it affect API development
Right Answer:
CORS, or Cross-Origin Resource Sharing, is a security feature implemented by web browsers that allows or restricts web applications from making requests to a domain different from the one that served the web page. It affects API development by requiring developers to configure their APIs to specify which origins are allowed to access their resources, ensuring that only trusted domains can interact with the API.
Ques:- How does getopts command work?
Asked In :- Faberwork,
Right Answer:
The `getopts` command in shell scripting is used to parse command-line options and arguments. It processes options specified by a string of valid option characters, allowing you to handle flags (like `-a`, `-b`) and their associated values. The syntax typically involves a loop that calls `getopts` with the option string and a variable to store the current option. For example:

```bash
while getopts "ab:c:" opt; do
case $opt in
a) echo "Option A";;
b) echo "Option B with value $OPTARG";;
c) echo "Option C with value $OPTARG";;
*) echo "Invalid option";;
esac
done
```

In this example, `-a` is a flag, `-b` and `-c` require values, and `$OPTARG` holds the value for those options.
AmbitionBox Logo

What makes Takluu valuable for interview preparation?

1 Lakh+
Companies
6 Lakh+
Interview Questions
50K+
Job Profiles
20K+
Users