Data Science Practice Questions: Roadmap-Wise Sheets
One practice sheet for every step of the Data Science roadmap. Click a sheet card to open its topics, then practise the questions.
1Sheet 1: Python & Programming
Weeks 1–3 · 5 topicsClick to open topics ▾
Sheet 1: Python & Programming
Weeks 1–3 · 5 topics
Practise: Python basics · 12 questionsEasy
- What are Python's main built-in data types? Give a practical example from a hypothetical ServiceNow project involving IT service management and enterprise workflow automation, and explain which checks or trade-offs matter most.
Show answer
int, float, complex, bool, str, list, tuple, set, dict and NoneType. Mutable ones are list, set and dict; the others are immutable. Example application: In a hypothetical ServiceNow project involving IT service management and enterprise workflow automation, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - What is the difference between list, tuple, set and dict in Python? Give a practical example from a hypothetical HCLTech project involving enterprise technology services and infrastructure, and explain which checks or trade-offs matter most.
Show answer
List: ordered and mutable. Tuple: ordered and immutable (hashable, slightly faster). Set: unordered, unique items, fast membership checks. Dict: key–value pairs with fast lookup by key. Example application: In a hypothetical HCLTech project involving enterprise technology services and infrastructure, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - What is the difference between iterators and iterables in Python? Give a practical example from a hypothetical TCS project involving enterprise IT services, integration, and client delivery, and explain which checks or trade-offs matter most.
Show answer
An iterable can produce an iterator (it has __iter__); an iterator has __next__ and remembers its position. A for-loop calls iter() on the iterable and then next() repeatedly. Example application: In a hypothetical TCS project involving enterprise IT services, integration, and client delivery, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - What is the difference between iterators and iterables in Python? Give a practical example from a hypothetical Uber project involving ride-hailing, driver operations, and real-time dispatch, and explain which checks or trade-offs matter most.
Show answer
An iterable can produce an iterator (it has __iter__); an iterator has __next__ and remembers its position. A for-loop calls iter() on the iterable and then next() repeatedly. Example application: In a hypothetical Uber project involving ride-hailing, driver operations, and real-time dispatch, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - Why are NumPy arrays faster than Python lists? Give a practical example from a hypothetical Stripe project involving online payments, billing, and financial infrastructure, and explain which checks or trade-offs matter most.
Show answer
They store same-type values in contiguous memory and run vectorised operations in compiled C, avoiding Python loop overhead and per-object type checks. Example application: In a hypothetical Stripe project involving online payments, billing, and financial infrastructure, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - Why are NumPy arrays faster than Python lists? Give a practical example from a hypothetical CRED project involving member rewards, credit-card payments, and financial products, and explain which checks or trade-offs matter most.
Show answer
They store same-type values in contiguous memory and run vectorised operations in compiled C, avoiding Python loop overhead and per-object type checks. Example application: In a hypothetical CRED project involving member rewards, credit-card payments, and financial products, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - Why are NumPy arrays faster than Python lists? Give a practical example from a hypothetical ServiceNow project involving IT service management and enterprise workflow automation, and explain which checks or trade-offs matter most.
Show answer
They store same-type values in contiguous memory and run vectorised operations in compiled C, avoiding Python loop overhead and per-object type checks. Example application: In a hypothetical ServiceNow project involving IT service management and enterprise workflow automation, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - What is the difference between iterators and iterables in Python? Give a practical example from a hypothetical Goldman Sachs project involving investment banking, markets, and risk analytics, and explain which checks or trade-offs matter most.
Show answer
An iterable can produce an iterator (it has __iter__); an iterator has __next__ and remembers its position. A for-loop calls iter() on the iterable and then next() repeatedly. Example application: In a hypothetical Goldman Sachs project involving investment banking, markets, and risk analytics, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - What is the difference between iterators and iterables in Python? Give a practical example from a hypothetical Cisco project involving networking, security, and collaboration infrastructure, and explain which checks or trade-offs matter most.
Show answer
An iterable can produce an iterator (it has __iter__); an iterator has __next__ and remembers its position. A for-loop calls iter() on the iterable and then next() repeatedly. Example application: In a hypothetical Cisco project involving networking, security, and collaboration infrastructure, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - What is the difference between iterators and iterables in Python? Give a practical example from a hypothetical Barclays project involving retail banking, trading, and financial compliance, and explain which checks or trade-offs matter most.
Show answer
An iterable can produce an iterator (it has __iter__); an iterator has __next__ and remembers its position. A for-loop calls iter() on the iterable and then next() repeatedly. Example application: In a hypothetical Barclays project involving retail banking, trading, and financial compliance, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - What are decorators in Python? Give a practical example from a hypothetical Tech Mahindra project involving telecom platforms, IT services, and digital transformation, and explain which checks or trade-offs matter most.
Show answer
A decorator wraps a function to add behaviour such as logging, timing or caching without changing its code. It is applied with the @name syntax above the function. Example application: In a hypothetical Tech Mahindra project involving telecom platforms, IT services, and digital transformation, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - What are decorators in Python?
Show answer
A decorator wraps a function to add behaviour such as logging, timing or caching without changing its code. It is applied with the @name syntax above the function.
Practise: Data structures · 12 questionsEasy
- What is the difference between == and is? Give a practical example from a hypothetical Oracle project involving enterprise databases, cloud infrastructure, and business applications, and explain which checks or trade-offs matter most.
Show answer
== compares values for equality, while is checks whether two names point to the same object in memory. Use is mainly for None checks. Example application: In a hypothetical Oracle project involving enterprise databases, cloud infrastructure, and business applications, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - What is NumPy broadcasting? Give a practical example from a hypothetical Oracle project involving enterprise databases, cloud infrastructure, and business applications, and explain which checks or trade-offs matter most.
Show answer
The rule that lets arrays of different shapes operate together by virtually stretching the smaller one, for example adding a scalar or a (3,) vector to a (4,3) matrix. Example application: In a hypothetical Oracle project involving enterprise databases, cloud infrastructure, and business applications, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - How do you handle missing values? Give a practical example from a hypothetical Oracle project involving enterprise databases, cloud infrastructure, and business applications, and explain which checks or trade-offs matter most.
Show answer
First understand why data is missing. Then drop rows or columns with too many nulls, impute with mean/median/mode or a model (KNN), add a 'was_missing' flag, and fit imputers on training data only. Example application: In a hypothetical Oracle project involving enterprise databases, cloud infrastructure, and business applications, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - Write a function to calculate RMSE without any library. Give a practical example from a hypothetical Oracle project involving enterprise databases, cloud infrastructure, and business applications, and explain which checks or trade-offs matter most.
Show answer
def rmse(y, p): return (sum((a - b) ** 2 for a, b in zip(y, p)) / len(y)) ** 0.5 Example application: In a hypothetical Oracle project involving enterprise databases, cloud infrastructure, and business applications, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - Difference between loc and iloc in Pandas? Give a practical example from a hypothetical Oracle project involving enterprise databases, cloud infrastructure, and business applications, and explain which checks or trade-offs matter most.
Show answer
loc selects by label (row and column names, inclusive of the end label); iloc selects by integer position (end-exclusive). Example application: In a hypothetical Oracle project involving enterprise databases, cloud infrastructure, and business applications, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - What is the difference between list, tuple, set and dict in Python? Give a practical example from a hypothetical Oracle project involving enterprise databases, cloud infrastructure, and business applications, and explain which checks or trade-offs matter most.
Show answer
List: ordered and mutable. Tuple: ordered and immutable (hashable, slightly faster). Set: unordered, unique items, fast membership checks. Dict: key–value pairs with fast lookup by key. Example application: In a hypothetical Oracle project involving enterprise databases, cloud infrastructure, and business applications, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - What are Python's main built-in data types? Give a practical example from a hypothetical Cisco project involving networking, security, and collaboration infrastructure, and explain which checks or trade-offs matter most.
Show answer
int, float, complex, bool, str, list, tuple, set, dict and NoneType. Mutable ones are list, set and dict; the others are immutable. Example application: In a hypothetical Cisco project involving networking, security, and collaboration infrastructure, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - What is a generator and when would you use one? Give a practical example from a hypothetical Oracle project involving enterprise databases, cloud infrastructure, and business applications, and explain which checks or trade-offs matter most.
Show answer
A function using yield that produces values lazily, one at a time. It saves memory when processing large files or streams because the full sequence is never held in RAM. Example application: In a hypothetical Oracle project involving enterprise databases, cloud infrastructure, and business applications, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - What is the Global Interpreter Lock (GIL)? Give a practical example from a hypothetical Oracle project involving enterprise databases, cloud infrastructure, and business applications, and explain which checks or trade-offs matter most.
Show answer
A mutex in CPython that lets only one thread execute Python bytecode at a time. Use multiprocessing for CPU-bound work and threads or asyncio for I/O-bound work. Example application: In a hypothetical Oracle project involving enterprise databases, cloud infrastructure, and business applications, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - What are decorators in Python? Give a practical example from a hypothetical Oracle project involving enterprise databases, cloud infrastructure, and business applications, and explain which checks or trade-offs matter most.
Show answer
A decorator wraps a function to add behaviour such as logging, timing or caching without changing its code. It is applied with the @name syntax above the function. Example application: In a hypothetical Oracle project involving enterprise databases, cloud infrastructure, and business applications, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - How do you use groupby with multiple aggregations? Give a practical example from a hypothetical Oracle project involving enterprise databases, cloud infrastructure, and business applications, and explain which checks or trade-offs matter most.
Show answer
df.groupby('region').agg(total=('sales','sum'), avg=('sales','mean')) gives named aggregations per group in one pass. Example application: In a hypothetical Oracle project involving enterprise databases, cloud infrastructure, and business applications, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - Pandas: find the top 3 products by revenue in each region. Give a practical example from a hypothetical Oracle project involving enterprise databases, cloud infrastructure, and business applications, and explain which checks or trade-offs matter most.
Show answer
(df.assign(rev=df.price * df.qty) .groupby(['region', 'product'])['rev'].sum() .reset_index() .sort_values('rev', ascending=False) .groupby('region').head(3)) Example application: In a hypothetical Oracle project involving enterprise databases, cloud infrastructure, and business applications, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift.
Practise: Functions & OOP · 12 questionsMedium
- What is the difference between a function and a method? Give a practical example from a hypothetical LinkedIn project involving professional networking, job discovery, and recruiting products, and explain which checks or trade-offs matter most.
Show answer
A method is a function that belongs to an object or class and receives the instance (self) as its first argument. Example application: In a hypothetical LinkedIn project involving professional networking, job discovery, and recruiting products, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - Write a function to calculate RMSE without any library. Give a practical example from a hypothetical Stripe project involving online payments, billing, and financial infrastructure, and explain which checks or trade-offs matter most.
Show answer
def rmse(y, p): return (sum((a - b) ** 2 for a, b in zip(y, p)) / len(y)) ** 0.5 Example application: In a hypothetical Stripe project involving online payments, billing, and financial infrastructure, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - What is the difference between a function and a method? Give a practical example from a hypothetical Swiggy project involving food delivery, logistics, and quick commerce, and explain which checks or trade-offs matter most.
Show answer
A method is a function that belongs to an object or class and receives the instance (self) as its first argument. Example application: In a hypothetical Swiggy project involving food delivery, logistics, and quick commerce, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - What is the difference between a function and a method? Give a practical example from a hypothetical ServiceNow project involving IT service management and enterprise workflow automation, and explain which checks or trade-offs matter most.
Show answer
A method is a function that belongs to an object or class and receives the instance (self) as its first argument. Example application: In a hypothetical ServiceNow project involving IT service management and enterprise workflow automation, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - Write a function to calculate RMSE without any library. Give a practical example from a hypothetical Walmart project involving retail commerce, inventory, and supply-chain operations, and explain which checks or trade-offs matter most.
Show answer
def rmse(y, p): return (sum((a - b) ** 2 for a, b in zip(y, p)) / len(y)) ** 0.5 Example application: In a hypothetical Walmart project involving retail commerce, inventory, and supply-chain operations, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - Write a function to calculate RMSE without any library. Give a practical example from a hypothetical JP Morgan Chase project involving banking, payments, and financial risk systems, and explain which checks or trade-offs matter most.
Show answer
def rmse(y, p): return (sum((a - b) ** 2 for a, b in zip(y, p)) / len(y)) ** 0.5 Example application: In a hypothetical JP Morgan Chase project involving banking, payments, and financial risk systems, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - What is the difference between a function and a method? Give a practical example from a hypothetical Oracle project involving enterprise databases, cloud infrastructure, and business applications, and explain which checks or trade-offs matter most.
Show answer
A method is a function that belongs to an object or class and receives the instance (self) as its first argument. Example application: In a hypothetical Oracle project involving enterprise databases, cloud infrastructure, and business applications, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - Write a function to calculate RMSE without any library. Give a practical example from a hypothetical Cisco project involving networking, security, and collaboration infrastructure, and explain which checks or trade-offs matter most.
Show answer
def rmse(y, p): return (sum((a - b) ** 2 for a, b in zip(y, p)) / len(y)) ** 0.5 Example application: In a hypothetical Cisco project involving networking, security, and collaboration infrastructure, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - Write a function to calculate RMSE without any library.
Show answer
def rmse(y, p): return (sum((a - b) ** 2 for a, b in zip(y, p)) / len(y)) ** 0.5 - What is the difference between a function and a method?
Show answer
A method is a function that belongs to an object or class and receives the instance (self) as its first argument. - What are lambda functions and where are they useful? Give a practical example from a hypothetical D. E. Shaw project involving quantitative research and financial technology, and explain which checks or trade-offs matter most.
Show answer
Small anonymous one-line functions, handy as arguments to sort, map, filter or Pandas apply. Example application: In a hypothetical D. E. Shaw project involving quantitative research and financial technology, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - What are lambda functions and where are they useful? Give a practical example from a hypothetical Razorpay project involving payment gateway, settlement, and merchant integrations, and explain which checks or trade-offs matter most.
Show answer
Small anonymous one-line functions, handy as arguments to sort, map, filter or Pandas apply. Example application: In a hypothetical Razorpay project involving payment gateway, settlement, and merchant integrations, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift.
Practise: NumPy · 12 questionsMedium
- What is NumPy broadcasting? Give a practical example from a hypothetical Amazon project involving an online marketplace, fulfilment operations, and cloud services, and explain which checks or trade-offs matter most.
Show answer
The rule that lets arrays of different shapes operate together by virtually stretching the smaller one, for example adding a scalar or a (3,) vector to a (4,3) matrix. Example application: In a hypothetical Amazon project involving an online marketplace, fulfilment operations, and cloud services, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - What is NumPy broadcasting? Give a practical example from a hypothetical Adobe project involving creative software, document workflows, and subscriptions, and explain which checks or trade-offs matter most.
Show answer
The rule that lets arrays of different shapes operate together by virtually stretching the smaller one, for example adding a scalar or a (3,) vector to a (4,3) matrix. Example application: In a hypothetical Adobe project involving creative software, document workflows, and subscriptions, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - What is NumPy broadcasting? Give a practical example from a hypothetical Intuit project involving financial software, tax preparation, and small-business tools, and explain which checks or trade-offs matter most.
Show answer
The rule that lets arrays of different shapes operate together by virtually stretching the smaller one, for example adding a scalar or a (3,) vector to a (4,3) matrix. Example application: In a hypothetical Intuit project involving financial software, tax preparation, and small-business tools, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - Why are NumPy arrays faster than Python lists? Give a practical example from a hypothetical Capgemini project involving client delivery, data platforms, and enterprise transformation, and explain which checks or trade-offs matter most.
Show answer
They store same-type values in contiguous memory and run vectorised operations in compiled C, avoiding Python loop overhead and per-object type checks. Example application: In a hypothetical Capgemini project involving client delivery, data platforms, and enterprise transformation, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - Why are NumPy arrays faster than Python lists? Give a practical example from a hypothetical Amazon project involving an online marketplace, fulfilment operations, and cloud services, and explain which checks or trade-offs matter most.
Show answer
They store same-type values in contiguous memory and run vectorised operations in compiled C, avoiding Python loop overhead and per-object type checks. Example application: In a hypothetical Amazon project involving an online marketplace, fulfilment operations, and cloud services, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - Why are NumPy arrays faster than Python lists? Give a practical example from a hypothetical Microsoft project involving developer tools, cloud services, and productivity applications, and explain which checks or trade-offs matter most.
Show answer
They store same-type values in contiguous memory and run vectorised operations in compiled C, avoiding Python loop overhead and per-object type checks. Example application: In a hypothetical Microsoft project involving developer tools, cloud services, and productivity applications, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - Why are NumPy arrays faster than Python lists? Give a practical example from a hypothetical PayPal project involving digital payments, merchant checkout, and transaction risk, and explain which checks or trade-offs matter most.
Show answer
They store same-type values in contiguous memory and run vectorised operations in compiled C, avoiding Python loop overhead and per-object type checks. Example application: In a hypothetical PayPal project involving digital payments, merchant checkout, and transaction risk, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - Why are NumPy arrays faster than Python lists? Give a practical example from a hypothetical Meesho project involving social commerce, seller listings, and logistics, and explain which checks or trade-offs matter most.
Show answer
They store same-type values in contiguous memory and run vectorised operations in compiled C, avoiding Python loop overhead and per-object type checks. Example application: In a hypothetical Meesho project involving social commerce, seller listings, and logistics, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - Why are NumPy arrays faster than Python lists? Give a practical example from a hypothetical Visa project involving card networks, authorization, and payment-risk systems, and explain which checks or trade-offs matter most.
Show answer
They store same-type values in contiguous memory and run vectorised operations in compiled C, avoiding Python loop overhead and per-object type checks. Example application: In a hypothetical Visa project involving card networks, authorization, and payment-risk systems, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - Why are NumPy arrays faster than Python lists?
Show answer
They store same-type values in contiguous memory and run vectorised operations in compiled C, avoiding Python loop overhead and per-object type checks. - Why are NumPy arrays faster than Python lists?
Show answer
They store same-type values in contiguous memory and run vectorised operations in compiled C, avoiding Python loop overhead and per-object type checks. - Why are NumPy arrays faster than Python lists?
Show answer
They store same-type values in contiguous memory and run vectorised operations in compiled C, avoiding Python loop overhead and per-object type checks.
Practise: Pandas · 12 questionsHard
- Difference between loc and iloc in Pandas? Give a practical example from a hypothetical Salesforce project involving CRM, sales operations, and customer data workflows, and explain which checks or trade-offs matter most.
Show answer
loc selects by label (row and column names, inclusive of the end label); iloc selects by integer position (end-exclusive). Example application: In a hypothetical Salesforce project involving CRM, sales operations, and customer data workflows, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - Difference between loc and iloc in Pandas? Give a practical example from a hypothetical Zepto project involving quick commerce, inventory, and last-mile delivery, and explain which checks or trade-offs matter most.
Show answer
loc selects by label (row and column names, inclusive of the end label); iloc selects by integer position (end-exclusive). Example application: In a hypothetical Zepto project involving quick commerce, inventory, and last-mile delivery, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - Pandas: merge vs join vs concat? Give a practical example from a hypothetical Infosys project involving enterprise consulting, digital platforms, and client transformation, and explain which checks or trade-offs matter most.
Show answer
merge joins on columns, SQL-style (how='inner', 'left', ...). join joins on the index. concat stacks DataFrames along rows or columns. Example application: In a hypothetical Infosys project involving enterprise consulting, digital platforms, and client transformation, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - Pandas: find the top 3 products by revenue in each region. Give a practical example from a hypothetical Zomato project involving food ordering, restaurant discovery, and delivery, and explain which checks or trade-offs matter most.
Show answer
(df.assign(rev=df.price * df.qty) .groupby(['region', 'product'])['rev'].sum() .reset_index() .sort_values('rev', ascending=False) .groupby('region').head(3)) Example application: In a hypothetical Zomato project involving food ordering, restaurant discovery, and delivery, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - How do you pivot data in Pandas? Give a practical example from a hypothetical Swiggy project involving food delivery, logistics, and quick commerce, and explain which checks or trade-offs matter most.
Show answer
pd.pivot_table(df, index='region', columns='month', values='sales', aggfunc='sum') reshapes long data into a summary matrix; melt() does the reverse. Example application: In a hypothetical Swiggy project involving food delivery, logistics, and quick commerce, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - Pandas: merge vs join vs concat? Give a practical example from a hypothetical Paytm project involving payments, merchant services, and financial products, and explain which checks or trade-offs matter most.
Show answer
merge joins on columns, SQL-style (how='inner', 'left', ...). join joins on the index. concat stacks DataFrames along rows or columns. Example application: In a hypothetical Paytm project involving payments, merchant services, and financial products, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - How do you pivot data in Pandas? Give a practical example from a hypothetical Morgan Stanley project involving wealth management, trading, and investment platforms, and explain which checks or trade-offs matter most.
Show answer
pd.pivot_table(df, index='region', columns='month', values='sales', aggfunc='sum') reshapes long data into a summary matrix; melt() does the reverse. Example application: In a hypothetical Morgan Stanley project involving wealth management, trading, and investment platforms, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - What is the difference between apply, map and applymap in Pandas? Give a practical example from a hypothetical HCLTech project involving enterprise technology services and infrastructure, and explain which checks or trade-offs matter most.
Show answer
map works element-wise on a Series, apply works on a Series or along a DataFrame axis, and applymap (now DataFrame.map) applies a function to every cell. Example application: In a hypothetical HCLTech project involving enterprise technology services and infrastructure, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - What is the difference between apply, map and applymap in Pandas?
Show answer
map works element-wise on a Series, apply works on a Series or along a DataFrame axis, and applymap (now DataFrame.map) applies a function to every cell. - Pandas: merge vs join vs concat?
Show answer
merge joins on columns, SQL-style (how='inner', 'left', ...). join joins on the index. concat stacks DataFrames along rows or columns. - How would you optimise a slow Pandas pipeline on a 5 GB file? Give a practical example from a hypothetical Cognizant project involving enterprise applications and healthcare or financial client systems, and explain which checks or trade-offs matter most.
Show answer
Read in chunks or use usecols and dtypes, convert strings to category, avoid apply with row loops in favour of vectorised ops, and consider Polars, Dask or Parquet storage. Example application: In a hypothetical Cognizant project involving enterprise applications and healthcare or financial client systems, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - How would you optimise a slow Pandas pipeline on a 5 GB file? Give a practical example from a hypothetical ServiceNow project involving IT service management and enterprise workflow automation, and explain which checks or trade-offs matter most.
Show answer
Read in chunks or use usecols and dtypes, convert strings to category, avoid apply with row loops in favour of vectorised ops, and consider Polars, Dask or Parquet storage. Example application: In a hypothetical ServiceNow project involving IT service management and enterprise workflow automation, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift.
2Sheet 2: Statistics & Probability
Weeks 4–5 · 4 topicsClick to open topics ▾
Sheet 2: Statistics & Probability
Weeks 4–5 · 4 topics
Practise: Descriptive statistics · 15 questionsEasy
- What is statistical power and how can you increase it? Give a practical example from a hypothetical Wipro project involving managed IT services, cloud migration, and digital transformation, and explain which checks or trade-offs matter most.
Show answer
Power is the probability of detecting a real effect. Increase it with a larger sample, a bigger effect size, lower noise or a higher significance level. Example application: In a hypothetical Wipro project involving managed IT services, cloud migration, and digital transformation, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - What is statistical power and how can you increase it? Give a practical example from a hypothetical Accenture project involving multi-client consulting, cloud transformation, and process automation, and explain which checks or trade-offs matter most.
Show answer
Power is the probability of detecting a real effect. Increase it with a larger sample, a bigger effect size, lower noise or a higher significance level. Example application: In a hypothetical Accenture project involving multi-client consulting, cloud transformation, and process automation, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - What is statistical power and how can you increase it? Give a practical example from a hypothetical LinkedIn project involving professional networking, job discovery, and recruiting products, and explain which checks or trade-offs matter most.
Show answer
Power is the probability of detecting a real effect. Increase it with a larger sample, a bigger effect size, lower noise or a higher significance level. Example application: In a hypothetical LinkedIn project involving professional networking, job discovery, and recruiting products, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - What is statistical power and how can you increase it? Give a practical example from a hypothetical Stripe project involving online payments, billing, and financial infrastructure, and explain which checks or trade-offs matter most.
Show answer
Power is the probability of detecting a real effect. Increase it with a larger sample, a bigger effect size, lower noise or a higher significance level. Example application: In a hypothetical Stripe project involving online payments, billing, and financial infrastructure, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - What is statistical power and how can you increase it? Give a practical example from a hypothetical PhonePe project involving UPI payments, merchant transactions, and financial services, and explain which checks or trade-offs matter most.
Show answer
Power is the probability of detecting a real effect. Increase it with a larger sample, a bigger effect size, lower noise or a higher significance level. Example application: In a hypothetical PhonePe project involving UPI payments, merchant transactions, and financial services, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - What is statistical power and how can you increase it? Give a practical example from a hypothetical Razorpay project involving payment gateway, settlement, and merchant integrations, and explain which checks or trade-offs matter most.
Show answer
Power is the probability of detecting a real effect. Increase it with a larger sample, a bigger effect size, lower noise or a higher significance level. Example application: In a hypothetical Razorpay project involving payment gateway, settlement, and merchant integrations, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - What is statistical power and how can you increase it? Give a practical example from a hypothetical Swiggy project involving food delivery, logistics, and quick commerce, and explain which checks or trade-offs matter most.
Show answer
Power is the probability of detecting a real effect. Increase it with a larger sample, a bigger effect size, lower noise or a higher significance level. Example application: In a hypothetical Swiggy project involving food delivery, logistics, and quick commerce, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - What is statistical power and how can you increase it? Give a practical example from a hypothetical Paytm project involving payments, merchant services, and financial products, and explain which checks or trade-offs matter most.
Show answer
Power is the probability of detecting a real effect. Increase it with a larger sample, a bigger effect size, lower noise or a higher significance level. Example application: In a hypothetical Paytm project involving payments, merchant services, and financial products, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - What is statistical power and how can you increase it? Give a practical example from a hypothetical Oracle project involving enterprise databases, cloud infrastructure, and business applications, and explain which checks or trade-offs matter most.
Show answer
Power is the probability of detecting a real effect. Increase it with a larger sample, a bigger effect size, lower noise or a higher significance level. Example application: In a hypothetical Oracle project involving enterprise databases, cloud infrastructure, and business applications, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - What is statistical power and how can you increase it? Give a practical example from a hypothetical HCLTech project involving enterprise technology services and infrastructure, and explain which checks or trade-offs matter most.
Show answer
Power is the probability of detecting a real effect. Increase it with a larger sample, a bigger effect size, lower noise or a higher significance level. Example application: In a hypothetical HCLTech project involving enterprise technology services and infrastructure, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - What is statistical power and how can you increase it? Give a practical example from a hypothetical Tech Mahindra project involving telecom platforms, IT services, and digital transformation, and explain which checks or trade-offs matter most.
Show answer
Power is the probability of detecting a real effect. Increase it with a larger sample, a bigger effect size, lower noise or a higher significance level. Example application: In a hypothetical Tech Mahindra project involving telecom platforms, IT services, and digital transformation, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - What is statistical power and how can you increase it?
Show answer
Power is the probability of detecting a real effect. Increase it with a larger sample, a bigger effect size, lower noise or a higher significance level. - What is statistical power and how can you increase it?
Show answer
Power is the probability of detecting a real effect. Increase it with a larger sample, a bigger effect size, lower noise or a higher significance level. - What is statistical power and how can you increase it?
Show answer
Power is the probability of detecting a real effect. Increase it with a larger sample, a bigger effect size, lower noise or a higher significance level. - What is statistical power and how can you increase it?
Show answer
Power is the probability of detecting a real effect. Increase it with a larger sample, a bigger effect size, lower noise or a higher significance level.
Practise: Probability distributions · 15 questionsEasy
- What is a Poisson distribution used for? Give a practical example from a hypothetical TCS project involving enterprise IT services, integration, and client delivery, and explain which checks or trade-offs matter most.
Show answer
Modelling the count of events in a fixed interval when events occur independently at a constant average rate, such as calls per hour or defects per batch. Example application: In a hypothetical TCS project involving enterprise IT services, integration, and client delivery, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - What is a normal distribution? Give a practical example from a hypothetical Amazon project involving an online marketplace, fulfilment operations, and cloud services, and explain which checks or trade-offs matter most.
Show answer
A symmetric bell-shaped distribution defined by mean and standard deviation, where about 68%, 95% and 99.7% of values lie within 1, 2 and 3 standard deviations. Example application: In a hypothetical Amazon project involving an online marketplace, fulfilment operations, and cloud services, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - What is a normal distribution? Give a practical example from a hypothetical Microsoft project involving developer tools, cloud services, and productivity applications, and explain which checks or trade-offs matter most.
Show answer
A symmetric bell-shaped distribution defined by mean and standard deviation, where about 68%, 95% and 99.7% of values lie within 1, 2 and 3 standard deviations. Example application: In a hypothetical Microsoft project involving developer tools, cloud services, and productivity applications, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - What is a Poisson distribution used for? Give a practical example from a hypothetical LinkedIn project involving professional networking, job discovery, and recruiting products, and explain which checks or trade-offs matter most.
Show answer
Modelling the count of events in a fixed interval when events occur independently at a constant average rate, such as calls per hour or defects per batch. Example application: In a hypothetical LinkedIn project involving professional networking, job discovery, and recruiting products, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - What is a Poisson distribution used for? Give a practical example from a hypothetical Bloomberg project involving financial terminals, market data, and news systems, and explain which checks or trade-offs matter most.
Show answer
Modelling the count of events in a fixed interval when events occur independently at a constant average rate, such as calls per hour or defects per batch. Example application: In a hypothetical Bloomberg project involving financial terminals, market data, and news systems, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - What is a normal distribution? Give a practical example from a hypothetical PayPal project involving digital payments, merchant checkout, and transaction risk, and explain which checks or trade-offs matter most.
Show answer
A symmetric bell-shaped distribution defined by mean and standard deviation, where about 68%, 95% and 99.7% of values lie within 1, 2 and 3 standard deviations. Example application: In a hypothetical PayPal project involving digital payments, merchant checkout, and transaction risk, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - What is a Poisson distribution used for? Give a practical example from a hypothetical Meesho project involving social commerce, seller listings, and logistics, and explain which checks or trade-offs matter most.
Show answer
Modelling the count of events in a fixed interval when events occur independently at a constant average rate, such as calls per hour or defects per batch. Example application: In a hypothetical Meesho project involving social commerce, seller listings, and logistics, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - What is a Poisson distribution used for? Give a practical example from a hypothetical Walmart project involving retail commerce, inventory, and supply-chain operations, and explain which checks or trade-offs matter most.
Show answer
Modelling the count of events in a fixed interval when events occur independently at a constant average rate, such as calls per hour or defects per batch. Example application: In a hypothetical Walmart project involving retail commerce, inventory, and supply-chain operations, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - What is a normal distribution?
Show answer
A symmetric bell-shaped distribution defined by mean and standard deviation, where about 68%, 95% and 99.7% of values lie within 1, 2 and 3 standard deviations. - What is a Poisson distribution used for?
Show answer
Modelling the count of events in a fixed interval when events occur independently at a constant average rate, such as calls per hour or defects per batch. - What is a normal distribution?
Show answer
A symmetric bell-shaped distribution defined by mean and standard deviation, where about 68%, 95% and 99.7% of values lie within 1, 2 and 3 standard deviations. - What is a normal distribution?
Show answer
A symmetric bell-shaped distribution defined by mean and standard deviation, where about 68%, 95% and 99.7% of values lie within 1, 2 and 3 standard deviations. - What is a Poisson distribution used for?
Show answer
Modelling the count of events in a fixed interval when events occur independently at a constant average rate, such as calls per hour or defects per batch. - What is the difference between Bayesian and frequentist approaches?
Show answer
Frequentists treat parameters as fixed and use long-run frequencies; Bayesians treat parameters as distributions updated with data via priors and posteriors, giving direct probability statements. - What is the difference between Bayesian and frequentist approaches?
Show answer
Frequentists treat parameters as fixed and use long-run frequencies; Bayesians treat parameters as distributions updated with data via priors and posteriors, giving direct probability statements.
Practise: Hypothesis testing · 15 questionsMedium
- Explain p-value in simple words. Give a practical example from a hypothetical TCS project involving enterprise IT services, integration, and client delivery, and explain which checks or trade-offs matter most.
Show answer
The probability of seeing a result at least this extreme if the null hypothesis were true. A small p-value (for example < 0.05) is evidence against the null hypothesis. Example application: In a hypothetical TCS project involving enterprise IT services, integration, and client delivery, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - Explain p-value in simple words. Give a practical example from a hypothetical Amazon project involving an online marketplace, fulfilment operations, and cloud services, and explain which checks or trade-offs matter most.
Show answer
The probability of seeing a result at least this extreme if the null hypothesis were true. A small p-value (for example < 0.05) is evidence against the null hypothesis. Example application: In a hypothetical Amazon project involving an online marketplace, fulfilment operations, and cloud services, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - Explain p-value in simple words. Give a practical example from a hypothetical D. E. Shaw project involving quantitative research and financial technology, and explain which checks or trade-offs matter most.
Show answer
The probability of seeing a result at least this extreme if the null hypothesis were true. A small p-value (for example < 0.05) is evidence against the null hypothesis. Example application: In a hypothetical D. E. Shaw project involving quantitative research and financial technology, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - Explain p-value in simple words. Give a practical example from a hypothetical Paytm project involving payments, merchant services, and financial products, and explain which checks or trade-offs matter most.
Show answer
The probability of seeing a result at least this extreme if the null hypothesis were true. A small p-value (for example < 0.05) is evidence against the null hypothesis. Example application: In a hypothetical Paytm project involving payments, merchant services, and financial products, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - What is the Central Limit Theorem? Give a practical example from a hypothetical TCS project involving enterprise IT services, integration, and client delivery, and explain which checks or trade-offs matter most.
Show answer
The distribution of sample means approaches a normal distribution as the sample size grows (roughly 30+), whatever the population's shape. It lets us build confidence intervals and run hypothesis tests on means. Example application: In a hypothetical TCS project involving enterprise IT services, integration, and client delivery, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - What is the Central Limit Theorem? Give a practical example from a hypothetical Atlassian project involving team collaboration and developer workflow products, and explain which checks or trade-offs matter most.
Show answer
The distribution of sample means approaches a normal distribution as the sample size grows (roughly 30+), whatever the population's shape. It lets us build confidence intervals and run hypothesis tests on means. Example application: In a hypothetical Atlassian project involving team collaboration and developer workflow products, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - What is the Central Limit Theorem? Give a practical example from a hypothetical Zepto project involving quick commerce, inventory, and last-mile delivery, and explain which checks or trade-offs matter most.
Show answer
The distribution of sample means approaches a normal distribution as the sample size grows (roughly 30+), whatever the population's shape. It lets us build confidence intervals and run hypothesis tests on means. Example application: In a hypothetical Zepto project involving quick commerce, inventory, and last-mile delivery, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - What is a p-value? Give a practical example from a hypothetical Intuit project involving financial software, tax preparation, and small-business tools, and explain which checks or trade-offs matter most.
Show answer
The probability of seeing a result at least as extreme as the observed one if the null hypothesis were true. A small p-value is evidence against the null, not proof that the alternative is true. Example application: In a hypothetical Intuit project involving financial software, tax preparation, and small-business tools, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - What is a p-value? Give a practical example from a hypothetical Visa project involving card networks, authorization, and payment-risk systems, and explain which checks or trade-offs matter most.
Show answer
The probability of seeing a result at least as extreme as the observed one if the null hypothesis were true. A small p-value is evidence against the null, not proof that the alternative is true. Example application: In a hypothetical Visa project involving card networks, authorization, and payment-risk systems, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - What is a p-value? Give a practical example from a hypothetical Mastercard project involving card payment networks and fraud prevention, and explain which checks or trade-offs matter most.
Show answer
The probability of seeing a result at least as extreme as the observed one if the null hypothesis were true. A small p-value is evidence against the null, not proof that the alternative is true. Example application: In a hypothetical Mastercard project involving card payment networks and fraud prevention, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - How do you design an A/B test? Give a practical example from a hypothetical Deloitte project involving consulting, risk advisory, and data-driven client services, and explain which checks or trade-offs matter most.
Show answer
Define the hypothesis and one primary metric, calculate sample size from the baseline, minimum detectable effect, α and power, randomise users, run for full business cycles, check for sample-ratio mismatch, then test both statistical and practical significance. Example application: In a hypothetical Deloitte project involving consulting, risk advisory, and data-driven client services, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - How do you design an A/B test? Give a practical example from a hypothetical Bloomberg project involving financial terminals, market data, and news systems, and explain which checks or trade-offs matter most.
Show answer
Define the hypothesis and one primary metric, calculate sample size from the baseline, minimum detectable effect, α and power, randomise users, run for full business cycles, check for sample-ratio mismatch, then test both statistical and practical significance. Example application: In a hypothetical Bloomberg project involving financial terminals, market data, and news systems, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - How do you design an A/B test? Give a practical example from a hypothetical PhonePe project involving UPI payments, merchant transactions, and financial services, and explain which checks or trade-offs matter most.
Show answer
Define the hypothesis and one primary metric, calculate sample size from the baseline, minimum detectable effect, α and power, randomise users, run for full business cycles, check for sample-ratio mismatch, then test both statistical and practical significance. Example application: In a hypothetical PhonePe project involving UPI payments, merchant transactions, and financial services, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - How do you design an A/B test? Give a practical example from a hypothetical CRED project involving member rewards, credit-card payments, and financial products, and explain which checks or trade-offs matter most.
Show answer
Define the hypothesis and one primary metric, calculate sample size from the baseline, minimum detectable effect, α and power, randomise users, run for full business cycles, check for sample-ratio mismatch, then test both statistical and practical significance. Example application: In a hypothetical CRED project involving member rewards, credit-card payments, and financial products, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - How do you design an A/B test? Give a practical example from a hypothetical JP Morgan Chase project involving banking, payments, and financial risk systems, and explain which checks or trade-offs matter most.
Show answer
Define the hypothesis and one primary metric, calculate sample size from the baseline, minimum detectable effect, α and power, randomise users, run for full business cycles, check for sample-ratio mismatch, then test both statistical and practical significance. Example application: In a hypothetical JP Morgan Chase project involving banking, payments, and financial risk systems, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift.
Practise: A/B testing · 15 questionsMedium
- What is a normal distribution? Give a practical example from a hypothetical Infosys project involving enterprise consulting, digital platforms, and client transformation, and explain which checks or trade-offs matter most.
Show answer
A symmetric bell-shaped distribution defined by mean and standard deviation, where about 68%, 95% and 99.7% of values lie within 1, 2 and 3 standard deviations. Example application: In a hypothetical Infosys project involving enterprise consulting, digital platforms, and client transformation, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - What is a normal distribution? Give a practical example from a hypothetical Cognizant project involving enterprise applications and healthcare or financial client systems, and explain which checks or trade-offs matter most.
Show answer
A symmetric bell-shaped distribution defined by mean and standard deviation, where about 68%, 95% and 99.7% of values lie within 1, 2 and 3 standard deviations. Example application: In a hypothetical Cognizant project involving enterprise applications and healthcare or financial client systems, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - What is a Poisson distribution used for? Give a practical example from a hypothetical Amazon project involving an online marketplace, fulfilment operations, and cloud services, and explain which checks or trade-offs matter most.
Show answer
Modelling the count of events in a fixed interval when events occur independently at a constant average rate, such as calls per hour or defects per batch. Example application: In a hypothetical Amazon project involving an online marketplace, fulfilment operations, and cloud services, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - Correlation vs covariance? Give a practical example from a hypothetical Stripe project involving online payments, billing, and financial infrastructure, and explain which checks or trade-offs matter most.
Show answer
Covariance shows the direction of a relationship but depends on units. Correlation is covariance scaled to −1…+1, so it shows direction and strength and is unit-free. Example application: In a hypothetical Stripe project involving online payments, billing, and financial infrastructure, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - Correlation vs covariance? Give a practical example from a hypothetical PhonePe project involving UPI payments, merchant transactions, and financial services, and explain which checks or trade-offs matter most.
Show answer
Covariance shows the direction of a relationship but depends on units. Correlation is covariance scaled to −1…+1, so it shows direction and strength and is unit-free. Example application: In a hypothetical PhonePe project involving UPI payments, merchant transactions, and financial services, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - Pearson vs Spearman correlation? Give a practical example from a hypothetical PhonePe project involving UPI payments, merchant transactions, and financial services, and explain which checks or trade-offs matter most.
Show answer
Pearson measures linear relationships on continuous data; Spearman uses ranks, so it captures monotonic relationships and is less sensitive to outliers. Example application: In a hypothetical PhonePe project involving UPI payments, merchant transactions, and financial services, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - What is standard deviation and what does it tell you? Give a practical example from a hypothetical Meesho project involving social commerce, seller listings, and logistics, and explain which checks or trade-offs matter most.
Show answer
The square root of the variance; it measures how far values typically sit from the mean, in the same units as the data. Example application: In a hypothetical Meesho project involving social commerce, seller listings, and logistics, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - What is a normal distribution? Give a practical example from a hypothetical Paytm project involving payments, merchant services, and financial products, and explain which checks or trade-offs matter most.
Show answer
A symmetric bell-shaped distribution defined by mean and standard deviation, where about 68%, 95% and 99.7% of values lie within 1, 2 and 3 standard deviations. Example application: In a hypothetical Paytm project involving payments, merchant services, and financial products, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - Explain Bayes' theorem with an example. Give a practical example from a hypothetical Accenture project involving multi-client consulting, cloud transformation, and process automation, and explain which checks or trade-offs matter most.
Show answer
P(A given B) = P(B given A) x P(A) / P(B). In a medical test it converts test accuracy and disease prevalence into the real chance a positive result means disease. Example application: In a hypothetical Accenture project involving multi-client consulting, cloud transformation, and process automation, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - Explain Bayes' theorem with an example. Give a practical example from a hypothetical Capgemini project involving client delivery, data platforms, and enterprise transformation, and explain which checks or trade-offs matter most.
Show answer
P(A given B) = P(B given A) x P(A) / P(B). In a medical test it converts test accuracy and disease prevalence into the real chance a positive result means disease. Example application: In a hypothetical Capgemini project involving client delivery, data platforms, and enterprise transformation, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - Explain the chi-square test. Give a practical example from a hypothetical Salesforce project involving CRM, sales operations, and customer data workflows, and explain which checks or trade-offs matter most.
Show answer
It checks whether observed category counts differ from expected counts, used for independence between two categorical variables and for goodness of fit. Example application: In a hypothetical Salesforce project involving CRM, sales operations, and customer data workflows, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - Explain Bayes' theorem with an example. Give a practical example from a hypothetical Tech Mahindra project involving telecom platforms, IT services, and digital transformation, and explain which checks or trade-offs matter most.
Show answer
P(A given B) = P(B given A) x P(A) / P(B). In a medical test it converts test accuracy and disease prevalence into the real chance a positive result means disease. Example application: In a hypothetical Tech Mahindra project involving telecom platforms, IT services, and digital transformation, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - What is a confidence interval?
Show answer
A range built from sample data that would contain the true parameter in a stated percentage (for example 95%) of repeated samples. It is not the probability that the parameter lies inside this one interval. - How do you design an A/B test? Give a practical example from a hypothetical Visa project involving card networks, authorization, and payment-risk systems, and explain which checks or trade-offs matter most.
Show answer
Define the hypothesis and one primary metric, calculate sample size from the baseline, minimum detectable effect, α and power, randomise users, run for full business cycles, check for sample-ratio mismatch, then test both statistical and practical significance. Example application: In a hypothetical Visa project involving card networks, authorization, and payment-risk systems, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - What is the difference between Bayesian and frequentist approaches?
Show answer
Frequentists treat parameters as fixed and use long-run frequencies; Bayesians treat parameters as distributions updated with data via priors and posteriors, giving direct probability statements.
3Sheet 3: Data Wrangling & EDA
Weeks 6–7 · 4 topicsClick to open topics ▾
Sheet 3: Data Wrangling & EDA
Weeks 6–7 · 4 topics
Practise: Missing values · 13 questionsEasy
- How do you handle missing values? Give a practical example from a hypothetical Cognizant project involving enterprise applications and healthcare or financial client systems, and explain which checks or trade-offs matter most.
Show answer
First understand why data is missing. Then drop rows or columns with too many nulls, impute with mean/median/mode or a model (KNN), add a 'was_missing' flag, and fit imputers on training data only. Example application: In a hypothetical Cognizant project involving enterprise applications and healthcare or financial client systems, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - How do you handle missing values? Give a practical example from a hypothetical Capgemini project involving client delivery, data platforms, and enterprise transformation, and explain which checks or trade-offs matter most.
Show answer
First understand why data is missing. Then drop rows or columns with too many nulls, impute with mean/median/mode or a model (KNN), add a 'was_missing' flag, and fit imputers on training data only. Example application: In a hypothetical Capgemini project involving client delivery, data platforms, and enterprise transformation, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - How do you handle missing values? Give a practical example from a hypothetical PhonePe project involving UPI payments, merchant transactions, and financial services, and explain which checks or trade-offs matter most.
Show answer
First understand why data is missing. Then drop rows or columns with too many nulls, impute with mean/median/mode or a model (KNN), add a 'was_missing' flag, and fit imputers on training data only. Example application: In a hypothetical PhonePe project involving UPI payments, merchant transactions, and financial services, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - How do you handle missing values? Give a practical example from a hypothetical CRED project involving member rewards, credit-card payments, and financial products, and explain which checks or trade-offs matter most.
Show answer
First understand why data is missing. Then drop rows or columns with too many nulls, impute with mean/median/mode or a model (KNN), add a 'was_missing' flag, and fit imputers on training data only. Example application: In a hypothetical CRED project involving member rewards, credit-card payments, and financial products, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - How do you handle missing values? Give a practical example from a hypothetical Intuit project involving financial software, tax preparation, and small-business tools, and explain which checks or trade-offs matter most.
Show answer
First understand why data is missing. Then drop rows or columns with too many nulls, impute with mean/median/mode or a model (KNN), add a 'was_missing' flag, and fit imputers on training data only. Example application: In a hypothetical Intuit project involving financial software, tax preparation, and small-business tools, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - How do you handle missing values? Give a practical example from a hypothetical JP Morgan Chase project involving banking, payments, and financial risk systems, and explain which checks or trade-offs matter most.
Show answer
First understand why data is missing. Then drop rows or columns with too many nulls, impute with mean/median/mode or a model (KNN), add a 'was_missing' flag, and fit imputers on training data only. Example application: In a hypothetical JP Morgan Chase project involving banking, payments, and financial risk systems, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - How do you handle missing values? Give a practical example from a hypothetical HSBC project involving international banking, risk, and cross-border payments, and explain which checks or trade-offs matter most.
Show answer
First understand why data is missing. Then drop rows or columns with too many nulls, impute with mean/median/mode or a model (KNN), add a 'was_missing' flag, and fit imputers on training data only. Example application: In a hypothetical HSBC project involving international banking, risk, and cross-border payments, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - How do you handle missing values? Give a practical example from a hypothetical Tech Mahindra project involving telecom platforms, IT services, and digital transformation, and explain which checks or trade-offs matter most.
Show answer
First understand why data is missing. Then drop rows or columns with too many nulls, impute with mean/median/mode or a model (KNN), add a 'was_missing' flag, and fit imputers on training data only. Example application: In a hypothetical Tech Mahindra project involving telecom platforms, IT services, and digital transformation, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - How do you handle missing values?
Show answer
First understand why data is missing. Then drop rows or columns with too many nulls, impute with mean/median/mode or a model (KNN), add a 'was_missing' flag, and fit imputers on training data only. - How do you handle missing values?
Show answer
First understand why data is missing. Then drop rows or columns with too many nulls, impute with mean/median/mode or a model (KNN), add a 'was_missing' flag, and fit imputers on training data only. - How do you handle missing values?
Show answer
First understand why data is missing. Then drop rows or columns with too many nulls, impute with mean/median/mode or a model (KNN), add a 'was_missing' flag, and fit imputers on training data only. - How do you handle missing values?
Show answer
First understand why data is missing. Then drop rows or columns with too many nulls, impute with mean/median/mode or a model (KNN), add a 'was_missing' flag, and fit imputers on training data only. - How do you handle missing values?
Show answer
First understand why data is missing. Then drop rows or columns with too many nulls, impute with mean/median/mode or a model (KNN), add a 'was_missing' flag, and fit imputers on training data only.
Practise: Feature engineering · 13 questionsEasy
- What is multicollinearity and how do you handle it? Give a practical example from a hypothetical TCS project involving enterprise IT services, integration, and client delivery, and explain which checks or trade-offs matter most.
Show answer
Predictors that are highly correlated make coefficients unstable. Detect with VIF above about 5-10, then drop or combine features, use PCA or apply regularisation. Example application: In a hypothetical TCS project involving enterprise IT services, integration, and client delivery, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - What is multicollinearity and how do you handle it? Give a practical example from a hypothetical Infosys project involving enterprise consulting, digital platforms, and client transformation, and explain which checks or trade-offs matter most.
Show answer
Predictors that are highly correlated make coefficients unstable. Detect with VIF above about 5-10, then drop or combine features, use PCA or apply regularisation. Example application: In a hypothetical Infosys project involving enterprise consulting, digital platforms, and client transformation, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - What is multicollinearity and how do you handle it? Give a practical example from a hypothetical Cognizant project involving enterprise applications and healthcare or financial client systems, and explain which checks or trade-offs matter most.
Show answer
Predictors that are highly correlated make coefficients unstable. Detect with VIF above about 5-10, then drop or combine features, use PCA or apply regularisation. Example application: In a hypothetical Cognizant project involving enterprise applications and healthcare or financial client systems, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - What is multicollinearity and how do you handle it? Give a practical example from a hypothetical Amazon project involving an online marketplace, fulfilment operations, and cloud services, and explain which checks or trade-offs matter most.
Show answer
Predictors that are highly correlated make coefficients unstable. Detect with VIF above about 5-10, then drop or combine features, use PCA or apply regularisation. Example application: In a hypothetical Amazon project involving an online marketplace, fulfilment operations, and cloud services, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - What is multicollinearity and how do you handle it? Give a practical example from a hypothetical PhonePe project involving UPI payments, merchant transactions, and financial services, and explain which checks or trade-offs matter most.
Show answer
Predictors that are highly correlated make coefficients unstable. Detect with VIF above about 5-10, then drop or combine features, use PCA or apply regularisation. Example application: In a hypothetical PhonePe project involving UPI payments, merchant transactions, and financial services, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - What is multicollinearity and how do you handle it? Give a practical example from a hypothetical Razorpay project involving payment gateway, settlement, and merchant integrations, and explain which checks or trade-offs matter most.
Show answer
Predictors that are highly correlated make coefficients unstable. Detect with VIF above about 5-10, then drop or combine features, use PCA or apply regularisation. Example application: In a hypothetical Razorpay project involving payment gateway, settlement, and merchant integrations, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - What is multicollinearity and how do you handle it? Give a practical example from a hypothetical Intuit project involving financial software, tax preparation, and small-business tools, and explain which checks or trade-offs matter most.
Show answer
Predictors that are highly correlated make coefficients unstable. Detect with VIF above about 5-10, then drop or combine features, use PCA or apply regularisation. Example application: In a hypothetical Intuit project involving financial software, tax preparation, and small-business tools, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - What is multicollinearity and how do you handle it? Give a practical example from a hypothetical Cisco project involving networking, security, and collaboration infrastructure, and explain which checks or trade-offs matter most.
Show answer
Predictors that are highly correlated make coefficients unstable. Detect with VIF above about 5-10, then drop or combine features, use PCA or apply regularisation. Example application: In a hypothetical Cisco project involving networking, security, and collaboration infrastructure, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - What is multicollinearity and how do you handle it?
Show answer
Predictors that are highly correlated make coefficients unstable. Detect with VIF above about 5-10, then drop or combine features, use PCA or apply regularisation. - What is multicollinearity and how do you handle it?
Show answer
Predictors that are highly correlated make coefficients unstable. Detect with VIF above about 5-10, then drop or combine features, use PCA or apply regularisation. - What is multicollinearity and how do you handle it?
Show answer
Predictors that are highly correlated make coefficients unstable. Detect with VIF above about 5-10, then drop or combine features, use PCA or apply regularisation. - What is multicollinearity and how do you handle it?
Show answer
Predictors that are highly correlated make coefficients unstable. Detect with VIF above about 5-10, then drop or combine features, use PCA or apply regularisation. - What is multicollinearity and how do you handle it?
Show answer
Predictors that are highly correlated make coefficients unstable. Detect with VIF above about 5-10, then drop or combine features, use PCA or apply regularisation.
Practise: Matplotlib & Seaborn · 13 questionsMedium
- Pearson vs Spearman correlation? Give a practical example from a hypothetical Adobe project involving creative software, document workflows, and subscriptions, and explain which checks or trade-offs matter most.
Show answer
Pearson measures linear relationships on continuous data; Spearman uses ranks, so it captures monotonic relationships and is less sensitive to outliers. Example application: In a hypothetical Adobe project involving creative software, document workflows, and subscriptions, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - How do you handle missing values? Give a practical example from a hypothetical Zomato project involving food ordering, restaurant discovery, and delivery, and explain which checks or trade-offs matter most.
Show answer
First understand why data is missing. Then drop rows or columns with too many nulls, impute with mean/median/mode or a model (KNN), add a 'was_missing' flag, and fit imputers on training data only. Example application: In a hypothetical Zomato project involving food ordering, restaurant discovery, and delivery, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - How do list comprehensions work and why use them? Give a practical example from a hypothetical Oracle project involving enterprise databases, cloud infrastructure, and business applications, and explain which checks or trade-offs matter most.
Show answer
They build a list in one readable expression, for example [x*x for x in data if x > 0]. They are usually faster than an equivalent for-loop with append. Example application: In a hypothetical Oracle project involving enterprise databases, cloud infrastructure, and business applications, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - How do you handle missing values?
Show answer
First understand why data is missing. Then drop rows or columns with too many nulls, impute with mean/median/mode or a model (KNN), add a 'was_missing' flag, and fit imputers on training data only. - What is sampling bias and how can you reduce it? Give a practical example from a hypothetical Wipro project involving managed IT services, cloud migration, and digital transformation, and explain which checks or trade-offs matter most.
Show answer
Bias occurs when the sample does not represent the population. Reduce it with random or stratified sampling, higher response rates and by checking sample demographics against the population. Example application: In a hypothetical Wipro project involving managed IT services, cloud migration, and digital transformation, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - Difference between a shallow copy and a deep copy? Give a practical example from a hypothetical Cognizant project involving enterprise applications and healthcare or financial client systems, and explain which checks or trade-offs matter most.
Show answer
A shallow copy duplicates the outer object but shares nested objects. A deep copy (copy.deepcopy) recursively duplicates everything, so changes to nested items do not leak. Example application: In a hypothetical Cognizant project involving enterprise applications and healthcare or financial client systems, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - What are decorators in Python? Give a practical example from a hypothetical Apple project involving consumer devices, App Store workflows, and subscription services, and explain which checks or trade-offs matter most.
Show answer
A decorator wraps a function to add behaviour such as logging, timing or caching without changing its code. It is applied with the @name syntax above the function. Example application: In a hypothetical Apple project involving consumer devices, App Store workflows, and subscription services, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - Difference between a shallow copy and a deep copy? Give a practical example from a hypothetical Bloomberg project involving financial terminals, market data, and news systems, and explain which checks or trade-offs matter most.
Show answer
A shallow copy duplicates the outer object but shares nested objects. A deep copy (copy.deepcopy) recursively duplicates everything, so changes to nested items do not leak. Example application: In a hypothetical Bloomberg project involving financial terminals, market data, and news systems, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - How do you use groupby with multiple aggregations? Give a practical example from a hypothetical PayPal project involving digital payments, merchant checkout, and transaction risk, and explain which checks or trade-offs matter most.
Show answer
df.groupby('region').agg(total=('sales','sum'), avg=('sales','mean')) gives named aggregations per group in one pass. Example application: In a hypothetical PayPal project involving digital payments, merchant checkout, and transaction risk, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - Pandas: merge vs join vs concat? Give a practical example from a hypothetical Flipkart project involving e-commerce marketplace, seller tools, and fulfilment, and explain which checks or trade-offs matter most.
Show answer
merge joins on columns, SQL-style (how='inner', 'left', ...). join joins on the index. concat stacks DataFrames along rows or columns. Example application: In a hypothetical Flipkart project involving e-commerce marketplace, seller tools, and fulfilment, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - How do you pivot data in Pandas? Give a practical example from a hypothetical Razorpay project involving payment gateway, settlement, and merchant integrations, and explain which checks or trade-offs matter most.
Show answer
pd.pivot_table(df, index='region', columns='month', values='sales', aggfunc='sum') reshapes long data into a summary matrix; melt() does the reverse. Example application: In a hypothetical Razorpay project involving payment gateway, settlement, and merchant integrations, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - How do you detect outliers? Give a practical example from a hypothetical JP Morgan Chase project involving banking, payments, and financial risk systems, and explain which checks or trade-offs matter most.
Show answer
Use the IQR rule (below Q1-1.5 IQR or above Q3+1.5 IQR), z-scores beyond 3, box plots or model-based methods such as Isolation Forest, then decide whether to cap, remove or keep them. Example application: In a hypothetical JP Morgan Chase project involving banking, payments, and financial risk systems, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - What is a confidence interval? Give a practical example from a hypothetical Visa project involving card networks, authorization, and payment-risk systems, and explain which checks or trade-offs matter most.
Show answer
A range built from sample data that would contain the true parameter in a stated percentage (for example 95%) of repeated samples. It is not the probability that the parameter lies inside this one interval. Example application: In a hypothetical Visa project involving card networks, authorization, and payment-risk systems, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift.
Practise: EDA case study · 13 questionsMedium
- What are *args and **kwargs? Give a practical example from a hypothetical Meta project involving social platforms, messaging, and advertising systems, and explain which checks or trade-offs matter most.
Show answer
*args collects extra positional arguments into a tuple; **kwargs collects extra keyword arguments into a dict. They make function signatures flexible and are common in wrappers and decorators. Example application: In a hypothetical Meta project involving social platforms, messaging, and advertising systems, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - What is the difference between == and is? Give a practical example from a hypothetical Flipkart project involving e-commerce marketplace, seller tools, and fulfilment, and explain which checks or trade-offs matter most.
Show answer
== compares values for equality, while is checks whether two names point to the same object in memory. Use is mainly for None checks. Example application: In a hypothetical Flipkart project involving e-commerce marketplace, seller tools, and fulfilment, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - What is the difference between a function and a method? Give a practical example from a hypothetical Flipkart project involving e-commerce marketplace, seller tools, and fulfilment, and explain which checks or trade-offs matter most.
Show answer
A method is a function that belongs to an object or class and receives the instance (self) as its first argument. Example application: In a hypothetical Flipkart project involving e-commerce marketplace, seller tools, and fulfilment, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - What is skewness? Give a practical example from a hypothetical Goldman Sachs project involving investment banking, markets, and risk analytics, and explain which checks or trade-offs matter most.
Show answer
A measure of asymmetry. Right-skewed data has a long tail on the right (mean greater than median); left-skewed is the opposite. Log transforms often reduce right skew. Example application: In a hypothetical Goldman Sachs project involving investment banking, markets, and risk analytics, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - What is skewness? Give a practical example from a hypothetical Oracle project involving enterprise databases, cloud infrastructure, and business applications, and explain which checks or trade-offs matter most.
Show answer
A measure of asymmetry. Right-skewed data has a long tail on the right (mean greater than median); left-skewed is the opposite. Log transforms often reduce right skew. Example application: In a hypothetical Oracle project involving enterprise databases, cloud infrastructure, and business applications, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - What is skewness? Give a practical example from a hypothetical HSBC project involving international banking, risk, and cross-border payments, and explain which checks or trade-offs matter most.
Show answer
A measure of asymmetry. Right-skewed data has a long tail on the right (mean greater than median); left-skewed is the opposite. Log transforms often reduce right skew. Example application: In a hypothetical HSBC project involving international banking, risk, and cross-border payments, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - Difference between loc and iloc in Pandas?
Show answer
loc selects by label (row and column names, inclusive of the end label); iloc selects by integer position (end-exclusive). - What is correlation and why does it not imply causation? Give a practical example from a hypothetical Salesforce project involving CRM, sales operations, and customer data workflows, and explain which checks or trade-offs matter most.
Show answer
Correlation measures linear association between variables (-1 to 1). A third factor, reverse causality or chance can create it, so causation needs controlled experiments. Example application: In a hypothetical Salesforce project involving CRM, sales operations, and customer data workflows, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - Explain the chi-square test. Give a practical example from a hypothetical Swiggy project involving food delivery, logistics, and quick commerce, and explain which checks or trade-offs matter most.
Show answer
It checks whether observed category counts differ from expected counts, used for independence between two categorical variables and for goodness of fit. Example application: In a hypothetical Swiggy project involving food delivery, logistics, and quick commerce, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - What are lambda functions and where are they useful? Give a practical example from a hypothetical Paytm project involving payments, merchant services, and financial products, and explain which checks or trade-offs matter most.
Show answer
Small anonymous one-line functions, handy as arguments to sort, map, filter or Pandas apply. Example application: In a hypothetical Paytm project involving payments, merchant services, and financial products, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - How do you profile and speed up slow Python code?
Show answer
Measure first with cProfile or timeit, then replace loops with NumPy or Pandas vectorised calls, use built-ins, caching and better data structures. - What is the Global Interpreter Lock (GIL)?
Show answer
A mutex in CPython that lets only one thread execute Python bytecode at a time. Use multiprocessing for CPU-bound work and threads or asyncio for I/O-bound work. - How do you design an A/B test? Give a practical example from a hypothetical TCS project involving enterprise IT services, integration, and client delivery, and explain which checks or trade-offs matter most.
Show answer
Define the hypothesis and one primary metric, calculate sample size from the baseline, minimum detectable effect, α and power, randomise users, run for full business cycles, check for sample-ratio mismatch, then test both statistical and practical significance. Example application: In a hypothetical TCS project involving enterprise IT services, integration, and client delivery, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift.
4Sheet 4: Machine Learning
Weeks 8–12 · 5 topicsClick to open topics ▾
Sheet 4: Machine Learning
Weeks 8–12 · 5 topics
Practise: Regression · 15 questionsEasy
- What is the difference between regression and classification? Give a practical example from a hypothetical Paytm project involving payments, merchant services, and financial products, and explain which checks or trade-offs matter most.
Show answer
Regression predicts continuous values such as price; classification predicts discrete categories such as spam or not spam. Example application: In a hypothetical Paytm project involving payments, merchant services, and financial products, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - What is the difference between regression and classification?
Show answer
Regression predicts continuous values such as price; classification predicts discrete categories such as spam or not spam. - What is the difference between regression and classification?
Show answer
Regression predicts continuous values such as price; classification predicts discrete categories such as spam or not spam. - What is the difference between regression and classification?
Show answer
Regression predicts continuous values such as price; classification predicts discrete categories such as spam or not spam. - How does linear regression work and what are its assumptions? Give a practical example from a hypothetical TCS project involving enterprise IT services, integration, and client delivery, and explain which checks or trade-offs matter most.
Show answer
It fits a line minimising squared error. Assumes linearity, independent errors, constant variance (homoscedasticity), normally distributed residuals and no strong multicollinearity. Example application: In a hypothetical TCS project involving enterprise IT services, integration, and client delivery, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - How does linear regression work and what are its assumptions? Give a practical example from a hypothetical Wipro project involving managed IT services, cloud migration, and digital transformation, and explain which checks or trade-offs matter most.
Show answer
It fits a line minimising squared error. Assumes linearity, independent errors, constant variance (homoscedasticity), normally distributed residuals and no strong multicollinearity. Example application: In a hypothetical Wipro project involving managed IT services, cloud migration, and digital transformation, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - Explain logistic regression. Give a practical example from a hypothetical Meta project involving social platforms, messaging, and advertising systems, and explain which checks or trade-offs matter most.
Show answer
It models the log-odds of a binary outcome as a linear function and passes it through a sigmoid to give probabilities, trained by maximising likelihood. Example application: In a hypothetical Meta project involving social platforms, messaging, and advertising systems, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - Explain logistic regression. Give a practical example from a hypothetical LinkedIn project involving professional networking, job discovery, and recruiting products, and explain which checks or trade-offs matter most.
Show answer
It models the log-odds of a binary outcome as a linear function and passes it through a sigmoid to give probabilities, trained by maximising likelihood. Example application: In a hypothetical LinkedIn project involving professional networking, job discovery, and recruiting products, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - How does linear regression work and what are its assumptions? Give a practical example from a hypothetical Uber project involving ride-hailing, driver operations, and real-time dispatch, and explain which checks or trade-offs matter most.
Show answer
It fits a line minimising squared error. Assumes linearity, independent errors, constant variance (homoscedasticity), normally distributed residuals and no strong multicollinearity. Example application: In a hypothetical Uber project involving ride-hailing, driver operations, and real-time dispatch, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - How does linear regression work and what are its assumptions? Give a practical example from a hypothetical Flipkart project involving e-commerce marketplace, seller tools, and fulfilment, and explain which checks or trade-offs matter most.
Show answer
It fits a line minimising squared error. Assumes linearity, independent errors, constant variance (homoscedasticity), normally distributed residuals and no strong multicollinearity. Example application: In a hypothetical Flipkart project involving e-commerce marketplace, seller tools, and fulfilment, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - Explain logistic regression. Give a practical example from a hypothetical Flipkart project involving e-commerce marketplace, seller tools, and fulfilment, and explain which checks or trade-offs matter most.
Show answer
It models the log-odds of a binary outcome as a linear function and passes it through a sigmoid to give probabilities, trained by maximising likelihood. Example application: In a hypothetical Flipkart project involving e-commerce marketplace, seller tools, and fulfilment, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - How does linear regression work and what are its assumptions? Give a practical example from a hypothetical ServiceNow project involving IT service management and enterprise workflow automation, and explain which checks or trade-offs matter most.
Show answer
It fits a line minimising squared error. Assumes linearity, independent errors, constant variance (homoscedasticity), normally distributed residuals and no strong multicollinearity. Example application: In a hypothetical ServiceNow project involving IT service management and enterprise workflow automation, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - How does linear regression work and what are its assumptions? Give a practical example from a hypothetical Barclays project involving retail banking, trading, and financial compliance, and explain which checks or trade-offs matter most.
Show answer
It fits a line minimising squared error. Assumes linearity, independent errors, constant variance (homoscedasticity), normally distributed residuals and no strong multicollinearity. Example application: In a hypothetical Barclays project involving retail banking, trading, and financial compliance, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - Explain logistic regression. Give a practical example from a hypothetical HCLTech project involving enterprise technology services and infrastructure, and explain which checks or trade-offs matter most.
Show answer
It models the log-odds of a binary outcome as a linear function and passes it through a sigmoid to give probabilities, trained by maximising likelihood. Example application: In a hypothetical HCLTech project involving enterprise technology services and infrastructure, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - Explain logistic regression.
Show answer
It models the log-odds of a binary outcome as a linear function and passes it through a sigmoid to give probabilities, trained by maximising likelihood.
Practise: Classification · 15 questionsEasy
- What is the difference between regression and classification? Give a practical example from a hypothetical Capgemini project involving client delivery, data platforms, and enterprise transformation, and explain which checks or trade-offs matter most.
Show answer
Regression predicts continuous values such as price; classification predicts discrete categories such as spam or not spam. Example application: In a hypothetical Capgemini project involving client delivery, data platforms, and enterprise transformation, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - What is the difference between regression and classification? Give a practical example from a hypothetical Microsoft project involving developer tools, cloud services, and productivity applications, and explain which checks or trade-offs matter most.
Show answer
Regression predicts continuous values such as price; classification predicts discrete categories such as spam or not spam. Example application: In a hypothetical Microsoft project involving developer tools, cloud services, and productivity applications, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - What is the difference between regression and classification? Give a practical example from a hypothetical Uber project involving ride-hailing, driver operations, and real-time dispatch, and explain which checks or trade-offs matter most.
Show answer
Regression predicts continuous values such as price; classification predicts discrete categories such as spam or not spam. Example application: In a hypothetical Uber project involving ride-hailing, driver operations, and real-time dispatch, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - What is the difference between regression and classification? Give a practical example from a hypothetical Stripe project involving online payments, billing, and financial infrastructure, and explain which checks or trade-offs matter most.
Show answer
Regression predicts continuous values such as price; classification predicts discrete categories such as spam or not spam. Example application: In a hypothetical Stripe project involving online payments, billing, and financial infrastructure, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - What is the difference between regression and classification? Give a practical example from a hypothetical Salesforce project involving CRM, sales operations, and customer data workflows, and explain which checks or trade-offs matter most.
Show answer
Regression predicts continuous values such as price; classification predicts discrete categories such as spam or not spam. Example application: In a hypothetical Salesforce project involving CRM, sales operations, and customer data workflows, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - What is the difference between regression and classification? Give a practical example from a hypothetical Meesho project involving social commerce, seller listings, and logistics, and explain which checks or trade-offs matter most.
Show answer
Regression predicts continuous values such as price; classification predicts discrete categories such as spam or not spam. Example application: In a hypothetical Meesho project involving social commerce, seller listings, and logistics, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - What is the difference between regression and classification? Give a practical example from a hypothetical Swiggy project involving food delivery, logistics, and quick commerce, and explain which checks or trade-offs matter most.
Show answer
Regression predicts continuous values such as price; classification predicts discrete categories such as spam or not spam. Example application: In a hypothetical Swiggy project involving food delivery, logistics, and quick commerce, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - What is the difference between regression and classification? Give a practical example from a hypothetical Goldman Sachs project involving investment banking, markets, and risk analytics, and explain which checks or trade-offs matter most.
Show answer
Regression predicts continuous values such as price; classification predicts discrete categories such as spam or not spam. Example application: In a hypothetical Goldman Sachs project involving investment banking, markets, and risk analytics, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - What is the difference between regression and classification? Give a practical example from a hypothetical Mastercard project involving card payment networks and fraud prevention, and explain which checks or trade-offs matter most.
Show answer
Regression predicts continuous values such as price; classification predicts discrete categories such as spam or not spam. Example application: In a hypothetical Mastercard project involving card payment networks and fraud prevention, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - What is the difference between regression and classification? Give a practical example from a hypothetical HCLTech project involving enterprise technology services and infrastructure, and explain which checks or trade-offs matter most.
Show answer
Regression predicts continuous values such as price; classification predicts discrete categories such as spam or not spam. Example application: In a hypothetical HCLTech project involving enterprise technology services and infrastructure, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - What is the difference between regression and classification? Give a practical example from a hypothetical Tech Mahindra project involving telecom platforms, IT services, and digital transformation, and explain which checks or trade-offs matter most.
Show answer
Regression predicts continuous values such as price; classification predicts discrete categories such as spam or not spam. Example application: In a hypothetical Tech Mahindra project involving telecom platforms, IT services, and digital transformation, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - What is the difference between regression and classification?
Show answer
Regression predicts continuous values such as price; classification predicts discrete categories such as spam or not spam. - What is the difference between regression and classification?
Show answer
Regression predicts continuous values such as price; classification predicts discrete categories such as spam or not spam. - What is the difference between regression and classification?
Show answer
Regression predicts continuous values such as price; classification predicts discrete categories such as spam or not spam. - What is the difference between regression and classification?
Show answer
Regression predicts continuous values such as price; classification predicts discrete categories such as spam or not spam.
Practise: Trees & XGBoost · 15 questionsMedium
- Why is XGBoost so popular? Give a practical example from a hypothetical Amazon project involving an online marketplace, fulfilment operations, and cloud services, and explain which checks or trade-offs matter most.
Show answer
It combines gradient boosting with regularisation, handling of missing values, parallel tree construction and speed optimisations, and it performs strongly on tabular data. Example application: In a hypothetical Amazon project involving an online marketplace, fulfilment operations, and cloud services, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - Why is XGBoost so popular? Give a practical example from a hypothetical Apple project involving consumer devices, App Store workflows, and subscription services, and explain which checks or trade-offs matter most.
Show answer
It combines gradient boosting with regularisation, handling of missing values, parallel tree construction and speed optimisations, and it performs strongly on tabular data. Example application: In a hypothetical Apple project involving consumer devices, App Store workflows, and subscription services, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - Why is XGBoost so popular? Give a practical example from a hypothetical PayPal project involving digital payments, merchant checkout, and transaction risk, and explain which checks or trade-offs matter most.
Show answer
It combines gradient boosting with regularisation, handling of missing values, parallel tree construction and speed optimisations, and it performs strongly on tabular data. Example application: In a hypothetical PayPal project involving digital payments, merchant checkout, and transaction risk, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - Why is XGBoost so popular? Give a practical example from a hypothetical Salesforce project involving CRM, sales operations, and customer data workflows, and explain which checks or trade-offs matter most.
Show answer
It combines gradient boosting with regularisation, handling of missing values, parallel tree construction and speed optimisations, and it performs strongly on tabular data. Example application: In a hypothetical Salesforce project involving CRM, sales operations, and customer data workflows, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - Why is XGBoost so popular? Give a practical example from a hypothetical Adobe project involving creative software, document workflows, and subscriptions, and explain which checks or trade-offs matter most.
Show answer
It combines gradient boosting with regularisation, handling of missing values, parallel tree construction and speed optimisations, and it performs strongly on tabular data. Example application: In a hypothetical Adobe project involving creative software, document workflows, and subscriptions, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - Why is XGBoost so popular? Give a practical example from a hypothetical Zepto project involving quick commerce, inventory, and last-mile delivery, and explain which checks or trade-offs matter most.
Show answer
It combines gradient boosting with regularisation, handling of missing values, parallel tree construction and speed optimisations, and it performs strongly on tabular data. Example application: In a hypothetical Zepto project involving quick commerce, inventory, and last-mile delivery, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - Why is XGBoost so popular? Give a practical example from a hypothetical Walmart project involving retail commerce, inventory, and supply-chain operations, and explain which checks or trade-offs matter most.
Show answer
It combines gradient boosting with regularisation, handling of missing values, parallel tree construction and speed optimisations, and it performs strongly on tabular data. Example application: In a hypothetical Walmart project involving retail commerce, inventory, and supply-chain operations, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - Why is XGBoost so popular? Give a practical example from a hypothetical Visa project involving card networks, authorization, and payment-risk systems, and explain which checks or trade-offs matter most.
Show answer
It combines gradient boosting with regularisation, handling of missing values, parallel tree construction and speed optimisations, and it performs strongly on tabular data. Example application: In a hypothetical Visa project involving card networks, authorization, and payment-risk systems, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - Why is XGBoost so popular? Give a practical example from a hypothetical Barclays project involving retail banking, trading, and financial compliance, and explain which checks or trade-offs matter most.
Show answer
It combines gradient boosting with regularisation, handling of missing values, parallel tree construction and speed optimisations, and it performs strongly on tabular data. Example application: In a hypothetical Barclays project involving retail banking, trading, and financial compliance, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - Why is XGBoost so popular? Give a practical example from a hypothetical Tech Mahindra project involving telecom platforms, IT services, and digital transformation, and explain which checks or trade-offs matter most.
Show answer
It combines gradient boosting with regularisation, handling of missing values, parallel tree construction and speed optimisations, and it performs strongly on tabular data. Example application: In a hypothetical Tech Mahindra project involving telecom platforms, IT services, and digital transformation, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - Why is XGBoost so popular?
Show answer
It combines gradient boosting with regularisation, handling of missing values, parallel tree construction and speed optimisations, and it performs strongly on tabular data. - Why is XGBoost so popular?
Show answer
It combines gradient boosting with regularisation, handling of missing values, parallel tree construction and speed optimisations, and it performs strongly on tabular data. - Why is XGBoost so popular?
Show answer
It combines gradient boosting with regularisation, handling of missing values, parallel tree construction and speed optimisations, and it performs strongly on tabular data. - Why is XGBoost so popular?
Show answer
It combines gradient boosting with regularisation, handling of missing values, parallel tree construction and speed optimisations, and it performs strongly on tabular data. - Why is XGBoost so popular?
Show answer
It combines gradient boosting with regularisation, handling of missing values, parallel tree construction and speed optimisations, and it performs strongly on tabular data.
Practise: Clustering · 15 questionsMedium
- How does K-means clustering work and how do you choose k? Give a practical example from a hypothetical Cognizant project involving enterprise applications and healthcare or financial client systems, and explain which checks or trade-offs matter most.
Show answer
It assigns points to the nearest centroid and updates centroids until stable. Choose k with the elbow method, silhouette score or business context. Example application: In a hypothetical Cognizant project involving enterprise applications and healthcare or financial client systems, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - How does K-means clustering work and how do you choose k? Give a practical example from a hypothetical Capgemini project involving client delivery, data platforms, and enterprise transformation, and explain which checks or trade-offs matter most.
Show answer
It assigns points to the nearest centroid and updates centroids until stable. Choose k with the elbow method, silhouette score or business context. Example application: In a hypothetical Capgemini project involving client delivery, data platforms, and enterprise transformation, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - How does K-means clustering work and how do you choose k? Give a practical example from a hypothetical Amazon project involving an online marketplace, fulfilment operations, and cloud services, and explain which checks or trade-offs matter most.
Show answer
It assigns points to the nearest centroid and updates centroids until stable. Choose k with the elbow method, silhouette score or business context. Example application: In a hypothetical Amazon project involving an online marketplace, fulfilment operations, and cloud services, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - How does K-means clustering work and how do you choose k? Give a practical example from a hypothetical Meta project involving social platforms, messaging, and advertising systems, and explain which checks or trade-offs matter most.
Show answer
It assigns points to the nearest centroid and updates centroids until stable. Choose k with the elbow method, silhouette score or business context. Example application: In a hypothetical Meta project involving social platforms, messaging, and advertising systems, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - How does K-means clustering work and how do you choose k? Give a practical example from a hypothetical Microsoft project involving developer tools, cloud services, and productivity applications, and explain which checks or trade-offs matter most.
Show answer
It assigns points to the nearest centroid and updates centroids until stable. Choose k with the elbow method, silhouette score or business context. Example application: In a hypothetical Microsoft project involving developer tools, cloud services, and productivity applications, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - How does K-means clustering work and how do you choose k? Give a practical example from a hypothetical Uber project involving ride-hailing, driver operations, and real-time dispatch, and explain which checks or trade-offs matter most.
Show answer
It assigns points to the nearest centroid and updates centroids until stable. Choose k with the elbow method, silhouette score or business context. Example application: In a hypothetical Uber project involving ride-hailing, driver operations, and real-time dispatch, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - How does K-means clustering work and how do you choose k? Give a practical example from a hypothetical Stripe project involving online payments, billing, and financial infrastructure, and explain which checks or trade-offs matter most.
Show answer
It assigns points to the nearest centroid and updates centroids until stable. Choose k with the elbow method, silhouette score or business context. Example application: In a hypothetical Stripe project involving online payments, billing, and financial infrastructure, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - How does K-means clustering work and how do you choose k? Give a practical example from a hypothetical Flipkart project involving e-commerce marketplace, seller tools, and fulfilment, and explain which checks or trade-offs matter most.
Show answer
It assigns points to the nearest centroid and updates centroids until stable. Choose k with the elbow method, silhouette score or business context. Example application: In a hypothetical Flipkart project involving e-commerce marketplace, seller tools, and fulfilment, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - How does K-means clustering work and how do you choose k? Give a practical example from a hypothetical Zepto project involving quick commerce, inventory, and last-mile delivery, and explain which checks or trade-offs matter most.
Show answer
It assigns points to the nearest centroid and updates centroids until stable. Choose k with the elbow method, silhouette score or business context. Example application: In a hypothetical Zepto project involving quick commerce, inventory, and last-mile delivery, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - How does K-means clustering work and how do you choose k? Give a practical example from a hypothetical Intuit project involving financial software, tax preparation, and small-business tools, and explain which checks or trade-offs matter most.
Show answer
It assigns points to the nearest centroid and updates centroids until stable. Choose k with the elbow method, silhouette score or business context. Example application: In a hypothetical Intuit project involving financial software, tax preparation, and small-business tools, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - How does K-means clustering work and how do you choose k? Give a practical example from a hypothetical JP Morgan Chase project involving banking, payments, and financial risk systems, and explain which checks or trade-offs matter most.
Show answer
It assigns points to the nearest centroid and updates centroids until stable. Choose k with the elbow method, silhouette score or business context. Example application: In a hypothetical JP Morgan Chase project involving banking, payments, and financial risk systems, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - How does K-means clustering work and how do you choose k? Give a practical example from a hypothetical Visa project involving card networks, authorization, and payment-risk systems, and explain which checks or trade-offs matter most.
Show answer
It assigns points to the nearest centroid and updates centroids until stable. Choose k with the elbow method, silhouette score or business context. Example application: In a hypothetical Visa project involving card networks, authorization, and payment-risk systems, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - How does K-means clustering work and how do you choose k? Give a practical example from a hypothetical HSBC project involving international banking, risk, and cross-border payments, and explain which checks or trade-offs matter most.
Show answer
It assigns points to the nearest centroid and updates centroids until stable. Choose k with the elbow method, silhouette score or business context. Example application: In a hypothetical HSBC project involving international banking, risk, and cross-border payments, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - How does K-means clustering work and how do you choose k?
Show answer
It assigns points to the nearest centroid and updates centroids until stable. Choose k with the elbow method, silhouette score or business context. - How does K-means clustering work and how do you choose k?
Show answer
It assigns points to the nearest centroid and updates centroids until stable. Choose k with the elbow method, silhouette score or business context.
Practise: Model evaluation · 15 questionsHard
- What is feature scaling and which models need it? Give a practical example from a hypothetical Infosys project involving enterprise consulting, digital platforms, and client transformation, and explain which checks or trade-offs matter most.
Show answer
Putting features on comparable ranges using standardisation or min-max scaling. Distance-based and gradient-based models (KNN, SVM, regression, neural nets) need it; tree models do not. Example application: In a hypothetical Infosys project involving enterprise consulting, digital platforms, and client transformation, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - How would you build a churn prediction model end to end? Give a practical example from a hypothetical Amazon project involving an online marketplace, fulfilment operations, and cloud services, and explain which checks or trade-offs matter most.
Show answer
Define churn and the prediction window, build behavioural features, split by time, train and compare models, evaluate with recall and lift, explain drivers and monitor drift after deployment. Example application: In a hypothetical Amazon project involving an online marketplace, fulfilment operations, and cloud services, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - How would you build a churn prediction model end to end? Give a practical example from a hypothetical Atlassian project involving team collaboration and developer workflow products, and explain which checks or trade-offs matter most.
Show answer
Define churn and the prediction window, build behavioural features, split by time, train and compare models, evaluate with recall and lift, explain drivers and monitor drift after deployment. Example application: In a hypothetical Atlassian project involving team collaboration and developer workflow products, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - How would you build a churn prediction model end to end? Give a practical example from a hypothetical Stripe project involving online payments, billing, and financial infrastructure, and explain which checks or trade-offs matter most.
Show answer
Define churn and the prediction window, build behavioural features, split by time, train and compare models, evaluate with recall and lift, explain drivers and monitor drift after deployment. Example application: In a hypothetical Stripe project involving online payments, billing, and financial infrastructure, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - What is the difference between generative and discriminative models? Give a practical example from a hypothetical PayPal project involving digital payments, merchant checkout, and transaction risk, and explain which checks or trade-offs matter most.
Show answer
Discriminative models learn P(y given x) directly (logistic regression, SVM). Generative models learn the joint P(x, y) and can generate data (Naive Bayes, GANs). Example application: In a hypothetical PayPal project involving digital payments, merchant checkout, and transaction risk, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - How do you evaluate and explain a model to business stakeholders? Give a practical example from a hypothetical CRED project involving member rewards, credit-card payments, and financial products, and explain which checks or trade-offs matter most.
Show answer
Tie metrics to business outcomes such as cost saved, show feature importance or SHAP values, give example predictions and be transparent about limitations. Example application: In a hypothetical CRED project involving member rewards, credit-card payments, and financial products, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - How do you evaluate and explain a model to business stakeholders? Give a practical example from a hypothetical Zepto project involving quick commerce, inventory, and last-mile delivery, and explain which checks or trade-offs matter most.
Show answer
Tie metrics to business outcomes such as cost saved, show feature importance or SHAP values, give example predictions and be transparent about limitations. Example application: In a hypothetical Zepto project involving quick commerce, inventory, and last-mile delivery, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - How do you evaluate and explain a model to business stakeholders? Give a practical example from a hypothetical ServiceNow project involving IT service management and enterprise workflow automation, and explain which checks or trade-offs matter most.
Show answer
Tie metrics to business outcomes such as cost saved, show feature importance or SHAP values, give example predictions and be transparent about limitations. Example application: In a hypothetical ServiceNow project involving IT service management and enterprise workflow automation, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - How do you evaluate and explain a model to business stakeholders? Give a practical example from a hypothetical Morgan Stanley project involving wealth management, trading, and investment platforms, and explain which checks or trade-offs matter most.
Show answer
Tie metrics to business outcomes such as cost saved, show feature importance or SHAP values, give example predictions and be transparent about limitations. Example application: In a hypothetical Morgan Stanley project involving wealth management, trading, and investment platforms, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - How do you deploy and monitor a machine learning model? Give a practical example from a hypothetical Cisco project involving networking, security, and collaboration infrastructure, and explain which checks or trade-offs matter most.
Show answer
Package the model behind an API with versioning, track latency and errors, monitor input drift and prediction quality, and automate retraining with rollback. Example application: In a hypothetical Cisco project involving networking, security, and collaboration infrastructure, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - How do you deploy and monitor a machine learning model? Give a practical example from a hypothetical Visa project involving card networks, authorization, and payment-risk systems, and explain which checks or trade-offs matter most.
Show answer
Package the model behind an API with versioning, track latency and errors, monitor input drift and prediction quality, and automate retraining with rollback. Example application: In a hypothetical Visa project involving card networks, authorization, and payment-risk systems, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - How do you evaluate and explain a model to business stakeholders? Give a practical example from a hypothetical HSBC project involving international banking, risk, and cross-border payments, and explain which checks or trade-offs matter most.
Show answer
Tie metrics to business outcomes such as cost saved, show feature importance or SHAP values, give example predictions and be transparent about limitations. Example application: In a hypothetical HSBC project involving international banking, risk, and cross-border payments, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - How do you deploy and monitor a machine learning model? Give a practical example from a hypothetical HCLTech project involving enterprise technology services and infrastructure, and explain which checks or trade-offs matter most.
Show answer
Package the model behind an API with versioning, track latency and errors, monitor input drift and prediction quality, and automate retraining with rollback. Example application: In a hypothetical HCLTech project involving enterprise technology services and infrastructure, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - How do you evaluate and explain a model to business stakeholders? Give a practical example from a hypothetical Tech Mahindra project involving telecom platforms, IT services, and digital transformation, and explain which checks or trade-offs matter most.
Show answer
Tie metrics to business outcomes such as cost saved, show feature importance or SHAP values, give example predictions and be transparent about limitations. Example application: In a hypothetical Tech Mahindra project involving telecom platforms, IT services, and digital transformation, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - What is the difference between generative and discriminative models?
Show answer
Discriminative models learn P(y given x) directly (logistic regression, SVM). Generative models learn the joint P(x, y) and can generate data (Naive Bayes, GANs).
5Sheet 5: Deep Learning & NLP
Weeks 13–16 · 4 topicsClick to open topics ▾
Sheet 5: Deep Learning & NLP
Weeks 13–16 · 4 topics
Practise: Neural networks · 11 questionsEasy
- What is a neural network? Give a practical example from a hypothetical Infosys project involving enterprise consulting, digital platforms, and client transformation, and explain which checks or trade-offs matter most.
Show answer
Layers of connected neurons that apply weights, biases and activation functions to learn complex patterns, trained by backpropagation. Example application: In a hypothetical Infosys project involving enterprise consulting, digital platforms, and client transformation, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - What is a neural network? Give a practical example from a hypothetical Deloitte project involving consulting, risk advisory, and data-driven client services, and explain which checks or trade-offs matter most.
Show answer
Layers of connected neurons that apply weights, biases and activation functions to learn complex patterns, trained by backpropagation. Example application: In a hypothetical Deloitte project involving consulting, risk advisory, and data-driven client services, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - What is a neural network? Give a practical example from a hypothetical Microsoft project involving developer tools, cloud services, and productivity applications, and explain which checks or trade-offs matter most.
Show answer
Layers of connected neurons that apply weights, biases and activation functions to learn complex patterns, trained by backpropagation. Example application: In a hypothetical Microsoft project involving developer tools, cloud services, and productivity applications, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - What is a neural network? Give a practical example from a hypothetical LinkedIn project involving professional networking, job discovery, and recruiting products, and explain which checks or trade-offs matter most.
Show answer
Layers of connected neurons that apply weights, biases and activation functions to learn complex patterns, trained by backpropagation. Example application: In a hypothetical LinkedIn project involving professional networking, job discovery, and recruiting products, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - What is a neural network? Give a practical example from a hypothetical Flipkart project involving e-commerce marketplace, seller tools, and fulfilment, and explain which checks or trade-offs matter most.
Show answer
Layers of connected neurons that apply weights, biases and activation functions to learn complex patterns, trained by backpropagation. Example application: In a hypothetical Flipkart project involving e-commerce marketplace, seller tools, and fulfilment, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - What is a neural network? Give a practical example from a hypothetical JP Morgan Chase project involving banking, payments, and financial risk systems, and explain which checks or trade-offs matter most.
Show answer
Layers of connected neurons that apply weights, biases and activation functions to learn complex patterns, trained by backpropagation. Example application: In a hypothetical JP Morgan Chase project involving banking, payments, and financial risk systems, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - What is a neural network? Give a practical example from a hypothetical Oracle project involving enterprise databases, cloud infrastructure, and business applications, and explain which checks or trade-offs matter most.
Show answer
Layers of connected neurons that apply weights, biases and activation functions to learn complex patterns, trained by backpropagation. Example application: In a hypothetical Oracle project involving enterprise databases, cloud infrastructure, and business applications, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - What is a neural network?
Show answer
Layers of connected neurons that apply weights, biases and activation functions to learn complex patterns, trained by backpropagation. - What is a neural network?
Show answer
Layers of connected neurons that apply weights, biases and activation functions to learn complex patterns, trained by backpropagation. - What is a neural network?
Show answer
Layers of connected neurons that apply weights, biases and activation functions to learn complex patterns, trained by backpropagation. - How do you choose a learning rate for a neural network?
Show answer
Start with a sensible default such as 1e-3 for Adam, run a learning-rate range test, and use schedulers or warm-up while watching the loss curve.
Practise: CNNs · 11 questionsEasy
- CNN vs RNN vs Transformer — what is the difference? Give a practical example from a hypothetical Deloitte project involving consulting, risk advisory, and data-driven client services, and explain which checks or trade-offs matter most.
Show answer
CNNs use convolutions to find spatial patterns (images). RNNs/LSTMs process sequences step by step but struggle with long context. Transformers use self-attention to look at all tokens at once — parallel and better at long-range context; they power modern LLMs. Example application: In a hypothetical Deloitte project involving consulting, risk advisory, and data-driven client services, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - CNN vs RNN vs Transformer — what is the difference? Give a practical example from a hypothetical Atlassian project involving team collaboration and developer workflow products, and explain which checks or trade-offs matter most.
Show answer
CNNs use convolutions to find spatial patterns (images). RNNs/LSTMs process sequences step by step but struggle with long context. Transformers use self-attention to look at all tokens at once — parallel and better at long-range context; they power modern LLMs. Example application: In a hypothetical Atlassian project involving team collaboration and developer workflow products, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - CNN vs RNN vs Transformer — what is the difference? Give a practical example from a hypothetical Tower Research Capital project involving low-latency trading and market data systems, and explain which checks or trade-offs matter most.
Show answer
CNNs use convolutions to find spatial patterns (images). RNNs/LSTMs process sequences step by step but struggle with long context. Transformers use self-attention to look at all tokens at once — parallel and better at long-range context; they power modern LLMs. Example application: In a hypothetical Tower Research Capital project involving low-latency trading and market data systems, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - CNN vs RNN vs Transformer — what is the difference? Give a practical example from a hypothetical PayPal project involving digital payments, merchant checkout, and transaction risk, and explain which checks or trade-offs matter most.
Show answer
CNNs use convolutions to find spatial patterns (images). RNNs/LSTMs process sequences step by step but struggle with long context. Transformers use self-attention to look at all tokens at once — parallel and better at long-range context; they power modern LLMs. Example application: In a hypothetical PayPal project involving digital payments, merchant checkout, and transaction risk, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - CNN vs RNN vs Transformer — what is the difference? Give a practical example from a hypothetical Zomato project involving food ordering, restaurant discovery, and delivery, and explain which checks or trade-offs matter most.
Show answer
CNNs use convolutions to find spatial patterns (images). RNNs/LSTMs process sequences step by step but struggle with long context. Transformers use self-attention to look at all tokens at once — parallel and better at long-range context; they power modern LLMs. Example application: In a hypothetical Zomato project involving food ordering, restaurant discovery, and delivery, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - CNN vs RNN vs Transformer — what is the difference? Give a practical example from a hypothetical Swiggy project involving food delivery, logistics, and quick commerce, and explain which checks or trade-offs matter most.
Show answer
CNNs use convolutions to find spatial patterns (images). RNNs/LSTMs process sequences step by step but struggle with long context. Transformers use self-attention to look at all tokens at once — parallel and better at long-range context; they power modern LLMs. Example application: In a hypothetical Swiggy project involving food delivery, logistics, and quick commerce, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - CNN vs RNN vs Transformer — what is the difference? Give a practical example from a hypothetical ServiceNow project involving IT service management and enterprise workflow automation, and explain which checks or trade-offs matter most.
Show answer
CNNs use convolutions to find spatial patterns (images). RNNs/LSTMs process sequences step by step but struggle with long context. Transformers use self-attention to look at all tokens at once — parallel and better at long-range context; they power modern LLMs. Example application: In a hypothetical ServiceNow project involving IT service management and enterprise workflow automation, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - CNN vs RNN vs Transformer — what is the difference? Give a practical example from a hypothetical Morgan Stanley project involving wealth management, trading, and investment platforms, and explain which checks or trade-offs matter most.
Show answer
CNNs use convolutions to find spatial patterns (images). RNNs/LSTMs process sequences step by step but struggle with long context. Transformers use self-attention to look at all tokens at once — parallel and better at long-range context; they power modern LLMs. Example application: In a hypothetical Morgan Stanley project involving wealth management, trading, and investment platforms, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - CNN vs RNN vs Transformer — what is the difference? Give a practical example from a hypothetical Oracle project involving enterprise databases, cloud infrastructure, and business applications, and explain which checks or trade-offs matter most.
Show answer
CNNs use convolutions to find spatial patterns (images). RNNs/LSTMs process sequences step by step but struggle with long context. Transformers use self-attention to look at all tokens at once — parallel and better at long-range context; they power modern LLMs. Example application: In a hypothetical Oracle project involving enterprise databases, cloud infrastructure, and business applications, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - CNN vs RNN vs Transformer — what is the difference?
Show answer
CNNs use convolutions to find spatial patterns (images). RNNs/LSTMs process sequences step by step but struggle with long context. Transformers use self-attention to look at all tokens at once — parallel and better at long-range context; they power modern LLMs. - CNN vs RNN vs Transformer — what is the difference?
Show answer
CNNs use convolutions to find spatial patterns (images). RNNs/LSTMs process sequences step by step but struggle with long context. Transformers use self-attention to look at all tokens at once — parallel and better at long-range context; they power modern LLMs.
Practise: RNNs & Transformers · 11 questionsMedium
- How do transformers differ from RNNs? Give a practical example from a hypothetical Cognizant project involving enterprise applications and healthcare or financial client systems, and explain which checks or trade-offs matter most.
Show answer
Transformers use self-attention to process all tokens in parallel and capture long-range context, making them faster to train and more scalable than sequential RNNs. Example application: In a hypothetical Cognizant project involving enterprise applications and healthcare or financial client systems, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - How do transformers differ from RNNs? Give a practical example from a hypothetical Amazon project involving an online marketplace, fulfilment operations, and cloud services, and explain which checks or trade-offs matter most.
Show answer
Transformers use self-attention to process all tokens in parallel and capture long-range context, making them faster to train and more scalable than sequential RNNs. Example application: In a hypothetical Amazon project involving an online marketplace, fulfilment operations, and cloud services, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - How do transformers differ from RNNs? Give a practical example from a hypothetical Microsoft project involving developer tools, cloud services, and productivity applications, and explain which checks or trade-offs matter most.
Show answer
Transformers use self-attention to process all tokens in parallel and capture long-range context, making them faster to train and more scalable than sequential RNNs. Example application: In a hypothetical Microsoft project involving developer tools, cloud services, and productivity applications, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - How do transformers differ from RNNs? Give a practical example from a hypothetical Stripe project involving online payments, billing, and financial infrastructure, and explain which checks or trade-offs matter most.
Show answer
Transformers use self-attention to process all tokens in parallel and capture long-range context, making them faster to train and more scalable than sequential RNNs. Example application: In a hypothetical Stripe project involving online payments, billing, and financial infrastructure, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - How do transformers differ from RNNs? Give a practical example from a hypothetical PayPal project involving digital payments, merchant checkout, and transaction risk, and explain which checks or trade-offs matter most.
Show answer
Transformers use self-attention to process all tokens in parallel and capture long-range context, making them faster to train and more scalable than sequential RNNs. Example application: In a hypothetical PayPal project involving digital payments, merchant checkout, and transaction risk, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - How do transformers differ from RNNs? Give a practical example from a hypothetical ServiceNow project involving IT service management and enterprise workflow automation, and explain which checks or trade-offs matter most.
Show answer
Transformers use self-attention to process all tokens in parallel and capture long-range context, making them faster to train and more scalable than sequential RNNs. Example application: In a hypothetical ServiceNow project involving IT service management and enterprise workflow automation, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - How do transformers differ from RNNs? Give a practical example from a hypothetical Walmart project involving retail commerce, inventory, and supply-chain operations, and explain which checks or trade-offs matter most.
Show answer
Transformers use self-attention to process all tokens in parallel and capture long-range context, making them faster to train and more scalable than sequential RNNs. Example application: In a hypothetical Walmart project involving retail commerce, inventory, and supply-chain operations, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - How do transformers differ from RNNs? Give a practical example from a hypothetical HCLTech project involving enterprise technology services and infrastructure, and explain which checks or trade-offs matter most.
Show answer
Transformers use self-attention to process all tokens in parallel and capture long-range context, making them faster to train and more scalable than sequential RNNs. Example application: In a hypothetical HCLTech project involving enterprise technology services and infrastructure, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - How do transformers differ from RNNs? Give a practical example from a hypothetical Tech Mahindra project involving telecom platforms, IT services, and digital transformation, and explain which checks or trade-offs matter most.
Show answer
Transformers use self-attention to process all tokens in parallel and capture long-range context, making them faster to train and more scalable than sequential RNNs. Example application: In a hypothetical Tech Mahindra project involving telecom platforms, IT services, and digital transformation, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - How do transformers differ from RNNs?
Show answer
Transformers use self-attention to process all tokens in parallel and capture long-range context, making them faster to train and more scalable than sequential RNNs. - How do transformers differ from RNNs?
Show answer
Transformers use self-attention to process all tokens in parallel and capture long-range context, making them faster to train and more scalable than sequential RNNs.
Practise: Text processing · 11 questionsMedium
- What is tokenisation in NLP? Give a practical example from a hypothetical Google project involving search, advertising, maps, and cloud products, and explain which checks or trade-offs matter most.
Show answer
Splitting text into units such as words, subwords or characters that are mapped to ids; subword methods like BPE handle rare words well. Example application: In a hypothetical Google project involving search, advertising, maps, and cloud products, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - What is tokenisation in NLP? Give a practical example from a hypothetical Visa project involving card networks, authorization, and payment-risk systems, and explain which checks or trade-offs matter most.
Show answer
Splitting text into units such as words, subwords or characters that are mapped to ids; subword methods like BPE handle rare words well. Example application: In a hypothetical Visa project involving card networks, authorization, and payment-risk systems, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - What is TF-IDF? Give a practical example from a hypothetical Salesforce project involving CRM, sales operations, and customer data workflows, and explain which checks or trade-offs matter most.
Show answer
Term Frequency × Inverse Document Frequency: a word scores high if it is frequent in one document but rare across all documents. A classic way to turn text into numeric features. Example application: In a hypothetical Salesforce project involving CRM, sales operations, and customer data workflows, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - What is Naive Bayes and why is it called naive? Give a practical example from a hypothetical HSBC project involving international banking, risk, and cross-border payments, and explain which checks or trade-offs matter most.
Show answer
It applies Bayes' theorem assuming features are independent given the class. The assumption is rarely true but the model is fast and works well for text. Example application: In a hypothetical HSBC project involving international banking, risk, and cross-border payments, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - What is Naive Bayes and why is it called naive?
Show answer
It applies Bayes' theorem assuming features are independent given the class. The assumption is rarely true but the model is fast and works well for text. - What is Naive Bayes and why is it called naive?
Show answer
It applies Bayes' theorem assuming features are independent given the class. The assumption is rarely true but the model is fast and works well for text. - How do transformers differ from RNNs? Give a practical example from a hypothetical Infosys project involving enterprise consulting, digital platforms, and client transformation, and explain which checks or trade-offs matter most.
Show answer
Transformers use self-attention to process all tokens in parallel and capture long-range context, making them faster to train and more scalable than sequential RNNs. Example application: In a hypothetical Infosys project involving enterprise consulting, digital platforms, and client transformation, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - CNN vs RNN vs Transformer — what is the difference? Give a practical example from a hypothetical Accenture project involving multi-client consulting, cloud transformation, and process automation, and explain which checks or trade-offs matter most.
Show answer
CNNs use convolutions to find spatial patterns (images). RNNs/LSTMs process sequences step by step but struggle with long context. Transformers use self-attention to look at all tokens at once — parallel and better at long-range context; they power modern LLMs. Example application: In a hypothetical Accenture project involving multi-client consulting, cloud transformation, and process automation, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - How do transformers differ from RNNs? Give a practical example from a hypothetical Deloitte project involving consulting, risk advisory, and data-driven client services, and explain which checks or trade-offs matter most.
Show answer
Transformers use self-attention to process all tokens in parallel and capture long-range context, making them faster to train and more scalable than sequential RNNs. Example application: In a hypothetical Deloitte project involving consulting, risk advisory, and data-driven client services, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - CNN vs RNN vs Transformer — what is the difference? Give a practical example from a hypothetical Apple project involving consumer devices, App Store workflows, and subscription services, and explain which checks or trade-offs matter most.
Show answer
CNNs use convolutions to find spatial patterns (images). RNNs/LSTMs process sequences step by step but struggle with long context. Transformers use self-attention to look at all tokens at once — parallel and better at long-range context; they power modern LLMs. Example application: In a hypothetical Apple project involving consumer devices, App Store workflows, and subscription services, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - How do transformers differ from RNNs? Give a practical example from a hypothetical Barclays project involving retail banking, trading, and financial compliance, and explain which checks or trade-offs matter most.
Show answer
Transformers use self-attention to process all tokens in parallel and capture long-range context, making them faster to train and more scalable than sequential RNNs. Example application: In a hypothetical Barclays project involving retail banking, trading, and financial compliance, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift.
6Sheet 6: Deployment & Capstone
Weeks 17–20 · 4 topicsClick to open topics ▾
Sheet 6: Deployment & Capstone
Weeks 17–20 · 4 topics
Practise: FastAPI · 15 questionsEasy
- How do list comprehensions work and why use them? Give a practical example from a hypothetical Wipro project involving managed IT services, cloud migration, and digital transformation, and explain which checks or trade-offs matter most.
Show answer
They build a list in one readable expression, for example [x*x for x in data if x > 0]. They are usually faster than an equivalent for-loop with append. Example application: In a hypothetical Wipro project involving managed IT services, cloud migration, and digital transformation, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - What is data leakage? Give a practical example from a hypothetical Morgan Stanley project involving wealth management, trading, and investment platforms, and explain which checks or trade-offs matter most.
Show answer
Information from outside the training window, such as future data or test statistics, enters training and inflates performance. Split first, then fit scalers and encoders on training data only. Example application: In a hypothetical Morgan Stanley project involving wealth management, trading, and investment platforms, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - What is the difference between list, tuple, set and dict in Python?
Show answer
List: ordered and mutable. Tuple: ordered and immutable (hashable, slightly faster). Set: unordered, unique items, fast membership checks. Dict: key–value pairs with fast lookup by key. - How do you handle missing values?
Show answer
First understand why data is missing. Then drop rows or columns with too many nulls, impute with mean/median/mode or a model (KNN), add a 'was_missing' flag, and fit imputers on training data only. - What is the difference between iterators and iterables in Python? Give a practical example from a hypothetical Google project involving search, advertising, maps, and cloud products, and explain which checks or trade-offs matter most.
Show answer
An iterable can produce an iterator (it has __iter__); an iterator has __next__ and remembers its position. A for-loop calls iter() on the iterable and then next() repeatedly. Example application: In a hypothetical Google project involving search, advertising, maps, and cloud products, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - What is backpropagation? Give a practical example from a hypothetical Salesforce project involving CRM, sales operations, and customer data workflows, and explain which checks or trade-offs matter most.
Show answer
It computes the gradient of the loss with respect to every weight by applying the chain rule backwards through the network, so gradient descent can update them. Example application: In a hypothetical Salesforce project involving CRM, sales operations, and customer data workflows, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - What is SVM and the kernel trick? Give a practical example from a hypothetical Razorpay project involving payment gateway, settlement, and merchant integrations, and explain which checks or trade-offs matter most.
Show answer
SVM finds the maximum-margin separating hyperplane. Kernels such as RBF compute similarity in a higher-dimensional space implicitly, so non-linear boundaries are possible. Example application: In a hypothetical Razorpay project involving payment gateway, settlement, and merchant integrations, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - What is TF-IDF? Give a practical example from a hypothetical Intuit project involving financial software, tax preparation, and small-business tools, and explain which checks or trade-offs matter most.
Show answer
Term Frequency × Inverse Document Frequency: a word scores high if it is frequent in one document but rare across all documents. A classic way to turn text into numeric features. Example application: In a hypothetical Intuit project involving financial software, tax preparation, and small-business tools, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - Pandas: find the top 3 products by revenue in each region. Give a practical example from a hypothetical Walmart project involving retail commerce, inventory, and supply-chain operations, and explain which checks or trade-offs matter most.
Show answer
(df.assign(rev=df.price * df.qty) .groupby(['region', 'product'])['rev'].sum() .reset_index() .sort_values('rev', ascending=False) .groupby('region').head(3)) Example application: In a hypothetical Walmart project involving retail commerce, inventory, and supply-chain operations, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - Difference between a shallow copy and a deep copy? Give a practical example from a hypothetical Oracle project involving enterprise databases, cloud infrastructure, and business applications, and explain which checks or trade-offs matter most.
Show answer
A shallow copy duplicates the outer object but shares nested objects. A deep copy (copy.deepcopy) recursively duplicates everything, so changes to nested items do not leak. Example application: In a hypothetical Oracle project involving enterprise databases, cloud infrastructure, and business applications, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - Your dataset is highly imbalanced (2% positives). How do you handle it?
Show answer
Use stratified splits, class weights, resampling (SMOTE or undersampling) and threshold tuning, and judge the model with PR-AUC or F1 instead of accuracy. - What is gradient descent and what does the learning rate do?
Show answer
An optimisation method that updates weights in the opposite direction of the loss gradient. The learning rate sets the step size: too high and it diverges, too low and it is slow. Variants include SGD, mini-batch and Adam. - What is batch normalisation?
Show answer
It normalises layer inputs per mini-batch and then rescales them, stabilising and speeding up training and allowing higher learning rates. - What is regularization? Explain L1 vs L2.
Show answer
Regularization adds a penalty on weights to reduce overfitting. L1 (Lasso) adds |w| and can push features to exactly zero. L2 (Ridge) adds w² and shrinks weights smoothly. - Design an end-to-end churn prediction system. Give a practical example from a hypothetical HCLTech project involving enterprise technology services and infrastructure, and explain which checks or trade-offs matter most.
Show answer
Define churn and the prediction window → build usage and billing features → handle imbalance → train gradient boosting → evaluate with PR-AUC and lift → explain with SHAP → deploy as batch scoring or an API → monitor drift → hand top-risk users to the retention team. Example application: In a hypothetical HCLTech project involving enterprise technology services and infrastructure, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift.
Practise: Docker basics · 15 questionsEasy
- What are Python's main built-in data types? Give a practical example from a hypothetical Infosys project involving enterprise consulting, digital platforms, and client transformation, and explain which checks or trade-offs matter most.
Show answer
int, float, complex, bool, str, list, tuple, set, dict and NoneType. Mutable ones are list, set and dict; the others are immutable. Example application: In a hypothetical Infosys project involving enterprise consulting, digital platforms, and client transformation, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - What is NumPy broadcasting?
Show answer
The rule that lets arrays of different shapes operate together by virtually stretching the smaller one, for example adding a scalar or a (3,) vector to a (4,3) matrix. - What is TF-IDF? Give a practical example from a hypothetical Amazon project involving an online marketplace, fulfilment operations, and cloud services, and explain which checks or trade-offs matter most.
Show answer
Term Frequency × Inverse Document Frequency: a word scores high if it is frequent in one document but rare across all documents. A classic way to turn text into numeric features. Example application: In a hypothetical Amazon project involving an online marketplace, fulfilment operations, and cloud services, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - Which activation functions do you know and when to use them? Give a practical example from a hypothetical Microsoft project involving developer tools, cloud services, and productivity applications, and explain which checks or trade-offs matter most.
Show answer
ReLU for hidden layers, sigmoid for binary outputs, softmax for multi-class outputs and tanh when zero-centred outputs help; Leaky ReLU avoids dead neurons. Example application: In a hypothetical Microsoft project involving developer tools, cloud services, and productivity applications, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - What is gradient descent and what does the learning rate do? Give a practical example from a hypothetical Apple project involving consumer devices, App Store workflows, and subscription services, and explain which checks or trade-offs matter most.
Show answer
An optimisation method that updates weights in the opposite direction of the loss gradient. The learning rate sets the step size: too high and it diverges, too low and it is slow. Variants include SGD, mini-batch and Adam. Example application: In a hypothetical Apple project involving consumer devices, App Store workflows, and subscription services, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - Explain ROC curve and AUC. Give a practical example from a hypothetical Uber project involving ride-hailing, driver operations, and real-time dispatch, and explain which checks or trade-offs matter most.
Show answer
The ROC curve plots true positive rate against false positive rate across thresholds. AUC is the probability that a random positive is ranked above a random negative; 0.5 is chance. Example application: In a hypothetical Uber project involving ride-hailing, driver operations, and real-time dispatch, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - Explain ROC curve and AUC. Give a practical example from a hypothetical D. E. Shaw project involving quantitative research and financial technology, and explain which checks or trade-offs matter most.
Show answer
The ROC curve plots true positive rate against false positive rate across thresholds. AUC is the probability that a random positive is ranked above a random negative; 0.5 is chance. Example application: In a hypothetical D. E. Shaw project involving quantitative research and financial technology, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - Why do we use activation functions? Why is ReLU popular? Give a practical example from a hypothetical Stripe project involving online payments, billing, and financial infrastructure, and explain which checks or trade-offs matter most.
Show answer
Activations add non-linearity so networks can learn complex patterns. ReLU (max(0, x)) is cheap and reduces vanishing gradients compared with sigmoid/tanh; Leaky ReLU avoids 'dead' neurons. Example application: In a hypothetical Stripe project involving online payments, billing, and financial infrastructure, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - How does a decision tree decide where to split? Give a practical example from a hypothetical PayPal project involving digital payments, merchant checkout, and transaction risk, and explain which checks or trade-offs matter most.
Show answer
It tries candidate splits and picks the one that most reduces impurity — Gini or entropy (information gain) for classification, variance / MSE for regression. Example application: In a hypothetical PayPal project involving digital payments, merchant checkout, and transaction risk, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - What is TF-IDF? Give a practical example from a hypothetical Razorpay project involving payment gateway, settlement, and merchant integrations, and explain which checks or trade-offs matter most.
Show answer
Term Frequency × Inverse Document Frequency: a word scores high if it is frequent in one document but rare across all documents. A classic way to turn text into numeric features. Example application: In a hypothetical Razorpay project involving payment gateway, settlement, and merchant integrations, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - How does a decision tree decide where to split? Give a practical example from a hypothetical Zepto project involving quick commerce, inventory, and last-mile delivery, and explain which checks or trade-offs matter most.
Show answer
It tries candidate splits and picks the one that most reduces impurity — Gini or entropy (information gain) for classification, variance / MSE for regression. Example application: In a hypothetical Zepto project involving quick commerce, inventory, and last-mile delivery, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - What are decorators in Python? Give a practical example from a hypothetical Morgan Stanley project involving wealth management, trading, and investment platforms, and explain which checks or trade-offs matter most.
Show answer
A decorator wraps a function to add behaviour such as logging, timing or caching without changing its code. It is applied with the @name syntax above the function. Example application: In a hypothetical Morgan Stanley project involving wealth management, trading, and investment platforms, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - How do you perform feature selection? Give a practical example from a hypothetical HSBC project involving international banking, risk, and cross-border payments, and explain which checks or trade-offs matter most.
Show answer
Use filter methods (correlation, chi-square), wrapper methods (RFE), embedded methods (Lasso, tree importance) and domain knowledge, validating each choice with cross-validation. Example application: In a hypothetical HSBC project involving international banking, risk, and cross-border payments, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - What is the difference between iterators and iterables in Python?
Show answer
An iterable can produce an iterator (it has __iter__); an iterator has __next__ and remembers its position. A for-loop calls iter() on the iterable and then next() repeatedly. - How would you build a churn prediction model end to end? Give a practical example from a hypothetical Cisco project involving networking, security, and collaboration infrastructure, and explain which checks or trade-offs matter most.
Show answer
Define churn and the prediction window, build behavioural features, split by time, train and compare models, evaluate with recall and lift, explain drivers and monitor drift after deployment. Example application: In a hypothetical Cisco project involving networking, security, and collaboration infrastructure, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift.
Practise: MLflow · 15 questionsMedium
- What is a confusion matrix? Give a practical example from a hypothetical Microsoft project involving developer tools, cloud services, and productivity applications, and explain which checks or trade-offs matter most.
Show answer
A table of true positives, false positives, true negatives and false negatives from which accuracy, precision, recall and F1 are calculated. Example application: In a hypothetical Microsoft project involving developer tools, cloud services, and productivity applications, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - How do you remove duplicates from a DataFrame? Give a practical example from a hypothetical Flipkart project involving e-commerce marketplace, seller tools, and fulfilment, and explain which checks or trade-offs matter most.
Show answer
df.drop_duplicates(subset=[...], keep='first') removes repeated rows; use duplicated() first to inspect what will be dropped. Example application: In a hypothetical Flipkart project involving e-commerce marketplace, seller tools, and fulfilment, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - What is a neural network? Give a practical example from a hypothetical Razorpay project involving payment gateway, settlement, and merchant integrations, and explain which checks or trade-offs matter most.
Show answer
Layers of connected neurons that apply weights, biases and activation functions to learn complex patterns, trained by backpropagation. Example application: In a hypothetical Razorpay project involving payment gateway, settlement, and merchant integrations, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - What is tokenisation in NLP? Give a practical example from a hypothetical Zepto project involving quick commerce, inventory, and last-mile delivery, and explain which checks or trade-offs matter most.
Show answer
Splitting text into units such as words, subwords or characters that are mapped to ids; subword methods like BPE handle rare words well. Example application: In a hypothetical Zepto project involving quick commerce, inventory, and last-mile delivery, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - Difference between a shallow copy and a deep copy? Give a practical example from a hypothetical TCS project involving enterprise IT services, integration, and client delivery, and explain which checks or trade-offs matter most.
Show answer
A shallow copy duplicates the outer object but shares nested objects. A deep copy (copy.deepcopy) recursively duplicates everything, so changes to nested items do not leak. Example application: In a hypothetical TCS project involving enterprise IT services, integration, and client delivery, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - Difference between a shallow copy and a deep copy? Give a practical example from a hypothetical LinkedIn project involving professional networking, job discovery, and recruiting products, and explain which checks or trade-offs matter most.
Show answer
A shallow copy duplicates the outer object but shares nested objects. A deep copy (copy.deepcopy) recursively duplicates everything, so changes to nested items do not leak. Example application: In a hypothetical LinkedIn project involving professional networking, job discovery, and recruiting products, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - What is transfer learning? Give a practical example from a hypothetical Meesho project involving social commerce, seller listings, and logistics, and explain which checks or trade-offs matter most.
Show answer
Reusing a model pretrained on a large dataset and fine-tuning it on a smaller task-specific dataset, saving data, time and compute. Example application: In a hypothetical Meesho project involving social commerce, seller listings, and logistics, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - Explain logistic regression. Give a practical example from a hypothetical Zomato project involving food ordering, restaurant discovery, and delivery, and explain which checks or trade-offs matter most.
Show answer
It models the log-odds of a binary outcome as a linear function and passes it through a sigmoid to give probabilities, trained by maximising likelihood. Example application: In a hypothetical Zomato project involving food ordering, restaurant discovery, and delivery, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - Which activation functions do you know and when to use them? Give a practical example from a hypothetical Paytm project involving payments, merchant services, and financial products, and explain which checks or trade-offs matter most.
Show answer
ReLU for hidden layers, sigmoid for binary outputs, softmax for multi-class outputs and tanh when zero-centred outputs help; Leaky ReLU avoids dead neurons. Example application: In a hypothetical Paytm project involving payments, merchant services, and financial products, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - What is regularization? Explain L1 vs L2. Give a practical example from a hypothetical ServiceNow project involving IT service management and enterprise workflow automation, and explain which checks or trade-offs matter most.
Show answer
Regularization adds a penalty on weights to reduce overfitting. L1 (Lasso) adds |w| and can push features to exactly zero. L2 (Ridge) adds w² and shrinks weights smoothly. Example application: In a hypothetical ServiceNow project involving IT service management and enterprise workflow automation, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - How do you perform feature selection?
Show answer
Use filter methods (correlation, chi-square), wrapper methods (RFE), embedded methods (Lasso, tree importance) and domain knowledge, validating each choice with cross-validation. - Pandas: merge vs join vs concat?
Show answer
merge joins on columns, SQL-style (how='inner', 'left', ...). join joins on the index. concat stacks DataFrames along rows or columns. - Explain ROC curve and AUC.
Show answer
The ROC curve plots true positive rate against false positive rate across thresholds. AUC is the probability that a random positive is ranked above a random negative; 0.5 is chance. - How do you deploy and monitor a machine learning model? Give a practical example from a hypothetical D. E. Shaw project involving quantitative research and financial technology, and explain which checks or trade-offs matter most.
Show answer
Package the model behind an API with versioning, track latency and errors, monitor input drift and prediction quality, and automate retraining with rollback. Example application: In a hypothetical D. E. Shaw project involving quantitative research and financial technology, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - What is a RAG system and why use it? Give a practical example from a hypothetical Tech Mahindra project involving telecom platforms, IT services, and digital transformation, and explain which checks or trade-offs matter most.
Show answer
Retrieval-Augmented Generation fetches relevant documents and gives them to an LLM as context, reducing hallucination and keeping answers grounded in current private data. Example application: In a hypothetical Tech Mahindra project involving telecom platforms, IT services, and digital transformation, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift.
Practise: Capstone project · 11 questionsMedium
- Explain train, validation and test sets. Give a practical example from a hypothetical Capgemini project involving client delivery, data platforms, and enterprise transformation, and explain which checks or trade-offs matter most.
Show answer
Train fits the model, validation tunes hyperparameters and model choice, and the untouched test set gives a final unbiased estimate of performance. Example application: In a hypothetical Capgemini project involving client delivery, data platforms, and enterprise transformation, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - What is data leakage? Give a practical example from a hypothetical Apple project involving consumer devices, App Store workflows, and subscription services, and explain which checks or trade-offs matter most.
Show answer
Information from outside the training window, such as future data or test statistics, enters training and inflates performance. Split first, then fit scalers and encoders on training data only. Example application: In a hypothetical Apple project involving consumer devices, App Store workflows, and subscription services, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - What is tokenisation in NLP?
Show answer
Splitting text into units such as words, subwords or characters that are mapped to ids; subword methods like BPE handle rare words well. - Explain ROC curve and AUC. Give a practical example from a hypothetical TCS project involving enterprise IT services, integration, and client delivery, and explain which checks or trade-offs matter most.
Show answer
The ROC curve plots true positive rate against false positive rate across thresholds. AUC is the probability that a random positive is ranked above a random negative; 0.5 is chance. Example application: In a hypothetical TCS project involving enterprise IT services, integration, and client delivery, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - What is PCA and when do you use it? Give a practical example from a hypothetical Uber project involving ride-hailing, driver operations, and real-time dispatch, and explain which checks or trade-offs matter most.
Show answer
It projects data onto orthogonal directions of maximum variance to reduce dimensions, remove correlation and speed up models, at some cost of interpretability. Example application: In a hypothetical Uber project involving ride-hailing, driver operations, and real-time dispatch, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - What is backpropagation? Give a practical example from a hypothetical Stripe project involving online payments, billing, and financial infrastructure, and explain which checks or trade-offs matter most.
Show answer
It computes the gradient of the loss with respect to every weight by applying the chain rule backwards through the network, so gradient descent can update them. Example application: In a hypothetical Stripe project involving online payments, billing, and financial infrastructure, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - Random forest vs a single decision tree? Give a practical example from a hypothetical Flipkart project involving e-commerce marketplace, seller tools, and fulfilment, and explain which checks or trade-offs matter most.
Show answer
A forest averages many trees trained on bootstrapped rows and random feature subsets, which cuts variance and overfitting at the cost of interpretability. Example application: In a hypothetical Flipkart project involving e-commerce marketplace, seller tools, and fulfilment, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - Pandas: find the top 3 products by revenue in each region.
Show answer
(df.assign(rev=df.price * df.qty) .groupby(['region', 'product'])['rev'].sum() .reset_index() .sort_values('rev', ascending=False) .groupby('region').head(3)) - How would you build a churn prediction model end to end? Give a practical example from a hypothetical Capgemini project involving client delivery, data platforms, and enterprise transformation, and explain which checks or trade-offs matter most.
Show answer
Define churn and the prediction window, build behavioural features, split by time, train and compare models, evaluate with recall and lift, explain drivers and monitor drift after deployment. Example application: In a hypothetical Capgemini project involving client delivery, data platforms, and enterprise transformation, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - How do you deploy and monitor a machine learning model? Give a practical example from a hypothetical Morgan Stanley project involving wealth management, trading, and investment platforms, and explain which checks or trade-offs matter most.
Show answer
Package the model behind an API with versioning, track latency and errors, monitor input drift and prediction quality, and automate retraining with rollback. Example application: In a hypothetical Morgan Stanley project involving wealth management, trading, and investment platforms, compare with a baseline, prevent leakage, evaluate segment performance, check calibration or explainability when relevant, and monitor drift. - How would you optimise a slow Pandas pipeline on a 5 GB file?
Show answer
Read in chunks or use usecols and dtypes, convert strings to category, avoid apply with row loops in favour of vectorised ops, and consider Polars, Dask or Parquet storage.