-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApple.py
More file actions
35 lines (23 loc) · 882 Bytes
/
Apple.py
File metadata and controls
35 lines (23 loc) · 882 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Oct 17 17:07:40 2019
@author: oscarbarbier
Good morning! Here's your coding interview problem for today.
This problem was asked by Apple.
Implement a job scheduler which takes in a function f and an integer n,
and calls f after n milliseconds.
Upgrade to premium and get in-depth solutions to every problem, including this one.
If you liked this problem, feel free to forward it along so they
can subscribe here! As always, shoot us an email if there's anything we can help with!
Ready to interview? Take Triplebyte's quiz and skip straight
to final interviews with top tech companies!
"""
import time
def f_retard(f, n, **args):
time.sleep(n/1000)
return(f(**args))
def print_1(string = "Hello World"):
print(string)
f = print_1
f_retard(print_1, 2000, string = "Coucou")