xyz Interview Question for Analysts


Country: India
Interview Type: In-Person




Comment hidden because of low score. Click to expand.
0
of 0 vote

we can have the below class as:-
Movie:- movie_id , Movie_name , artists etc
Cinema:- Id , name , arrayList<Screen>;
Screen:- movie_id , show_id , ArrayList<Seat> , screen_id (pk)
Seat:- seat_id , row_num , cinema_id , isBooked ;
reserved_Seats:- reserved_id , seat_id , status
Ticket:- id , movie_id , cinema_id , city_id , user_name , show_id , double price;
Booking:-
booing_id , ticket_id , booking_time , user_id ;

API UpdatePrice():- here we can track the max(booking_time) from booking table and if(currTime - max(book_time) >=4 ) then ticket.setPrice(price-price*.10) ;

if select count (distinct booking_id) from booking in time Interval say 2 houres then Ticket.setPrice() whatever we want to set.

- veedee May 11, 2017 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

class ticket:
    def __init__(self, price, time_elapsed, sold):
        self.price = price
        self.time_elapsed = time_elapsed
        self.sold = sold
        print(self.price, self.time_elapsed, self.sold)
    def demand(self):

        print(self.price, self.time_elapsed, self.sold)
        # Price will increased if time elapsed is less than 4 and ticket sold is more than 5
        if self.time_elapsed < 4 and self.sold >= 5:
            self.price += ((10/100) * self.price)
            print("chargeable price",self.price)
        # Price will decrease if time elapsed is more than 4 and no ticket is sold
        elif self.time_elapsed >= 4 and self.sold == 0:
            self.price -= ((10/100) * self.price)
            print("chargeable price",self.price)
        else:
            print("chargeable price",self.price)
class userbasic:
    def basic(self):
        while(True):
            user_input1 = int(input("Enter basic price"))
            user_input2 = int(input("Enter time elapsed"))
            user_input3 = int(input("Enter number of tickets sold"))
            final_price = ticket(user_input1, user_input2, user_input3)
            final_price.demand()

ticket_price=userbasic()
ticket_price.basic()

- Anonymous September 16, 2018 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

class ticket:
def __init__(self, price, time_elapsed, sold):
self.price = price
self.time_elapsed = time_elapsed
self.sold = sold
print(self.price, self.time_elapsed, self.sold)
def demand(self):

print(self.price, self.time_elapsed, self.sold)
# Price will increased if time elapsed is less than 4 and ticket sold is more than 5
if self.time_elapsed < 4 and self.sold >= 5:
self.price += ((10/100) * self.price)
print("chargeable price",self.price)
# Price will decrease if time elapsed is more than 4 and no ticket is sold
elif self.time_elapsed >= 4 and self.sold == 0:
self.price -= ((10/100) * self.price)
print("chargeable price",self.price)
else:
print("chargeable price",self.price)
class userbasic:
def basic(self):
while(True):
user_input1 = int(input("Enter basic price"))
user_input2 = int(input("Enter time elapsed"))
user_input3 = int(input("Enter number of tickets sold"))
final_price = ticket(user_input1, user_input2, user_input3)
final_price.demand()

ticket_price=userbasic()
ticket_price.basic()

- Anonymous September 16, 2018 | Flag Reply


Add a Comment
Name:

Writing Code? Surround your code with {{{ and }}} to preserve whitespace.

Books

is a comprehensive book on getting a job at a top tech company, while focuses on dev interviews and does this for PMs.

Learn More

Videos

CareerCup's interview videos give you a real-life look at technical interviews. In these unscripted videos, watch how other candidates handle tough questions and how the interviewer thinks about their performance.

Learn More

Resume Review

Most engineers make critical mistakes on their resumes -- we can fix your resume with our custom resume review service. And, we use fellow engineers as our resume reviewers, so you can be sure that we "get" what you're saying.

Learn More

Mock Interviews

Our Mock Interviews will be conducted "in character" just like a real interview, and can focus on whatever topics you want. All our interviewers have worked for Microsoft, Google or Amazon, you know you'll get a true-to-life experience.

Learn More