0% found this document useful (0 votes)
4 views

Interview Asked Questions

The document contains a comprehensive set of questions and practical exercises related to Python, SQL, and Power BI, covering fundamental concepts, advanced topics, and hands-on coding tasks. It includes definitions, explanations of key features, and examples for various programming and database management concepts. Additionally, it provides practical coding challenges for Python and detailed questions about SQL commands and Power BI functionalities.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

Interview Asked Questions

The document contains a comprehensive set of questions and practical exercises related to Python, SQL, and Power BI, covering fundamental concepts, advanced topics, and hands-on coding tasks. It includes definitions, explanations of key features, and examples for various programming and database management concepts. Additionally, it provides practical coding challenges for Python and detailed questions about SQL commands and Power BI functionalities.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Python

Questions
What is Python?
What are Python's key features?
How is memory managed in Python?
What is the difference between deep copy and shallow copy?
what are the data types in Python?
Explain the difference between a list and a tuple.
What are Python decorators and how are they used?
How does Python handle type conversion?
What are lambda functions in Python? Provide an example.
What are Python's built-in data types?
Explain the use of self in Python classes.
How do you handle exceptions in Python?
What is the difference between args and *kwargs in function definitions?
What is a Python generator?
Explain the difference between range and xrange.
How do you manage packages in Python?
What is the Global Interpreter Lock (GIL)?
What is the difference between is and == in Python?
How can you achieve multithreading in Python?
Explain list comprehensions with an example.
What is the purpose of the init method in Python?
How do you create a virtual environment in Python?
What is virtual environment ?
Explain indexing and slicing.
What is lambda in python?
What is map,reduce and filter in python?
Difference between str() and repr().
Explain serialization and deserialization / Pickling and unpicking.
What is list / dict compression.
What are higher ordered functions.
How to copy object in Python
what is multithreading?
what is exceptional handling?
what is file handling?
What is exec() and eval ()
How to pass command line argument.
What is yield ?
What is ord() and chr()
What are Metaclasses.
What is descriptor ?
What is namespace in Python? namespace vs scope ?
What is MRO ?
What is diamond problem in Python
What are higher ordered functions.
Is Python a compiled language or an interpreted language?

Practical Questions
Odd or Even Class
Write a class that takes an integer as input and determines if the number is odd or even.

Class Name: OddEvenChecker


Method:

check_odd_even(self, num: int) -> str: Returns "Even" if the number is even, otherwise
"Odd".
Example:
Input: 4
Output: "Even"

2. Factorial Calculation
Write a class that computes the factorial of a given number using recursion.

Class Name: FactorialCalculator


Method:

calculate_factorial(self, num: int) -> int: Returns the factorial of the input number.
Example:
Input: 5
Output: 120

3. Prime Number Checker


Write a class that checks if a given number is a prime number.

Class Name: PrimeChecker


Method:

is_prime(self, num: int) -> bool: Returns True if the number is prime, otherwise False.
Example:
Input: 7
Output: True

4. Fibonacci Sequence
Write a class that generates the Fibonacci sequence up to a given number of terms.

Class Name: FibonacciGenerator


Method:

generate_fibonacci(self, n: int) -> list: Returns a list of the first n terms of the Fibonacci
sequence.
Example:
Input: 5
Output: [0, 1, 1, 2, 3]

5. Palindrome Checker for Integers


Write a class that checks if a given integer is a palindrome (i.e., it reads the same forwards
and backward).

Class Name: PalindromeChecker


Method:

is_palindrome(self, num: int) -> bool: Returns True if the number is a palindrome, otherwise
False.
Example:
Input: 121
Output: True

6. Armstrong Number Checker


Write a class that checks if a number is an Armstrong number (i.e., the sum of the cubes of
its digits equals the number itself, for a 3-digit number).

Class Name: ArmstrongChecker


Method:

is_armstrong(self, num: int) -> bool: Returns True if the number is an Armstrong number,
otherwise False.
Example:
Input: 153
Output: True

7. Sum of Digits
Write a class that calculates the sum of digits of a given number.

Class Name: DigitSumCalculator


Method:

sum_of_digits(self, num: int) -> int: Returns the sum of the digits of the input number.
Example:
Input: 123
Output: 6

8. Find Maximum of Three Numbers


Write a class that finds the maximum of three numbers.

Class Name: MaxFinder


Method:

find_max(self, a: int, b: int, c: int) -> int: Returns the largest number among the three.
Example:
Input: 3, 7, 5
Output: 7

9. Leap Year Checker


Write a class that checks if a given year is a leap year.

Class Name: LeapYearChecker


Method:

is_leap_year(self, year: int) -> bool: Returns True if the year is a leap year, otherwise False.
Example:
Input: 2024
Output: True

10. LCM of Two Numbers


Write a class that calculates the least common multiple (LCM) of two numbers.

