Disclaimer:
Educational Use Only:
The website links provided are to be used strictly for educational and knowledge-gaining purposes only.
No Misuse:
Do not misuse the links or the information contained therein for any commercial, illegal, or unethical activities.
Respect for Websites and Businesses:
Respect the intellectual property and business interests of the websites and their owners. Do not attempt to alter, copy, or redistribute content without proper authorization.
Acknowledge Value of Knowledge:
Recognize and value the knowledge and resources shared by these websites. Use the information responsibly and ethically.
No Endorsement:
The provision of these links does not imply endorsement of the linked sites, their content, or their products and services. Users are responsible for evaluating the suitability and accuracy of the information.
User Responsibility:
By accessing these links, you agree to use the information at your own risk and to comply with all applicable laws and website terms of use.
Overall MCQs for Reference
- Which of the following is the primary purpose of date parsing in machine learning?
a. Data visualization
b. Converting date strings into standardized datetime objects
c. Model evaluation
d. Hyperparameter tuning
Answer: b. Converting date strings into standardized datetime objectsdocsumo+1 - When extracting date features, which Python library provides the to_datetime() function?
a. Scikit-learn
b. Matplotlib
c. Pandas
d. NumPy
Answer: c. Pandasstackoverflow - What is a common feature extracted from dates during feature engineering for time series analysis?
a. Regression coefficient
b. Month
c. String length
d. R-squared value
Answer: b. Monthmlexam+1 - Why is it important to parse dates during machine learning preprocessing?
a. Models require date formats in string type
b. To enable extraction of temporal features
c. Text data models ignore dates
d. It encrypts sensitive data
Answer: b. To enable extraction of temporal featurespromptcloud+1 - Which date parsing function in Python raises errors if the format doesn’t match and errors is not set to ‘coerce’?
a. pd.parse_dates
b. dateutil.parser.parse
c. pd.to_datetime
d. datetime.strftime
Answer: c. pd.to_datetimerafalab.dfci.harvard+1 - In Spark NLP, which annotator is used to extract a single date from a document?
a. Word2Vec
b. DateMatcher
c. RegexTokenizer
d. DocumentAssembler
Answer: b. DateMatcherjohnsnowlabs - Which typical issue occurs if date strings are not standardized before model training?
a. Model overfitting
b. Data leakage
c. Parsing errors
d. Increased accuracy
Answer: c. Parsing errorspromptcloud+1 - When parsing dates, which format symbol represents the full year in Python’s strftime?
a. %d
b. %m
c. %Y
d. %H
Answer: c. %Ystackoverflow+1 - What does parsing relative dates (e.g., “yesterday”, “last week”) require?
a. Model hyperparameters
b. Rule-based systems or NLP
c. Loss function adjustment
d. None of the above
Answer: b. Rule-based systems or NLPjohnsnowlabs+1 - Which operation is often performed after parsing dates for time-based machine learning analysis?
a. Random under-sampling
b. Feature aggregation by time periods
c. Class balancing
d. Clustering
Answer: b. Feature aggregation by time periodsmlexam+1 - What is the result of parsing “2025-10-30” with the format “%Y-%m-%d”?
a. Error
b. Datetime object for October 30, 2025
c. The string “2025-10-30”
d. Integer value
Answer: b. Datetime object for October 30, 2025stackoverflow - Which Python library supports parsing dates in 204 different languages with built-in tools?
a. NumPy
b. Spark NLP
c. PyCaret
d. Seaborn
Answer: b. Spark NLPjohnsnowlabs - When extracting features, what is a typical transformation for a datetime column?
a. Drop the column
b. Extract year, month, day, hour as new columns
c. Convert to string
d. Ignore the column
Answer: b. Extract year, month, day, hour as new columnsrafalab.dfci.harvard+1 - What does “epoch time” refer to in date parsing?
a. Date as string
b. Time in milliseconds or seconds since 1970-01-01 UTC
c. A string format
d. None of the above
Answer: b. Time in milliseconds or seconds since 1970-01-01 UTCrafalab.dfci.harvard - Which keyword argument in pd.to_datetime() is used to infer the datetime format?
a. parse_format
b. infer_format
c. format_infer
d. guess_format
Answer: b. infer_formatstackoverflow - What is a risk of using ambiguous date formats (e.g., “01/03/2025”) in international datasets?
a. Data leakage
b. Incorrect parsing as different dates
c. Overfitting
d. None of the above
Answer: b. Incorrect parsing as different datesrafalab.dfci.harvard+1 - Which feature is NOT typically derived from a parsed datetime feature?
a. Day of week
b. Time since last record
c. Text length
d. Quarter
Answer: c. Text lengthmlexam+1 - Which of the following is a common use for date parsing in transactional data analysis?
a. Converting amounts to strings
b. Label encoding categories
c. Calculating time intervals between transactions
d. Clustering text comments
Answer: c. Calculating time intervals between transactionsmlexam+1 - What does setting errors=”coerce” in pd.to_datetime() do?
a. Raises a ValueError for invalid strings
b. Returns NaT for unparsable values
c. Ignores the column
d. Converts all values to string
Answer: b. Returns NaT for unparsable valuesstackoverflow - Which date format is ISO 8601 compliant?
a. MM-DD-YYYY
b. DD/MM/YYYY
c. YYYY-MM-DD
d. YY/MM/DD
Answer: c. YYYY-MM-DDrafalab.dfci.harvard - What is the output class of datetime.datetime.strptime(‘2025-10-30’, ‘%Y-%m-%d’)?
a. String
b. Datetime object
c. Timedelta
d. List
Answer: b. Datetime objectstackoverflow+1 - Why is feature engineering on parsed dates crucial for seasonality detection?
a. Date features are not used for seasonality
b. Allows modeling of recurring time patterns
c. Masks outliers
d. Reduces dimensionality
Answer: b. Allows modeling of recurring time patternsmlexam - Which class in Python is used for representing both date and time?
a. time
b. timediff
c. datetime
d. timestamp
Answer: c. datetimerafalab.dfci.harvard+1 - What is the best way to handle missing days when parsing dates in NLP?
a. Set to a default day
b. Omit date
c. Replace with “Unknown”
d. Convert all to NaN
Answer: a. Set to a default dayjohnsnowlabs - In Spark NLP, which component enables matching of multiple date expressions in text?
a. DateMatcher
b. MultiDateMatcher
c. Tokenizer
d. VectorAssembler
Answer: b. MultiDateMatcherjohnsnowlabs - What is a key benefit of automated date parsing in large-scale machine learning pipelines?
a. Manual intervention for every record
b. Enables rapid and accurate feature creation
c. Slower pipeline execution
d. Reduces model explainability
Answer: b. Enables rapid and accurate feature creationdocsumo+1 - Which commonly used time unit is derived from parsed dates for recency analysis?
a. Ordinal
b. Seconds
c. Year-month-day
d. Minutes
Answer: b. Secondsrafalab.dfci.harvard - What does extracting “time since event” from a datetime feature enable in predictive modeling?
a. Categorical encoding
b. Survival or hazard analysis
c. Clustering
d. Text mining
Answer: b. Survival or hazard analysismlexam+1 - Which component in a Python script is required to parse and process string dates?
a. import matplotlib
b. from datetime import datetime
c. import seaborn
d. from random import randint
Answer: b. from datetime import datetimestackoverflow+1 - In the context of date features, what does “lag feature” typically refer to?
a. The difference between actual and predicted values
b. The value of a target variable at a previous time step
c. Feature selection process
d. Train-test split operation
Answer: b. The value of a target variable at a previous time stepmlexam+1 - What is the minimum information required to construct a valid datetime object?
a. Year only
b. Year, month, and day
c. Month only
d. Hour only
Answer: b. Year, month, and dayrafalab.dfci.harvard - What is one use for extracting the “weekday” from parsed dates?
a. Detecting cyclical patterns
b. Encoding strings
c. Combining datasets
d. Sorting by frequency
Answer: a. Detecting cyclical patternsmlexam+1 - What is the output type of Pandas DatetimeIndex?
a. List
b. Array of strings
c. Index of datetime64 objects
d. Integer index
Answer: c. Index of datetime64 objectsstackoverflow - In time series data, why is the order of date records crucial after parsing?
a. Random order improves models
b. Algorithms depend on temporal sequence
c. It only affects headers
d. Date order has no effect
Answer: b. Algorithms depend on temporal sequencemlexam+1 - Which function is useful for extracting all date attributes (year, month, week, etc.) from a column in Pandas?
a. .ftime
b. .repeat
c. .dt
d. .div
Answer: c. .dtstackoverflow - If a dataset has dates in multiple formats, which preprocessing technique should be applied before modeling?
a. Random resampling
b. Type coercion
c. Date normalization/parsing to standard format
d. One-hot encoding
Answer: c. Date normalization/parsing to standard formatpromptcloud+1 - Which field is NOT typically included in a standard date object?
a. Hour
b. Month
c. Latitude
d. Year
Answer: c. Latituderafalab.dfci.harvard - Which type of analysis especially benefits from extracting the “hour of day” from timestamps?
a. Text mining
b. Temporal trend analysis
c. Feature selection
d. Overfitting assessment
Answer: b. Temporal trend analysismlexam+1 - In feature engineering, how can holidays be encoded from date features?
a. Omit rows
b. Add binary flag for holidays
c. Replace with string “Holiday”
d. No action required
Answer: b. Add binary flag for holidaysrafalab.dfci.harvard+1 - Which scenario is most likely to result in failure for the date parsing process?
a. Using correct ISO formats
b. Mismatching string and format patterns
c. Providing valid date strings
d. Using datetime objects
Answer: b. Mismatching string and format patternsstackoverflow+1 - What is the effect of time zones on date parsing in global datasets?
a. No effect
b. Can cause misalignment if not accounted for
c. Increases model efficiency
d. Improves accuracy
Answer: b. Can cause misalignment if not accounted forstackoverflow - Which method will best parse the string “15th April, 2023” to a datetime object in Python?
a. to_datetime with dayfirst=True
b. Basic int conversion
c. Multiplying by 2
d. Renaming the column
Answer: a. to_datetime with dayfirst=Truerafalab.dfci.harvard+1 - What is a result of not handling missing values after date parsing?
a. Automatic model tuning
b. Errors during model fitting
c. Improved accuracy
d. Reduced overfitting
Answer: b. Errors during model fittingstackoverflow - Which keyword argument in pd.to_datetime() allows for acceptance of multiple possible formats?
a. multi_fmt
b. infer_datetime_format
c. format_multiple
d. try_formats
Answer: b. infer_datetime_formatstackoverflow - Which process would best convert “2023/04/15”, “15-04-2023”, and “April 15, 2023” into uniform datetime objects?
a. Apply pd.to_datetime() with infer_datetime_format=True
b. Manual entry
c. String concatenation
d. Label encoding
Answer: a. Apply pd.to_datetime() with infer_datetime_format=Truerafalab.dfci.harvard+1 - What feature engineering step is enhanced by well-parsed datetime features?
a. Dimensionality reduction
b. Time-based grouping and resampling
c. String tokenization
d. Random sampling
Answer: b. Time-based grouping and resamplingmlexam+1 - How can time-to-event variables be computed from parsed dates?
a. Subtract datetime columns
b. Multiply datetime columns
c. Concatenate strings
d. Random split
Answer: a. Subtract datetime columnsmlexam+1 - What happens if you parse the nonexistent date “2023-02-30”?
a. Returns a valid datetime object
b. Raises an error or returns NaT
c. Ignores the date
d. Fills with zeros
Answer: b. Raises an error or returns NaTstackoverflow - Which is a robust method for extracting dates in free-text using NLP?
a. Hard coding
b. Named Entity Recognition (NER)
c. Manual tagging
d. SVM classifier
Answer: b. Named Entity Recognition (NER)promptcloud+1 - What is the recommended way to ensure consistent chronological order in a DataFrame after parsing dates?
a. Shuffle rows
b. Sort by the parsed datetime column
c. Set index to a random column
d. Remove the datetime column
Answer: b. Sort by the parsed datetime columnrafalab.dfci.harvard+1
- https://www.docsumo.com/blogs/data-extraction/data-parsing
- https://www.promptcloud.com/blog/data-parsing-for-ai-and-ml/
- https://stackoverflow.com/questions/60701329/different-ways-to-pre-process-date-in-machine-learning-using-python
- https://www.mlexam.com/feature-engineering/
- https://rafalab.dfci.harvard.edu/dsbook/parsing-dates-and-times.html
- https://www.johnsnowlabs.com/extracting-exact-dates-from-natural-language-text/
- https://www.sanfoundry.com/1000-machine-learning-questions-answers/
- https://www.gyansetu.in/blog/machine-learning-mcq-interview-preparation/
- https://www.igmguru.com/blog/machine-learning-mcqs
- https://www.interviewbit.com/machine-learning-mcq/
- https://interviewkickstart.com/blogs/articles/machine-learning-mcqs-answers
- https://www.sanfoundry.com/c-multiple-choice-questions-answers-date-time-function/
- https://futureskillsacademy.com/blog/top-machine-learning-mcqs-with-answers/
- https://www.javaguides.net/2023/08/java-date-time-api-quiz-mcq.html
- https://www.placementpreparation.io/mcq/machine-learning/
- https://www.geeksforgeeks.org/quizzes/machine-learning-quiz-questions-and-answers/
- https://labex.io/tutorials/java-how-to-apply-date-parsing-techniques-438485
- https://www.cloudskillsboost.google/course_templates/11/quizzes/437493?locale=uk
- https://www.acmecollinsschool.com/data-engineering-with-python-mcqs-questions.html
- https://www.gyansetu.in/blog/data-analytics-mcq-quiz-interview-preparation/