Mctaba Labs logo
BootcampData ScienceThe WhiteboardProjectsEventsMasterclassesWebinarsLearn
Book CallApply

500+ developers already in the community

Get answers, find accountability partners, and stay ahead

Join Discord →
Mctaba Labs logo

Educating 1 million students in tech by 2030.

Programs

  • Coding Bootcamp in Nairobi
  • Data Science to AI Engineering
  • HighSchool Graduates Launchpad
  • AI & Business Automation
  • Corporate Training
  • Kids & Teens
  • McTaba Story & Mission
  • Full-Stack Curriculum
  • Course Pricing & Plans
  • Frequently Asked Questions

Resources

  • Join Discord Community
  • Tech Events in Nairobi
  • Masterclasses
  • Free Resources
  • Learn
  • Data Science Guides
  • African Payments Reference
  • Campus
  • Africa Tech Talent Report
  • Partner With Us
  • Start a Project
  • Software & AI Studio
  • Our Work
  • Outcomes

Contact Us

  • 124 Manyani East Road, Lavington, Nairobi
  • +254727795603
  • Book a Discovery Call

Office Hours:

Mon-Fri: 9am - 2pm EAT

Sat: 10am - 12pm EAT

© 2026 Mctaba Labs - A product of Edtech Industries. All rights reserved.

Privacy PolicyTerms of ServiceRefund Policy
  1. Learn
  2. Data Science in Kenya
  3. Data Science Interview Questions for Kenya, With Model Answers
Bonaventure OgetoBy Bonaventure Ogeto|Updated November 3, 2026

Last checked 3 November 2026

Data Science Interview Questions for Kenya, With Model Answers

Expect four question types: SQL on transaction tables, statistics such as precision and recall, a case question on M-Pesa or loan data, and a take-home task. These are practice questions built from duties in real Kenyan job ads, not leaked interview papers. Each comes with a model answer below.

In this article

  1. 1. Where these questions come from
  2. 2. SQL questions on a transactions table
  3. 3. Statistics and machine learning questions
  4. 4. Case questions on M-Pesa and loan data
  5. 5. Take-home tasks: what to hand in

Where these questions come from

McTaba runs coding and data bootcamps in Kenya. This guide is written to be useful whether or not you ever join one.

We do not have interview transcripts from any named Kenyan employer, and we will not pretend to. What we do have is the duties those employers print in their job ads. Gulf African Bank lists fraud, churn and collections models. Pezesha lists repayment rates, portfolio at risk and days past due. Co-operative Bank lists model benchmarks, validation and fairness (Gulf African Bank, Pezesha, Co-operative Bank, all checked on 3 November 2026).

So we wrote the questions an interviewer would use to test those duties. Practise them aloud. For the full career picture, start with the data science career guide for Kenya.

For general interview prep, our knowledge base has SQL interview questions, Python interview questions and behavioural interview questions for Kenya. Want structured practice? The Data Science to AI Engineering programme builds these skills in sequence.

SQL questions on a transactions table

Assume a table txns(customer_id, txn_time, type, amount, status) that looks like an M-Pesa export.

Q1. Total sent per customer per month. Model answer: group by customer and month, filter the type first, and order the result.

SELECT customer_id,
       date_trunc('month', txn_time) AS month,
       SUM(amount) AS total_sent
FROM txns
WHERE type = 'send' AND status = 'completed'
GROUP BY customer_id, date_trunc('month', txn_time)
ORDER BY customer_id, month;

Say aloud why you filter in WHERE (before grouping) and not in HAVING. It shows you know the order of execution.

Q2. Customers with more than three failed transactions in a day. Model answer: group by customer and date, count failed rows, and filter the groups with HAVING.

SELECT customer_id, txn_time::date AS day, COUNT(*) AS failed
FROM txns
WHERE status = 'failed'
GROUP BY customer_id, txn_time::date
HAVING COUNT(*) > 3;

Q3. Each customer's second transaction. Model answer: use a window function, ROW_NUMBER() OVER (PARTITION BY customer_id ORDER BY txn_time) in a subquery, then keep row 2. Mention that RANK would repeat on ties.

Q4. Portfolio at risk. Model answer: PAR30 is the outstanding balance of loans more than 30 days late, divided by the total outstanding balance. State the definition first, then write the query with a CASE expression. A careful candidate asks which balance counts (principal or principal plus interest) before writing a line.

More practice is in our SQL for data analysis guide.

Get weekly developer tips

Join 25,000+ developers. Practical guides, job tips, and new content — straight to your inbox.

No spam. Unsubscribe anytime.

Statistics and machine learning questions

Q5. A fraud model scores ninety-nine out of a hundred on accuracy. Is it good? Model answer: not on its own. Fraud is rare, so a model that flags nothing can score that high. Ask for precision (of the alerts, how many were real) and recall (of the real fraud, how many we caught), and agree which error costs more. A blocked genuine payment annoys a customer. A missed fraud loses money.

Q6. What does "statistically significant" mean? Model answer: a result this extreme would be rare if nothing were going on, by a bar you set in advance (often one chance in twenty). It is not the chance the idea is true. Say it in one plain sentence, then give an example, for instance a new USSD menu and a change in completion rate.

Q7. Your credit model was trained only on people who got loans. What is wrong? Model answer: selection bias. You never saw how the rejected applicants would have repaid. Say how you would reduce it: a small random test group, or careful use of reject inference.