Class Name: LCMCalculator


Method:

calculate_lcm(self, a: int, b: int) -> int: Returns the LCM of the two numbers.
Example:
Input: 4, 6
Output: 12

SQL

1. What is SQL?
2. What are the different types of SQL commands?
3. What is the difference between DELETE, TRUNCATE, and DROP?
4. Explain the use of JOIN and list its types.
5. What is a primary key?
6. What is a foreign key?
7. What is a unique key?
8. Explain the difference between WHERE and HAVING clauses.
9. What are aggregate functions? Name a few.
10. How does the GROUP BY clause work?
11. What is a NULL value, and how does it differ from zero?
12. Explain the ORDER BY clause.
13. What is the use of the LIKE operator?
14. What are indexes, and why are they used?
15. What is a view, and how is it created?
16. What is the difference between CHAR and VARCHAR data types?
17. How do you retrieve the current date in SQL?
18. Explain the use of DISTINCT keyword.
19. What is the BETWEEN operator?
20. How do you use the IN clause in SQL?

Intermediate SQL Questions

21. What is a subquery?


22. Explain correlated and non-correlated subqueries.
23. What is the difference between INNER JOIN and OUTER JOIN?
24. What is a self-join?
25. How does a CROSS JOIN work?
26. What is a composite key?
27. How does UNION differ from UNION ALL?
28. What is a stored procedure, and why is it used?
29. What are triggers in SQL?
30. Explain the concept of normalization and its types.
31. What are SQL constraints?
32. How does RANK() differ from ROW_NUMBER()?
33. Explain the COALESCE function.
34. What is a CTE (Common Table Expression)?
35. How do you remove duplicate records from a table?
36. Explain window functions in SQL.
37. What is AUTO_INCREMENT?
38. How does the CASE statement work in SQL?
39. What are transactions, and how are they handled in SQL?
40. Explain ACID properties in SQL.
41. What is ROLLBACK and COMMIT?

Power BI
PBI elements or ecosystem: Power BI Desktop, PBI Service, PBI Mobile App
. Power BI Desktop Navigation
. PBI Building Blocks (Visualizations, Semantic Model, Reports, Dashboard)
. Get Data (From Excel, Sharepoint, OneDrive, Snowflake etc.)
. Connections Import, Direct Query and Live Data
. Import and Direct Query
. Transformation (Power Query Editor)
. Transformation GUI
. Using Power Query to clean, transform and load data, Profiling your data
. Group By
. Merge Queries, Append Queries and Combine Files
. Semantic Model, Data Modeling, Manage Relationships, Cardinality, Cross-Filter direction,
New Table or Enter data, show/hide table or column
. Table View
. Calculated Column, Measure, Filter Context, Quick Measure
. Report View- Visualization Chart, Slicer, Card, Table, Matrix, AI Visuals, Power Platform
Visual, Q&A Visual, Paginated Reports
Discuss Report settings, Choosing the right visualizations,
. Fields Parameter, Numeric range parameter,
. Theme
. FIlters (Slicers, Visual, Page and Report Level)
. Bookmarks in Report Design
. Selection Pane
. Sync Slicers
. Personal Bookmark in PBI Service (Capture Current State of Report)
. Pause Visuals, Apply All Slicers
. Share Reports
. Create Dashboards
. DAX
Aggregate Functions: Sum, Count, CountRows, Sum vs SumX
Date and Time Functions: Date, Calendar, CalendarAuto, DateDiff, Today, Year, Month, Now,
UTCNow,
Math and Trig Functions: DIVIDE, Convert, CEILING, FLoor, Currency, INT, MOD,
QUOTIENT, ROUND, ROUNDUP,TRUNC
FILTER FUnctions: ALL,ALLCROSSFILTERED,ALLSELECTED, ALLEXCEPT,CALCULATE,
CALCULATE TABLE, FIlter, KEEPFILTERS,LOOKUPVALUE,REMOVEFILTERS,
SELECTEDVALUE
Financial Functions: many functions like DURATION
Information Functions: CONTAINS,ISBLANK, ISEMPTY,
ISERROR,ISNUMBER,ISTEXT,HASONEFILTER,HASONEVALUE,INFO.CATALOGS(Repre
sents the DBSCHEMA_CATALOGS DMV query function.), INFO.FUNCTIONS,
INFO.MEASURES,
USERNAME, USERPRINCIPALNAME,
Logical Functions: AND,COALESCE, IF, FALSE, IF.EAGER, IFERROR, NOT, NOT, OR,
SWITCH, TRUE
Other Functions: BLANK, EARLIER, ERROR (Raises a user specified error.), LOOKUP,
MOVINGAVERAGE, RANK, ROWNumber, RUNNINGSUM,
Relationships management Functions: CROSSFILTER, RELATED, RELATEDTABLE,
USERELATIONSHIP

You might also like