Celebal Tech Interview Questions + Coding Solutions – codewindow.in

Hot Topics

Celebal Tech Solutions

Technical Round

In this example, we are using the useState hook to create a piece of state called count with an initial value of 0. The useState hook returns an array with two elements: count and setCount. count is the current value of the state and setCount is a function that allows us to update the value of the state.
In the component, we display the current value of count and have a button that, when clicked, updates the value of count using setCount.
  1. Mapping through a list: a. Write a Python function that returns a new list with the squares of all the elements in a given list. b. Write a Python function that returns a new list with the cubes of all the elements in a given list.
  1. Function: a. Write a Python function that returns the sum of two numbers. b. Write a Python function that returns the product of two numbers.
This function can be written as a higher-order function that takes a list and a function that returns a Boolean value, indicating whether an element should be included in the result:
  1. Swagger: Swagger is a framework for defining, building, and documenting RESTful APIs. It provides a simple way to describe the structure of an API and its endpoints, as well as the request and response formats. Swagger can be used to generate documentation, client libraries, and server stubs in various programming languages, including Python.
In Python, the Swagger API can be defined using the Swagger specification, which is a JSON or YAML document that specifies the structure of the API and its endpoints. This document can then be used to generate client libraries and server stubs, or to serve as the source of truth for the API documentation.
For example, consider the following Swagger definition for an API that returns information about a list of books:
For example, consider a table named orders with columns order_id, customer_id, and order_total. To retrieve the customer ID of all customers who have placed an order with a total greater than the average order total, we can use the following subquery:
The subquery in this example calculates the average order total and returns it as a single value. The main query then uses this value as a condition to filter the results and return only the customer IDs of customers who have placed an order with a total greater than the average.
This code sets up a simple HTTP server that listens on port 8080. The http.server.SimpleHTTPRequestHandler class is used to handle incoming requests and return responses. The server uses the socketserver module to bind to a socket and listen for incoming connections.
When you run this code, the server will start listening on port 8080, and you can access it by opening a web browser and navigating to http://localhost:8080. You should see a directory listing of the current directory, and you can navigate to any files within that directory to see their contents.

      

Popular Category

Hot Topics

Go through our study material. Your Job is awaiting.

Categories