Q8. Overfitting. Model answer: the model memorised the training data. Show you can detect it, with a gap between training and test scores, and fix it with simpler models, more data or cross-validation.

Build the base in our statistics for data science guide.

Case questions on M-Pesa and loan data

A case question has no single right answer. The interviewer is watching how you think. Use the same five steps each time: clarify, define success, look at the data, propose a method, state the risks.

Case A. "Mobile money fraud has risen. How do you find it?" Model answer: clarify what counts as fraud and how fast alerts must fire. Success is more caught fraud with few blocked customers. Look at amounts, times, new devices and repeated small transfers. Start with simple rules, then a model such as gradient boosting, judged on precision and recall. Risks: rare labels, fraudsters changing tactics, and false alerts on genuine customers. We build one in our fraud detection guide.

Case B. "Should we lend to a boda boda rider with a six-month M-Pesa history?" Model answer: ask what the lender can legally use. Under the Data Protection Act 2019, personal data needs a lawful basis, such as the customer's consent for this use. Then show features: income regularity, balance floor, repayments on small loans. Compare with a simple baseline and check fairness across groups. Risk: six months is thin, so start with small limits.

Case C. "Repayments from our SACCO members dropped last quarter. Why?" Model answer: split the drop by member segment, branch, loan age and month, then check for data changes (a new system, a late file) before you suggest a business cause. Analysts who check the data first earn trust.

Take-home tasks: what to hand in

Many data interviews end in a take-home task: a dataset, a question, two to five days. Treat the hand-in as a small portfolio piece.

  1. Restate the question in one line at the top, so the reader knows you understood it.
  2. Show a baseline before any clever model.
  3. Keep to the time box. If they say four hours, do not send forty. Note what you would add with more time.
  4. Write the limits. Missing data, small samples, what you assumed.
  5. Make it run. A README with one command, as in our portfolio projects guide.

Employers and their needs differ. Where data jobs are posted shows who hires, so you can aim your practice at their data. If you want a cohort to practise with, the Data Science to AI Engineering programme starts on 11 January 2027, and no school can promise a job. See Data Science to AI Engineering.

Key Takeaways

  • ✓Our questions come from duties in real ads, not from leaked papers.
  • ✓Expect SQL on transaction tables, statistics such as precision and recall, a case question and a take-home task.
  • ✓Say your reasoning aloud, and ask a clarifying question before you write any code.
  • ✓In a take-home, show a baseline, keep to the time box and write the limits.

Frequently Asked Questions

What SQL questions are asked in data analyst interviews?
Expect grouping and filtering a transactions table, joins, HAVING, and one window function such as ROW_NUMBER. Lenders add portfolio at risk or days past due. Practise writing them on paper.
Do I need machine learning for a data analyst interview?
Usually not. Analyst ads in our count of Kenyan roles leaned on SQL, Excel and Power BI. Machine learning questions belong mostly to scientist interviews.
How do I answer a case question on M-Pesa data?
Clarify the goal, define success, look at the data, propose a simple method first, then state the risks. Speak your reasoning aloud, because the interviewer is marking the thinking.
Are these the actual questions Kenyan companies ask?
No. We have no interview transcripts. They are practice questions built from the duties printed in real job ads, checked on 3 November 2026.

Learn data science on African data

KES 140,000

Data Science to AI Engineering: 5 months full time or 8 months part time, hybrid in Nairobi. Fraud, credit and M-Pesa data from Week 1, and every model deployed. Starts 11 January 2027.

See the Data Science programme

Related guides

  • AI vs Machine Learning vs Data Science: The Difference
  • Best Data Science Courses in Kenya (2026): Fees, Length, Who Each Suits
  • Can You Learn Data Science Without a Maths Background?

Keep reading

SQL for Data Analysis: Queries You Will Use Every Week

Five query patterns cover most weekly analyst work. Each is shown on a made-up mobile money table, in PostgreSQL syntax.

Read more

The Statistics You Actually Need for Data Science

Five statistics ideas do most of the work in data jobs. Each one comes with a small worked example you can check on paper.

Read more

Data Science Portfolio Projects That Get Interviews in Kenya

Five portfolio projects on African data, each with a question, a dataset and a deliverable, plus how to package them with a README, a live demo and a write-up.

Read more

Data Jobs in Kenya: Where They Are Posted and What They Ask For

Who posts data jobs in Kenya, under which titles, at what seniority, and what degree and years they ask for, counted from 62 ads on 3 November 2026.

Read more

Catching Mobile Money Fraud with Machine Learning

A fraud model on the public PaySim dataset, judged in shillings lost and wasted alarms rather than a single accuracy score.

Read more

Explore related topics

Breaking Into Tech

Practical, no-nonsense guides for anyone looking to start or change their career in tech. From choosing your first language to acing interviews.

Tech Salary Data

Transparent salary data for tech roles in Africa and worldwide, updated regularly with real market research.

AI Skills & Tools

Practical AI knowledge for developers. Build your first agent, get good at RAG, and pick the right AI coding tools for real work.

Bonaventure Ogeto

Bonaventure Ogeto

Founder and CEO, Mctaba Labs

Software engineer for 8+ years. He runs a Nairobi studio that ships products on M-Pesa, WhatsApp and AI, and teaches what the studio ships. He holds a BSc in Mathematics and Computer Science.

More about the author